There are alleged "risk-reducing" bits of code in this version. According to back test results, the more you "reduce risk" the less profits are made. Keep in mind I have lost multiple thousands of dollars live trading my algorithms. It seems like I learn more about real world behavior by live trading. I back test a lot first of course.

Pre warning: Don't follow me over a cliff, just because I so exuberantly jump!
I am all in UVXY right now including Robin Hood Gold.

This version can be adjusted to your risk tolerance including adding your own basket of ETFs / stocks as a set aside percentage of portfolio.
It, by default, eases into XIV and UVXY positions. That of course, according to back tests, greatly reduces profits.

For anybody wondering, at the time that I started personally using this VIX - oriented algorithm, the "signal" to sell XIV and buy UVXY had already happened a small number of days before. So I manually bought into UVXY including all of my Robinhood gold. As far as I know, this algorithm will switch back and forth "as appropriate". The latest couple of versions do "buy into UVXY first" if that is the situation that the current level of VIX suggests according to the algorithm "rules". In case you are not aware, UVXY has daily decay, meaning it tends to lose money every single day.

Yep, I manually transferred half my UVXY to mostly SVXY and a small percent to LSVX. I was approaching the margin call and it seemed wise to hedge somewhat, so I did what I just said. Not 100% certain how my algo reacts to this specific situation. I may have to turn it off temporarily to avoid unwanted sell / buy. The nature of the beast I suppose.

I could be wrong. But I don't think the API for Robinhood Gold in Quantopian exists yet. So it is all manual transactions and trying to interpret how a specific algo will react to what you did. It does appear to be including the Gold in the portfolio value but not the cash available. I don't think the API for Robinhood includes margin yet.

Tiny change in the custom graph. I got rid of Signal and put in XIV_30 because that is essentially one of the lines that XIV has to cross below to trigger a sell of XIV. Technically XIV_30 is actually XIV_30 + 2.7. I may have to tweak this in the current environment.

I spent a couple of days debugging and trying to get it to behave like I want it to.
I am live trading this version as of now.
I think even with an extended length of time down for UVXY, this may be ok to leave alone.
Of course, keep an eye on it, and decide for youself. Money may be lost. That is always possible.

So a possible "strategy" that might work if you feel like you are losing your shirt in UVXY is to sell UVXY and buy XIV (or SVXY or maybe LSVX), the algo will switch again the next time that conditions are met. If you really don't trust UVXY, then you can change context.UVXY to something you like or less painful. My algo allows you to fit your preferences. I am comfortable with the context.SetAsideLeverageTotal = 0.50 and context.UVXY_BuyLeverage = 0.80 * context.XIV_BuyLeverage. I did however manually sell UVXY after losing some money and manually buy SVXY. I think I'll stick it out this next time though. We shall see. Something that probably helps in the latest version of the algo is that it checks the XIV price against the XIV Average every 30 minutes and so hopefully will get out quickly during a XIV downturn if XIV and XIV Average are already close as is true today, not so for the UVXY though.

I am long until my similar algo hits the sell point. I'm just going to let it cook for a couple years. If it is anything similar to the backtests, that would be an amazing story to tell. Otherwise, I have lost more in worse endeavors before.

If there is one thing we can trust on is that entropy is going up; therefore, events that trigger volatility will always exist, and potentially increase in number over time (disorder wins). Let us feed on fear! :)

@James That is true. However, the algo only buys when volatility is low, and if you look at the daily transactions, once the VIX goes up, you make a killing selling it all, and buying XIV. So, I agree, if you stay in UVXY long and nothing else, you are going to lose no matter what. The instrument is designed to go down.

The hardest thing about this strategy/code, is that you won't see results short-term. I have read the data since the start of the VIX in Excel, and there are periods in which you are going to lose, and lose, and lose. Any normal investor would go insane looking at that on a daily basis. Second guessing the strategy, and wanting to pull out asap.

If live trading behaves even close to what the code is doing now, and you don't look at it (except to ensure the algo is working, since the Q connections go down once in a while), you might see your account at $0 at some point (if XIV gets shut down), or you might find that your investment is now millions due to the incredibly wild swings this strategy profits from.

At what point would one need to update the static UVXY sell signal of >= 19.50? It seems as though at the moment there are sure to be occasional spikes in that neighborhood but eventually the overall decay would necessitate an update. Does it make sense to then calculate a signal dynamically based on some sort of averages value? The same logic applies for the XIV sell signal I would believe.

