Hi all,
I created a simple model using Pine Script and the Strategy Tester on TradingView to short the VIX by short selling its ETN form, VXX, in order to take advantage of the contango and time decay effects. I call it "VXX Short Master v1.0" because it is still very basic right now but I do plan on adding a lot more parameters and risk management methods to improve later versions. However, I tried to replicate the model as an algorithm here on Quantopian using Python and I'm having trouble getting the results to match. Since TradingView's Strategy Tester is still in beta, I wouldn't be surprised if there turns out to be errors in its calculations. I don't have a programming background so I would really appreciate any help at all from the Quantopian community :-)
Here's a link to my model on TradingView: https://www.tradingview.com/chart/0qdR7LdX/
The model operates on a daily interval. It only uses 1 parameter, the William's VIX Fix (WVF) indicator, to trigger short/cover signals. You can read more about the WVF here: https://www.ireallytrade.com/newsletters/VIXFix.pdf
TRADING RULES:
WVF(28) cross> 14 = SHORT
WVF(28) crosss< 14 = COVER
There can only be 1 open position at any time and every trade uses 100% of the account's available balance. Initial cash is $1,000,000. Slippage and commissions are currently not factored into the model on TradingView.
As you can see, from March 2009 until now, my Quantopian version's gross return is only 1,800% while my TradingView version shows a gross return of almost 3,200%! This discrepancy is too large to ignore so it'd be really interesting to get to the bottom of this. Either my codes on here are wrong, TradingView is wrong, or Quantopian is wrong (which I highly doubt).
Please note that VXX only started trading in 2009 so theoretically speaking, shorting it from inception until now in 1 trade would have only made you 99.99% in gross return.
Thanks ahead!
~Kory