Hi,
I would like to know how do I trade option base on equity singnal
When the backtest trying to execute the line self.Buy(self.contract,1), it has an error that option quote is not available.
I am not sure if I am doing it in a correct way, my understanding is that I need to wait for the callback when option quote bar arrives before I can place an order on that option, may I know how should I proceed?
Juventus
This is the Error message I am getting:
Backtest Handled Error: TSLA 200417C00560000: The security does not have an accurate price as it has not yet received a bar of data. Before placing a trade (or using SetHoldings) warm up your algorithm with SetWarmup, or use slice.Contains(symbol) to confirm the Slice object has price before using the data. Data does not necessarily all arrive at the same time so your algorithm should confirm the data is ready before using it. In live trading this can mean you do not have an active subscription to the asset class you're trying to trade. If using custom data make sure you've set the 'Value' property.
Shile Wen
Hi Juventus,
The issue is that we are trying to buy a contract that we just subscribed to, so we haven't had a chance to receive one bar of data for the security. What we can do is put the order logic in OnData. In addition, we need to have an additional check for the contracts list length after the second round of filtering. I've shown the fixes in the attached backtest.
Best,
Shile Wen
Juventus
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!