Investment Thesis
Simple Dynamic Momentum
A relatively simple design to capitalize on changes in momentum in large-cap tech stocks, as well as market conditions. This is a starting submission for entry into the competition. No hyperparameter optimisation has been done - these are the first values used in backtesting.
Key Points
Momentum-Based Stock Ranking:
Annualized exponential regression slope used to sort symbols based on their momentum values, highest momentum stocks take long positions and lowest momentum stocks take short positions
Lookback Period: 90 days to rank the stocks based on momentum
Universe: Includes AAPL, MSFT, GOOGL, AMZN, META.
Adaptive Market Exposure:
Market Condition Assessment: Uses 50-day and 200-day SMAs of SPY to determine bullish or bearish conditions.
Dynamic Allocation:
Bullish Market: 99% long, 1% short.
Bearish Market: 99% long, 1% short.
Aggressively long stratergy used due to high performing nature of chosen stocks combined with high profits seen in 2024 Q1/Q2.
Risk Management:
Trailing Stop-Loss: A 17.5% moving stop-loss on all positions to limit drawdowns. This high stop loss % is used due to the relatively safe nature of the chosen stocks, and a trailing stop loss is used rather than a traditional fixed stop loss to automatically track to stocks movement (which is often upwards).
Rebalancing: Monthly adjustments.
Quant League Competitions
Competition entry updated by Abhirup Mukherjee
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.
Quant League Competitions
Competition entry updated by Kathiir Sivanehru
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!