Just a sample strategy, inspired and created in collaboration with Strongs
Wanted to start a collaboration thread and to spark your creativity on adding whatever ideas you're fancy to add on top of this framework.
As tips/ideas we were thinking to add:
- Add a momentum-based ETF selection for the bull days (to select best mom etf from QQQ, FDN, etc.)
- Add a momentum-based ETF selection for the bear days (to select best mom etf from TLT, TLH, etc.)
- Try adding IN&OUT switch (with wait days)
- Replace bull days with a Stock selection strategy
Below few info about the KEI indicator
Key Short—Term Economic Indicators. The Key Economic Indicators (KEI) database contains monthly and quarterly statistics (and associated statistical methodological information) for the 33 OECD member and for a selection of non—member countries on a wide variety of economic indicators, namely: quarterly national accounts, industrial production, composite leading indicators, business tendency and consumer opinion surveys, retail trade, consumer and producer prices, hourly earnings, employment/unemployment, interest rates, monetary aggregates, exchange rates, international trade and balance of payments. Indicators have been prepared by national statistical agencies primarily to meet the requirements of users within their own country. In most instances, the indicators are compiled in accordance with international statistical guidelines and recommendations. However, national practices may depart from these guidelines, and these departures may impact on comparability between countries. There is an on—going process of review and revision of the contents of the database in order to maximise the relevance of the database for short—term economic analysis.
For more information see: http://stats.oecd.org/OECDStat_Metadata/ShowMetadata.ashx?Dataset=KEI&Lang=en
Reference Data Set:
Simone Pantaleoni
Here the framework algo
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.
Peter Guenther
Interesting project, looking forward to the discussion. Well done, Simone Pantaleoni and Strongs!
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.
Strongs
Hi all guys, this is just a base from which to start. The starting idea is to also exploit the concept of in & out and the intersection of ROC by Vladimir . The LEI could actually be exploited for a dynamic selection of ETFs, essentially identifying phases of the economic cycle and then selecting groups of ETFs that perform best in that specific phase of the cycle.
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.
Simone Pantaleoni
New version with the fixes from Vladimir 😊
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
Simone Pantaleoni,
Completed as requested!
The second problem is that you have initialized the position in QQQ,
which is contrary to the main logic at the beginning of backtest.
To solve this. I define
To make self.mom visible on the chart changed self.MOM to self.MOMP
Here is "SIMON LesFlex" modified by Vladimir
with changes I mention above and some cosmetic changes.
Enjoy.
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.
Strongs
The idea would be to turn the indicator like that
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.
.ekz. INVESTOR
First of all, great work :)
I've had some time to look at this, and I want to be sure i'm interpreting it correctly...
Questions:
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.
Simone Pantaleoni
Hi .ekz. ! many thanks for appreciating it. :)
Let me try to answer your questions:
Questions:
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.
.ekz. INVESTOR
Perfect, Simone Pantaleoni. Thanks for this.
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.
Simone Pantaleoni
Hi guys!
As suggested, we have been working behind the scene on applying the concepts shared above about the different phases of the market. Based on that, we apply ETF-selection accordingly, out of a basket of sectorial ETFs (we kept a similar switch to shift to bond in case of possible market downturn using the leading indicator)
Some improvement on Total Return, sharpe and so on.
Feel free to work on this release, fix it in case I've made mistakes (here I rely on Vladimir as PeerReview :P ) and improve it (there's still something to optimize - but don't want to share all in once so… work on it and share your outcomes with us! :) )
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.
Strongs
Surely there is still a lot of work to be done, but this is definitely a great start. Levels for identifying the phases of the business cycle with associated ETF groups was presented. We await more ideas from you to improve it.
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.
Frank Giardina
Great stuff Guys thanks for sharing. I have a question and a comment. I have a Quandl free account have not used it much. I plugged in my key and started looking at the algo. My question is how does the self.history statement get the Quandl data to sync up with the start of the algo? i see the request for the 1400 bars, so does the Quandl request use the start date of the algo as it start retrieval date? I see the data frame adjusting to the different start dates I tried. Any clarification greatly appreciated.
My comment is i have been following a youtube channel Hedgeeye. The gentleman who runs the channel is an ex-Hedge fund manager who also uses a macro view of investing. He uses inflation and gdp rates of change for his strategy much like this algo uses the KEI data as leading indicators.. He uses ETFs like this algo but also uses different styles based on his macro view of 4 Quadrants. Depending on the Quads as he calls them he picks the ETFs and the investment style (Momentum, V:alue, High Beta, Low Beta etc.)
GrowthInflationQuad 1acceleratingslowingQuad 2acceleratingacceleratingQuad 3slowingacceleratingQuad 4slowingslowingA full explanation of his approach is on Hedgeeye.com, but here is a link to his strategy
https://app.hedgeye.com/insights/77156-chart-of-the-day-what-works-in-which-quad?type=macro
Frank
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.
Frank Giardina
Sorry, the grid got messed up when i pasted it
Quad 1 Growth accelerating Inflation slowing
Quad 2 Growth accelerating Inflation accelerating
Quad 3 Growth slowing Inflation accelerating
Quad 4 Growth slowing Inflation slowing
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.
Varad Kabade
Hi Frank,
History method takes the StartDate as the anchor retrieves data before it for the requested period. Refer to the following source code.
returns the last 1400 bars of history but we have the option to pass start and end dates to the History method.
returns the historical data for custom 90 day period.
Refer to the attached backtest, which demonstrates both approaches just comment out any one.
Best,
Varad Kabade
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.
Frank Giardina
Varad,
Thank you for the explanation now i understand
Frank
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.
Frank Schikarski
Hi there,
interesting stuff!!
Here are my 2 cents:
And the results using QQQ and TLT only:
Results using an amended version of Sector ETF's:
Results using an overfitted version of Sector ETF's:
Suggestions for the way forward:
Have fun,
Frank
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.
Tom Penrose
Expanding on Frank's work, I've added to the number of assets allocated depending on the regime.
I've attempted to replicate an asset allocation chart that I have which tells you where you should put your money depending on the trajectory of the economy.
For example, in a scenario of better than expected growth forecasted, it suggests allocating to 37% US equities, 18% non-US equities, 25% US-fixed income, 3% non-US fixed income, 13% alternative investments, and keeping 4% cash.
This doesn't translate perfectly to this strategy but I've done a crude implementation that follows more ETF's weighted based on this chart. For the US-equities component I've maintained the same sectors suggested in the previous version, only with different weighting.
The optimal implementation of this version of the strategy in my opinion would be to use universe selection to choose the best companies in each index, rather than following a whole sector. I think this would increase performance dramatically. Unfortunately, I'm not advanced enough to do this sort of dynamic universe selection.
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.
Simone Pantaleoni
Thanks to Frank Giardina and Tom Penrose for the good work and for moving the thread forward!
You're going on the exact direction I was meant to drive this discussion, when we've started it :)
I've been a bit busy lately on other projects, but next step will be exactly as Tom outlined, about stock-selection to pick up best 4-5 stocks for each sector.
Challenge there is to make the code decently quick, so I think a quite strict pre-selection of stocks will be needed
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.
Frank Giardina
I think we got the wrong Frank, I made some comments and certainly want to help but Frank Schikarski did more meaningful work with his post.
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.
Robert Peterson
Another idea for VIX strategy, low DD, high performance..
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.
GABRIEL PIQUE ROCA
Hello, I'm tryng to backtest alex meuci strategy until february 2018, because of termination of XIV and I can't. Runtime Error: A data subscription for type 'PythonQuandl' was not found. Also I want to test this strategy but only with VXX. short VXX under 0.95 and long VXX above 1.05. How I should write these code.
Thanks
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.
Alex Muci
Just tried to re-run the first algo I posted above (VIX by RSI) - by limiting the backtesting to end of Jan 2018 (i.e. self.SetEndDate(2018,1,20)) - and it did work as before.
Gabriel, why do not you try and use long positions in ZIV (which shorts mid-curve VIX futures, rather than shorting VXX) for a safer and, potentially, easier way to hedge vol spikes with either front VIX futures (now available) or VXX calls?
If I have time will try to post such an example later.
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.
GABRIEL PIQUE ROCA
Thanks for the advice, but I want to backtest the system with short VXX because I already have wich ratios VIX/VXX are optimal. How could I change the code to allow short VXX and long VXX. I'm still learning the documentation. Thanks anyway for the advice. Later I will try with ZIV.
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.
GABRIEL PIQUE ROCA
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.
Pangyuteng
RIP XIV and the 1+ billions that vaporated during the liquidation event.
That being said, I am reviving this thread. ;) added my fix on data retrival below (may still have bugs!), some minor refactoring, and lastly, switched XIV to SVXY.
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.
Pangyuteng
adding another version below. Summary of chages listed below:
+ as suggested by Alex, added "momentum" term based on increasing/decreassing z score of the vix/vxv ratio.
+ logic for long/short volatility is based on if vix/vxv is trending towards contago/backwardation based on "momentum".
+ provided 2 kinds of allocation style - aggressive and conservative.
Backtest performance of the 2 kinds of allocation are listed below (timeframe: 2012 to present).
# aggressive mode: PSR 41%, win/loss rate 59/41, max drawdown 49%, return 1573%
# conservative mode: PSR 34%, win/loss rate 57/43, max drawdown 18%, return 246% (displayed below)
Happy holidays.
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.
Andrés M
Ted that great coding Ted, thanks for sharing! ... got a good laugh looking at the code (braveheart vs babies with 30 year mortgage LOL)
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.
Sunny Nagam
Still new to this but learned the hard way to use the Open and not Close from the custom data imported. Lookahead bias is quite powerful! See Open vs Close performance below:
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.
Sunny Nagam
Tried combining momentum indicators along with the vix/vix3m and vix/vix9d ratios as a mesure of contango/backwardation (I've tried the futures term structure ratios but Quantconnect's futures system makes me want to pull my hair out). I use indicators on SPY since I belive it's the "underlying" and more represtative of the underlying market that ultimately affects VIX values, and technical analysis on a actual ETF makes more sense to me.
I used the SPY crossing sma as an exit signal for short volatility, and SPY macd as an exit signal for long volatility. I find that macd tends to "want" to switch every once in a while even when growth is sustained (but not gaining momentum) and provides too many false positives as an exit signal for short vol since the majority of the time the market trends upwards gradually, so I used sma as a kind of trailing exit. However for long vol I find that once the party is over you want to get out quickly before the spike crashes, so I attempt to use SPY macd as measure of momentum and an exit to get out and minimze losses.
Additionally, usually when exiting a long vol position, much of the time the market is recovering even if temporarily, however due to the lingering backwardation this recovery is not always reflected in a short vol ETP such as SVXY, so I take advantage of this period by staying in TQQQ.
If anyone sees something I missed or could improvme, or has thoughts to add it would be much appreciated.
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.
Jared Broad
I think you should add 1 day to the Time or set the Period = timedelta(days=1). You might be getting some lookahead bias with the custom data imports. I walk through importing custom data here.
https://www.youtube.com/watch?v=VCf9e0S4rDgThe 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!