@Jay I don't know yet. That is a very good question. All hardcoded numbers should be dynamic instead. Those numbers worked in the past, as VIX, XIV, and UVXY have moved up and down inside those limits. But they might not work again as you said due to the constant decay or simply due to different market conditions.

A person in Reddit shared this argument: "One way to do this is to incorporate stuff like rolling correlation of individual S&P sectors with the S&P overall. When the correlation is low, the sectors are moving more independently of each other (like right now) and hedging each other, keeping volatility low. When they all move together, volatility is higher."

Have not explored incorporating this into the algorithm, or another strategy, but it is the right thing to do to avoid overfitting based on past performance.

@James Yes. Mine sold XIV and was supposed to buy UVXY on 2/24. The sale happened. The purchase didn't due to the connection dropping between Q and RH. Accidentally, that was a good thing, since I bought at a lower price (~$16), which right now gave me a small profit. But unless something more dramatic happens, pushing the market down, I expect that profit to disappear quickly.

@Chris Nice! I wrote an option right above. But I need to explore if there are better signals to use for this. I tried Google Trends, but that took me into at dead end. MarketWatch proposes SKEW. VIX options rates before expiration dates are another good signal. Will keep thinking in a simpler to implement set of numbers.

I found some logic errors that were leaving too much unused leverage or in rare cases exceeding 1.0 leverage.
This version is obviously not seeking max profit, but great profit while flattening, a little, all of the DDs.
I am live trading this. I think it might be ok to leave this one alone. But, perfect storm, who knows?
Edit: I added code to more accurately show daily max leverage that is checked every minute.
Thanks to Blue for that code which I slightly modified to start at 0 before trading day so I can see when it goes down, which is also important to know.https://www.quantopian.com/posts/max-intraday-leverage

If anybody out there knows the exact changes needed to make this IB compatible, please post. I received a request from a IB Quantopian newbie requesting that. I am strictly Robinhood at this point. Also, if somebody is wondering, for this to trade unhindered in Robinhood, you have to keep your leverage at 1.0 or less. So Robinhood Gold doesn't help, unless you are going to make manual trades, but that somewhat defeats the purpose of algorithmic trading, for me at least.

Charles, can this be traded manually in real time? How soon does Quantopian show a signal? Can one just run this during normal market hours and trade it when it signals a buy/sell. Seems like slippage wouldn't hurt it too much.

The downside to trading manually is timing. There seems to be an advantage, at least for this algo, to trading at 1 minute after open and 5 minutes before close. If you are skilled at buying dips and selling spikes, then manual transactions may get a superior return. If you don't want to risk the algo automatically touching your real portfolio, then paper trading, as mentioned above, may be what you want.

I had a chance to relax a little and look again at the triggers for getting out of UVXY and back into XIV. So I made it lean heavier toward XIV, and jump out of UVXY quicker, while still catching the occasional nice UVXY return with limited risk.
Anyways, I think this is a little improved while still keeping drawdown limited.

Charles, first I would like to thank you for sharing your algorithms. I tried coding my own algorithms, and can never seem to get them to run correctly. So since getting into this whole quantopian thing I have been reliant on finding good algorithms shared by generous strangers such as yourself and tweaking them slightly to my liking. I have been live trading this one on robin hood for about a week now.

I noticed you mentioned there was no way to implement robin hood gold yet, however I just noticed an algo tonight that seems to implement it. Not sure how to get it working with your algo, but I'll post a clone of that one below, let me know what you think.

That is curious. I have doubts. Does anybody know anybody that is actually trading live with Robinhood Gold where the algo actually fills trades with more than the cash available without the order getting rejected by Robinhood? At some point, I will test this again.
The relevant lines appear to be:

Thanks for the shout out Charles. I don't remember who I cloned that from at the moment, but I'll try to find the original later and mention them in here.
Have you considered using SPX futures as indicators in this algorithm?
Again thanks for your work on this, you are a God among men for sharing.

Edit: First and foremost, thanks to min elmim above and whoever algo he cloned. I would not have attempted to use the full margin in the algo again if he had not posted that code.
Edit: If you cloned the just posted version, clone this instead. Much improved, in timing of Rebalance and also tweaked "record leverage" code for faster back testing.
Live trading this version now. It is very early. However, it does appear to be using my Robinhood margin AKA Robinhood Gold.
This version is likely to attempt more often to day trade. You should have more than $25,000 in your account and / or have Robinhood "day trade pattern prevention" enabled.
Disable any of the scheduled Rebalance that you do NOT want to do. Your choice.
Change the RhMargin in TarPer:

