Hi guys, for some reason, my bot, which is supposed to execute a Long Call calendar spread based on comparing implied volatility of the contract to predicted volatility using SVR-GARCH, is not making trades. What could potentially be the problem? For reference, my OnData method is all the way at the bottom. Thanks in advance!
Mia Alissi
Based on the provided code, there could be several reasons why your bot is not making trades. Here are a few potential issues:
No trades are being executed: The provided code does not contain any trade execution logic. You need to implement a method that will execute trades based on your strategy. This could be in the
OnData
method or another method that is called when certain conditions are met.No options are being selected: The
find_calendar_spread_contracts
method is supposed to select the contracts for the spread, but it's not clear if it's being called anywhere in the code. Make sure this method is being called and that it's returning the expected contracts.Issues with the volatility calculation: The
predicted_volatility_svr_garch
method is supposed to predict the volatility using the SVR-GARCH model, but it's not clear if it's being called anywhere in the code. Also, this method seems to be incomplete as it ends abruptly after thenext_row
variable is defined. Make sure this method is being called and that it's correctly predicting the volatility.Data issues: The
FetchSPXHistory
method is fetching historical data for the SPX index, but it's not clear if this data is being used anywhere in the code. Make sure this method is being called and that the fetched data is being used in your calculations.Without the complete code or more context, it's hard to provide a more specific answer. I would recommend checking these points and making sure that your strategy logic is being correctly implemented. If you're still having issues, you might want to consider asking for help in the QuantConnect forum, where you can share more details about your problem.
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.
Boris
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!