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
Stephen Oehler
Nik milev
Stephen Oehler
Ray Bohac
Stephen Oehler
Stephen Oehler
Nik milev
Stephen Oehler
Ray Bohac
Nik milev
Stephen Oehler
Stephen Oehler
Ray Bohac
As a heads up Tradier identifies VXX as hard to borrow to I had to modify this to take long positions only.
Nik milev
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..
Stephen Oehler
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);
Bryce McDonald
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!
Nik milev
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
AutomatedMachine
Good stuff! Has anyone had any live success with this?
Artemiusgreat
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...
Nik milev
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!