Hi everybody!
I've noticed a performance degradation when trading index options (although this may not be exclusive to the index options). Have a look at the example below. The strategy simply buys 0.3/0.2 call spreads that are between 20 and 80 DTE. Initially, it is fast but as time passes it gets progressively slower.
The attached backtest filters calls between 0 and 90 DTE and is `completed in 545.06 seconds at 2k data points per second. Processing total of 898,112 data points.`. However, changing the filter from 90 to 45 DTE increases the speed from 2k datapoints per second o 24k. Another experiment that I did is simply comment out Buy (i.e. do everything except for buying the spread), while keeping the filter (0, 90) - this yields about 15k datapoints per second.
My question is whether this is the expected speed given the size of the OptionChain or is there anything I can do to speed things up?
Louis Szeto
Hi Aram
The security subscribed in the algorithm will be more and more since AddIndexOption will add in more contracts in the universe before they get removed. Consider using GetOptionContractList together with AddOptionContract method to subscribe less contracts and avoid this issue. (example)
Best
Louis
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.
Aram Darakchian
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!