I am new on developing strategies, and here is a simple one based on trading vix etfs.
The idea, in one word, is shorting vix after a sudden jumping.
Any comments & improvements?
QUANTCONNECT COMMUNITY
I am new on developing strategies, and here is a simple one based on trading vix etfs.
The idea, in one word, is shorting vix after a sudden jumping.
Any comments & improvements?
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.
Vladimir
Diwang,
Simple and productive, thanks for sharing.
Grant Forman
nice stuff!
I would consider making it an intraday strategy. Waking up to a 20% UVXY spike if you are short overnight is “not nice” 😊
Varad Kabade
Hi Diwang,
Thank you for sharing the above algorithm with the community. We recommend using
instead of
for checking the data for a security in current data slice.
Sometimes although the key for a security may be available in the slice data, the bar data for that security may not be available. For example, this may happen when non-price(splits, dividends, etc.) data is available for that symbol while bar data is not. Refer to the attached backtest.
Best,
Varad Kabade
.ekz.
We recommend using self.uvxy in data.Bars instead of data.ContainsKey(self.uvxy)
This is good to know, Varad kabade. Can you / QC team please update the related exception message from the framework? --it still recommends using data.ContainsKey, which is what we are all (mostly) doing.
Here's the relevant code in the framework:
https://github.com/QuantConnect/Lean/blob/5d762d16b2ec7bd48fd766b772b0921862deda22/Common/ExtendedDictionary.cs#L277
Varad Kabade
Hi .ekz.,
Thank you for your suggestion. The purpose of the above-mentioned message during exception is to remind us to always check whether the current slice object has data for the given security (Trade and Non-Trade); therefore, the above condition should be checked before trying to access data for the given security.
Our suggestion to use data.Bars is only regarding trying to access the trade data.
Best,
Varad Kabade
Vladimir
Varad kabade,
At what time is self.uvxy in data.Bars executed?
At what time are "splits and dividend adjustments" processed in QC database?
How do I execute self.uvxy in data.Bars in schedule function?
Varad Kabade
Hi Vladimir,
At what time is self.uvxy in data.Bars executed?
This is true when the current slice object has the trade data. For example, at the minute resolution, we can expect the above condition to be true at 9.31 a.m.( If there is trade data for the given security)
At what time are "splits and dividend adjustments" processed in QC database?
The algorithm receives the above data as soon as the above events happen (generally can be expected at midnight). Refer to this doc for more information.
How do I execute self.uvxy in data.Bars in schedule function?
We have self.CurrentSlice that can be used in Scheduled Events or other methods.
Alternative way would be to use the following code snippet :
bar = self.Securities[self.uvxy].GetLastData()
Best,
Varad Kabade
.ekz.
Revisiting this strategy. Great work, diwang .
Grant Forman, I think you're on to something with the suggestion of making this an intra day strategy. How would you recommend one go about doing so?
Diwang
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!