RhMargin = 3000.00 # Set to 0 if you do not have Robinhood Gold

or you will get a lot of rejected buy orders.

Do your own research. Try to understand the risks. Make your own decisions. You probably will lose a lot of money now or later.

Yes I do. It is unfortunate and sometimes painful and inconvenient. It is a "free" service though, so hard to complain.
I just shrug it off and login again. Sometimes it requires a full relogin and sometimes not. I don't know the reasons why or not, I just do whatever is necessary to get it connected again.

Hopefully this version will retry failed orders.
I also made it aggressively sell everything and buy a smaller UVXY position and have cash for the remainder. Feel free to change the code if you don't like that behavior.
Parts of this code, especially the retry orders part, I have never tried in live trading. So we shall see how it does.

@Peter,
What is your logic for saying that?
To me it seems that either might work. But the original_order is how it was when I copy pasted it.
Did you do some debugging that shows original_order does not work?
I have not as yet attempted to debug this specific code. But to me, it looks good as is.

Interesting, I assumed that the new signal might outperform my already existing signals when plugged into my algo. Nope. It is the combination of "William's VIX Fix indicator a.k.a. the Synthetic VIX" with my already existing "signals" that produces superior results. That is my subjective opinion at least. It certainly appeals to my personal preferences.

At some point, I will change the code to automatically fetch the min / max prices, which would improve historical back testing, because the pairs would be relevant regardless of point in time.

Received this runtime error when it retried a cancelled order:
BadOrderParameters: Attempted to place an order with a limit price of
That makes sense since I am only using market orders.
So I changed the code from:
retry_id = order(
original_order.sid,
original_order.amount,
style=LimitOrder(original_order.limit)
)
to:
retry_id = order(original_order.sid, original_order.amount)

@Walter Greaney
This algo will likely always tend to have higher drawdowns than many other algos.
Having said that, make sure you are using the latest version.
There are differences in the code that can make a big difference.
Even so, this test shows 49% max DD which is still quite high.
There are other VIX algos on Quantopian that have smaller DDs. Some of them, I used code from for this algo, not necessarily to make DDs smaller though.

Anybody wondering why testing before 2012 with my algo does not give expected results?
The reason is I do not yet have proper code for handling NANs (not a number). So XIV and UVXY do not exist before 2012 and those NAN values never get properly replaced with real values when XIV and UVXY are born. My code does not handle that situation.

if trading live Robinhood, then those min / max pairs are populated with actual prices. Otherwise, they are populated with 0 initially.

