This is an example of my work building algos. The attached backtest is a simple RSI strategy that purchases “SPY” option contracts and uses a trailing stop to exit positions. I was able to speed up the time it takes to run backtests by bypassing OnData, using GetOptionContract with a custom filter, and creating my own class object to track positions. This 1 year backtest with over 1,000 trades took about 5 minutes to complete using a B4-12 node.
Note: This is only an example to demonstrate my work. This is not a viable strategy and will not work in current markets.
Jack Pizza
Why won't it work? How can we make it work? Would adding say a simple filter like a 100-200 moving average make it viable in bear markets? Or switching to puts?
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.
Jack Pizza
Also not sure if it works with options but you might be able to use this for trailing stops
self.AddRiskManagement(MaximumDrawdownPercentPerSecurity(0.05))
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.
Benjamin Sanchez
Jack,
I'm sure by adding some additional indicators and risk management tools you could implement RSI into a solid strategy. I just meant that this strategy as is (blindly ordering on RSI signals only) would not be viable in the long term.
I've tried the built in risk management models but I prefer to customize my own. Rather than a strict 5% stop loss, the trailing stop is tiered. You'll see in this model the stop loss is initially set at -50% but then once the position achieves a 10% profit the trailing stop is initialized.
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!