Back

VXX Intraday Strategies

Hi guys,
This is a strategy for those who want more action :)
Uses VXX short/long - half of the time holding period is few hours, other times sells next day MarketOnOpen
I used 1000,000 as starting capital to overcome VXX, but in now days you can trade with few thousands.
If you want to trade it, check your brokers fees.
A word of caution: minutes data are different for different providers and sometimes sells on Open, so who knows what happens in real world.
Thamks
Nik
Update Backtest






The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.



0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi nik,

Fantastic algorithm, thanks for sharing it with us :-)

I'm going over the code and wondering what the underlying logic is, though. I see you've employed trailing stops, and are taking long/short positions based on (I think) the spy moving average. However many people employ these features in their algos and don't get results as good as these. Is there any reason this should work for VIX and not, say, for another security? Are the parameters calibrated to VIX in this particular case?

Thanks again for the showcase!

-Stephen
0

Hi Stephen,
Disregards the SPY moving average. It was a left over while I was experimenting. IsEntry() and IsExit() determine the entry and exit. You can tweak and play with difference closes one or two days back for VXX for long/shorts and you may get better/similar results.
This algo is just from my observations - you can try with different ETFs and it may work for few of them, but I don't think you can generalize that it is true for all. We would have had a lot of rich guys by now ... :))
Thanks Nik
0

Awesome, thanks nik. Very impressive!
0

Just wanted to add my thanks for sharing this algorithm. I've been running it on a Live IB paper account since Jan 29th and have a 4.5% return. Thought I would share the screenshot.

More importantly I decided to go ahead and take it live on a real money account as of tonight. Here we go!

1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


You know, I was wondering at that myself: would this hold up during the market turmoil that we're seeing currently? Seems it is.

We may owe you thank you cards after all, Nik.
0

Ray, if you don't mind me asking, what is the average number of trades you're seeing? Tempted to throw some money into Tradier, but not sure if I'd be eaten alive by the fees :-P
0

Thank you all for these comments, but don't forget the drawdown - few days are encouraging but not enough.
@Ray, are you running LEAN engine locally on your computer or you are using QC web site to connect to IB paper account?
In my experience, IB sometimes disconnects during the night and I needed to restart the algorithm.
0

Nik, thanks for the cautionary statement. This looks like an incredibly robust algorithm, however I've held off putting real money in it due to its recent performance (see last few months in attached backtest). I wonder if the observations you've made about trading on certain days (i.e. selective deactivation of the algorithm certain days of the week) has changed in the past few months? Do you think it requires an occasional re-calibration, especially now that we're no longer in a trending market?

This is not to say that the recent drawdown is out of the norm. It's not even that particularly severe; however given the particularly volatile environment, I wonder if some of the day-driven behavior has changed.
0


Trade log can be found here https://www.dropbox.com/s/24teq3q9qxyr34j/Last_30_Days.csv?dl=1

Looks to be 6 Orders executed across 19 actual fills

I've using the QC site. I believe the IB disconnect issue was significantly improved in the latest version of LEAN. Disconnects are reported overnight however it reconnects automatically. I made the suggestion to Jared that the reconnects should also be added to the logs and/or an explicit connection status indicator should be made.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Stephen, it is difficult to say if optimization is needed. This may easily lead to over-fitting. If you compare the chart Dec 2012 - Jul 2014 it resembles what we have now. You can play with different parameters and I am sure you can find something better.
The algo was not "properly" created - instead of dividing of windows of data and walk through them comparing algo's results, i just used entire data set available. So, may be these are not best parameters and may be they is overfitting - difficult to say. Just use the algo as workable idea and you may share better results if/when you get them.
@Ray - it is no surprise Lean is better and stable now. The QC team put a lot of hours there...
1

I see your point. Attempting to optimize the days of trade would likely improve the method's usefulness in the current economic climate, potentially at the expense of others.

You say the strategy is currently based on observations you've made about trade trends over the following:

1.) Times of the day
2.) Days of the week

No doubt, there are definitely patterns that we're managing to exploit, however I think the real strength is your implementation of safe guards, smart direction-finding, etc. If we enabled all times of the day, and all days of the week, I wonder what we'd see. On my phone now, but I'll try this tomorrow :-)
1

Ray, thanks for sharing! Looking forward to seeing how you profit from this.
0

As a heads up Tradier identifies VXX as hard to borrow to I had to modify this to take long positions only.

In order to sell any security short, it must be available to borrow. We have an easy to borrow list that you can located by clicking the Trade button and then clicking the link for the Easy to Borrow list. VXX is not currently on the easy to borrow list. If a security is not on the easy to borrow list, you can give us a call and we can contact our clearing firm to find out if they can locate shares to short. Please be aware that if we locate shares that are not on the easy to borrow list, there could be daily fees to hold those shares short in your account.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Ray, you may want to try buying XIV (SVXY) instead of shorting VXX. It should give similar results
2

Still having trouble applying slippage...hate to ask..but any help would be appreciated! I tried using the Fixed Slippage model but after applying it, i get a runtime error..

0

Hi Daniel,

I had similar issues but Michael H. helped me figure it out. Make sure you have the following:

1.) Put this namespace at the top of the main class:

using QuantConnect.Orders.Slippage;

2.) Ensure the following is set for each security:

Securities["SPY"].SlippageModel = new ConstantSlippageModel(0.001m);

0

Apologies ahead of time as I'm as much of a beginner on this site and coding as possible, but how would I go about changing the code to go long XIV instead of short VXX? Thanks in advance!

0

Hi Bruce,

In the Initialize() method, you need to add data for XIV - e.g.:
AddSecurity(SecurityType.Equity, "XIV", Resolution.Minute);

And, then in OnData() for trading you can do something like this: 
if ( IsLong == false)
    SetHoldings("XIV", 1);
else
   SetHoldings("VXX", 1);

Hope that helps.

Nik

1

Good stuff! Has anyone had any live success with this?

0

Trying to break down the strategy, took the last version wih Trailing Stop, could not find any reference to RollingWin class, so removed it, now strategy works exactly the same way as before, but giving me an error about some uninitialized object.

Backtest Handled Error: OnData: Object reference not set to an instance of an object
at QuantConnect.Algorithm.Examples.VIXIntraDay.IsEntry (QuantConnect.Data.Market.TradeBar b, System.Decimal& entryPrice, System.Boolean& IsLong) [0x00138] in <b78b78d3d8794ad0ba18dea16b27e565>:0
at QuantConnect.Algorithm.Examples.VIXIntraDay.OnData (QuantConnect.Data.Market.TradeBars data) [0x000e5] in <b78b78d3d8794ad0ba18dea16b27e565>:0

Which makes me think that some condition in this algo is redundant. I removed the whole class and it still works as it did before...

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed