I am trying to create a framework for option backtesting for the community to use.
I have everything ready to go but there is one major problem:
I can't make my own custom class a tradeable asset!
So what I want to do is on every OnData(TradeBars data) event of the underlying stock, I will create a new option instance. I will then calculate the theoretical price of this option and populate all its other fields. After this, it should then become a tradable asset such that we can call Order() on it. I've tried creating my own custom data with AddData<.Option.>("AAPL.CALL", Resolution.Hourly); (the dots are to escape the brackets for this post) but this class only reads data before starting the backtest. I need to be able to add data to this asset on the fly.
However, this isn't possible! And if I can't do that, we can't backtest actually buying and selling the option.
Can anyone help me out with this? If we can solve this I can have the option backtesting framework ready within the week.
Thanks in advance :)
JP B
Michael Handschuh
JP B
JP B
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!