Yes, the Robinhood Gold code works in live trading. Otherwise it would be worthless to me.
The key line is:
RhPV = context.portfolio.portfolio_value + RhMargin - DoNotSpend
Whatever your level of margin is with Robinhood, goes in RhMargin. Mine is 3000. You must adjust this to your situation. Be it 0 or something else. Or else you will get a lot of rejected orders.In simple terms, Robinhood calculates portfolio value as positions value plus cash (not including Robinhood total available margin).
We simply add the margin to it. We then use the new value to calculate buy orders. It really is that simple.
Ok, having said how simple it is, now let me explain a caveat.
Robinhood has a formula (I don't know if it varies for different people.) for calculating how much of your own cash must be used on a specific stock.
For me, for XIV, it is 68% initial, and 60% maintenance requirement.
For me, for UVXY, it is 60% initial, and 50% maintenance requirement.
For me, for SVXY, it is 68% initial, and 60% maintenance requirement.
For me, for ZIV, it is 50% initial, and 25% maintenance requirement.
For me, for TQQQ, it is 80% initial, and 75% maintenance requirement.
So, you will still have an expected number of rejected orders when it hits the above limits.
Even so, in live trading with Robinhood margin, I have found it does use most of the available margin.
As your portfolio grows larger, margin is a smaller and smaller percentage of it, thus eventually zero rejected orders.
Maybe if I adjusted the DoNotSpend to be a calculated percentage of margin, it would completely eliminate rejected orders caused by the above limits.
Hope that was a simple yet thorough explanation.

Let me say first, these volatility - related investments are more risky. You can lose a lot of money.
Having said that, the potential for profits are undoubtedly real. My live trading for the last 30 days has profit of 20.12%. However, I have only been investing in these volatility - related ETFs since approx March 9th, 2017. From March 9th through approx April 7th, I did experience a significant loss. There is a learning / education that you have to go through before you can be comfortable in this kind of investment. I think I've finally turned the corner on this. I've had some hard lessons taught me as a result of emotional manual trades. I think I have the algo to a point that I can, for the most part, let it make the decisions. However, reality is that we, the humans, must still babysit it, even if just to restart the algo when it stops unexpectedly.

Also (putting this part in bold), UVXY will lose money 70 to 80 % (or higher) of the time. It can, occasionally have a great profit.

I think if you have thoroughly studied these ETFs and VIX and what they mean and how they behave, and are comfortable with the patterns and risk, it may be right for an individual. That is where I am.

I have, at least on one occasion, bought a week - long binary option to temporarily protect against a large drop in the stock market.

Hi, Charles have you thought about incorporating the vix futures ratio into this algo as a potential trade signal? Contango and backwardation are great indicators. Also, you could have your algo invest in leveraged gold etfs and leveraged spy etfs during specific market conditions.

@Jay - It attempts automatically to profit from VIX spike with UVXY. Most of the time though it jumps back out UVXY after a certain amount of loss. Fair to say, that most attempts will lose money. However, if you study the backtesting, maybe slightly less than once per year, it tends to successfully time the VIX spike and reap quite big profits. That is the only reason I am leaving UVXY in there, is for those rare big gains. The rest of the time I just jump back out of it after certain amount of losses pile up.

@Nick - I have considered those, but I am still a bit of a novice at implementing additional signals. Most of the time, when I attempt to improve the algo, I erase all the changes, because it made it worse.

Short answer, live trading results do appear to correlate with backtests.
Robinhood says I made +22.1% "past month".
Quantopian says I made +23.8% 04/08/2017 to 05/08/2017.

Longer answer, there are things that will affect your return:
starting cash for backtest different from starting cash live trading
backtest margin different from live trading effective margin, which can vary for various reasons
manual interventions
any actual slippage
my current code starts with zero in min / max pairs for backtests, different behavior from live trade in Robinhood

@Charles what about modifying your hedge based on ATR? I was thinking 5 days, but 3 days seemed to work the best, so I might be overfitting to this time period. I'm still learning so I apologize if its a N00B approach.
I added this on Line 126:

@Charles I saw in Simons code how he decides to trade and copied something similar to that. Essentially, it seems like the money is made when volatility is not too high or not too low, so I copied his logic to check what the standard deviation of returns were, you can play around with it, but it helps get the max drawdown lower, and also increases the return I think (I'm not sure how much slippage affects the returns). The code has to be cleaned up, but I just wanted to show the idea. Let me know what you think.
Starting at Line 136, then Line 231, then Line 244:

@Kurry - Thanks, those are helpful. I implemented with some slight changes. For one thing, full 1.0 leverage for long VIX if conditions are met. Smoothed out most of the drawdowns and max DD is now 38%.

I was looking over the tear sheet and thought I would post it here. The drawdown seems fine enough for me at least. After a 10% drawdown, I can just stop it for five to ten days, and it should be fine.

I agree that stopping the algo and simply exiting either the losing position or all positions, is a reasonable option when conditions are scary. Then, when things seem more normal, turn the algo back on. Keep in mind, that without a change, the default in the algo upon startup is to go short VIX. I also have purposely, for my own "signals" that are still in the algo at least, made them favor going short VIX more often than long VIX.

I noticed that yesterday before close and again this morning after open, the usual adjustment trades did not happen. My initial thought was something is wrong. Then I remembered the additional "signals" especially std and std_uvxy restraints will sometimes prevent orders. So, I guess it is doing what it is supposed to do. I then proceeded to talk myself into just letting the algo do its job. As the weeks go by, I am more comfortable just observing it and not intervening, unless necessary to start the algo after an unexpected halt. Lately, it picks up right where it left off, if I restart it during the same session. It often, in that situation, does not require a full relogin.

Sure, but I think it may not work out so well in practice. Scary to me, may not be scary to others, and vice versa. LOL, I guess we could configure a preference variable for "Hell no, I'm not leaving!", "As long as I've recently made truckloads of money, I am staying!", "Uhhh, if things look shaky, get me out NOW!", and "I am not sure I should be in here at all! Mommy!".

Try to hold as little as possible of that margin beyond end of day, and if zero then it is free. Margin hits 6.8 million during the run currently, a tad over 137 thousand percent of the original capital. Carried day-to-day, consider what the fee would be. About 1/3rd of the curve is margin. I'd love to see what would happen if a non-margin account could be modeled, the closest you can come is probably order_target_value against context.account.settled_cash while no open orders, give that a whirl. Only XIV and UVXY are ordered, fyi for the casual reader/visitor.

@Charles, for me it is also limited to $3,000, but there isn't $5k in settled cash yet since I just deposited, but they do describe situations where margin goes past $50,000 and how they will charge 5% interest. It does seem that they will do margin greater than $3,000 in the near future, see here. I'll email them though. https://support.robinhood.com/hc/en-us/articles/213262686-Robinhood-Gold-Buying-Power I emailed support to get a higher margin limit and I will let you know what they say.

LOL Thanks Kurry! You bursted my bubble! I thought everybody was in the same situation as me. I am so conceited. You know, I recently broke two pairs of spectacles and had to order wider / longer spectacles to fit my big head!

This is great news though! It would appear that I will qualify for more margin soon.

The initial min / max pairs are populated automatically now. So there is no need to manually update the min / max pairs now when you stop / start the algo.
However, if you want it to start in long VIX (UVXY), then you will have to change:

I thought about automatically adjusting the margin available based on account value. However, at a minimum, the amount of margin you have available is subject to what you, the investor, choose. So automatic adjustment of margin in the algo is probably not a good idea.

@Nick regarding margin calls, I have not experienced a real margin call yet. I have received at least one email and on a couple of occasions I noticed my Robinhood app notified me of margin call conditions, but there was not a "You must sell or deposit by this date / time". So far Robinhood has not sold my shares without my first telling them to do it. So, I am not sure how needed automatic selling to satisfy margin calls would be, nor do I currently have any idea how to implement it since I am not certain when these real margin calls happen and how Robinhood implements them, and whether that behavior will be consistent.

@Nick and @Kurry,
Let me first say, I am hesitant to be critical. We are all learning, and I appreciate the helpfulness, community, and learning spirit of Quantopian staff and community. Also, I say that obviously I have found many times my own logic errors in my own algos since I began writing algos.

I may be misunderstanding the code, but I think both Kurry's and Nick's versions have the feel of a work in progress. I say that, because after looking at those versions, it seems that the algos are not doing what you think they are doing. There are important and apparently relevant functions defined that never get called. Seemingly important preference / customization variables are customized as if they are meant to be used, yet are bypassed with hard - coded parameters in the execution part of the code. In one of Kurry's versions, I don't think it is hedging when he thinks it is. Specifically, it goes half portfolio in SH regardless of whether XIV (short VIX) or UVXY (2x long VIX) are the other half of the portfolio. I think maybe he intended to purchase SPY when purchasing UVXY. Now, I consider myself very much a novice at the whole hedging methodology, so I may be completely misunderstanding the intent of the code.

In the execution code, 1.0 parameter is hard - coded instead of using VIX_HedgeLeverage which would potentially provide variance in execution results.

Having said all that, if that behavior / results is what you intended, then I suppose it is fine, because it accomplishes your purposes.

Because it does full 1.0 regardless of the perceived safety of doing so, it gets higher max drawdowns. That is my subjective opinion. Also, keep in mind, in the code that I write I am probably using the word "hedge" in not exactly the way that hedging enthusiasts would use the word. I strictly mean with "hedge", "reduce my bet" if the risk seems measurably higher. My usage of the word may be unauthorized. 8)

Posting this now in case you don't like the next version.
This uses VMIN instead of XIV if available.
Before anybody asks, VMIN paid a large dividend at the huge dip. It think it shows that big dip only because of timing. You might say it is a race condition causing that. For you programmers, forgive me if I used the term "race condition" incorrectly.

I think VMIN is not a good stock to trade unless limit orders are being utilized due to the very low volume. Also, I have noticed that set aside leverage only reduces drawdowns by a few percent at most and limits growth by much more.

With not being able to use margin for VMIN, I think that is a big enough disadvantage, that I decided to remove VMIN.
I also adjusted the margin to 6,000 and DoNotSpend to 300 to hopefully avoid rejected margin - related orders. Make sure you go to the TarPer section to customize that to your preference.

As far as set aside stocks / leverage is concerned, I am leaving that in there so that it is easy to implement if somebody / including myself prefers it. It can always be ripped out or minimized if somebody prefers not to use it.

freaking brutal, I'm down 13% total for my trading account today from this. I almost stopped the algo yesterday when I was up 7% from starting it 2 weeks ago and sold everything and I'm really kicking myself that I didn't.

It will be interesting to see how this plays out. In backtesting, I did see max drawdowns at around 40% so a drawdown of this nature is nature is only a matter of time. What is important to consider when live trading is how the live trading compares to backtests. If the backtests begin to show major deviations from live trading then I would stop the algo.

I'm keeping the algo active, although it closed all positions (XIV, TQQQ) just before the bell and went all in on UVXY...which gets me nervous! It might work out if the volatility continues tomorrow but we shall see.

I shut the algo down and went long UVXY shortly before close today, but interestingly a copy I had paper trading did the exact same thing 5 mins before close. Gave me some faith and maybe next time I'll just let it do it's own thing.

My algo held. Fortunately it dumped all of its XIV position a few days earlier and held about $500 worth of VMIN so my account is mostly intact. The cool part about VMIN is that it doesn't rebalance daily like XIV does (and it shorts xiv/svxy and vxx/vixy), so if things rebound tomorrow it should do much better than XIV.

I suspect my algo will do tomorrow:
1. It'll determine the short vix risk is too high and will liquidate it's VMIN position in the morning regardless of if the market rebounds tomorrow or not.
2. It'll bump the short upside way up (used for determining leverage when it re-enters a short position)
3. It'll establish a very large position in SQQQ or possibly SQQQ and VMAX depending on if SQQQ has high market beta or not

That said, it all depends on the signals.

My opinion is that this is a very large over-reaction, so it's likely things will die down. Unfortunately, my algo tends to enter SQQQ right as things rebound and eat a loss... but whatever, when the market eventually tanks it'll make money hand over fist. Futures curve is in contango with most recent month below current VIX so the belief this will blow over appears to be the predominate one.

@nick - the one I had paper trading was an older version of the algo, so not sure what the latest would have done. I doubled down on UVXY with this bump after open and probably should turn a profit later today. Overall though I wish I left the algo running as this type of emotionally based buying and selling is killing me.

Yes I'm not sure leaving the algo running would have been great. That dip put me below 25k so Im restricted on a day trading standpoint. The algo bought more UVXY this morning which has tanked 10% so far today and I cant sell it. I have since canceled the algo. Down about $7k in 24 hours. Algo is continuing to plunge since the market is rebounding today and its invested in shorting the market right now.

I was in process of depositing chunks of money each day into the algo, when one of the days was the big drop last week. That was unfortunate. I have now gained most of that drop back. Part of my loss was made larger because of a manual trade I made during 1 or 2 days last week. I was not real confident in the most recent version because it does not do twice daily rebalancing, at least those trades are sometimes not executed because of the most recent code deciding not to execute it. So, I wasn't sure if it was going to work. It appears I would have lost less if I would have just let the algo make all the decisions. Of course, again, as you all experienced, not babysitting it at all is not possible, both for technical and emotional reasons.

You will have to adjust margin and / or DoNotSpend to make sure there will probably always be enough settled cash to make the daily withdrawals.
Margin does have a cost that is paid to Robinhood.
Make it work for you. These are your decisions to research and make.

Hi Charles, I am a part time daytrader and not really a programmer, although I am working with some people on some algos now. I just read through all the robin hood posts and am glad to see such an active thread. Thank you for that. Your posts are amazing. I have also read other threads about algos using the VIX, particularly trading XIV.

One thing I did notice is how slow the algos are to react to severe price movements like the one we had in mid May. The algo I am paper trading now completely missed the move and would have given up significant profits if it weren't for the bounce back to new highs.

Any thoughts on how to combat these quick rapid drops? I ask because I think we may see another significant drop soon and run up of volatility. 1. A lot of hedge fund guys talking about gold 2. Summer tends to slow down and 3. the current price action and indicators look similar to other volatile months for the VIX. 4. political news

Compare current RSI, MACD and price to RSI, MACD and price movement of summer of 2012. They are both diverging. Sure we may recover over time, but it would be nice to see an algo handle these quick dips in a timely manner. I know it;s no easy feat and I guess you can always turn off the algo for a bit.

Anyway, thanks again for the posts. I hope you continue to reap profits.

@Nick
Basically, the returns don't tell the whole story. I wanted it to fit more situations and also be more logical, from my perspective anyways.

@all
I did some reformatting of the logging. The statistics at the end is a work in progress because it does not account for when SyntheticVIX disagrees with BigSignal except for when BigSignal is TQQQ. Not sure I want to combine the two signals into the same section because I like that SyntheticVIX may disagree at the morning rebalance but agree with BigSignal at the afternoon rebalance. Anyways the logs should be easier to comprehend now. More code cleanup / reorganization is needed, but it is functional.