Running into this error. Just trying to develop a covered call strategy so I'm just playing around with a simple strategy. Buy QQQ if not invested, everyday sell a covered call at the start of the day for DTE0 at about 1.5% out of the money. If QQQ goes up, no adjustments are made, the option is sold and equity and a covered call is sold again the next day. Its pretty easy and is working because about every other day it sells a covered call. But half or more of the days it doesn't sell one and shoots over this error? It doesn't need to warm up more, the algo is working and it sold a call the day before. I also tried timing it to sell at the first minute vs 10 minutes into the day. Still does the same thing. Any idea what's going on?
QQQ 221215C00283000: 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.
Nico Xenox
Hey David Eldringhoff,
just add this line to your code, this will do the trick:
Louis Szeto
Hi David and Nico
Thank you for your answer Nico! Indeed that would solve most of the cases. I would also like to add one more point. For Options and Futures, you might also receive the warning message and not opening a position if you're using SetHoldings. In those edge cases, you'll need to use MarketOrder instead and don't forget to divide the ordering quantity with the contract multiplier.
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.
David Eldringhoff
Mostly my algo works but I'm selling options for crazy prices that dont make sense. This option should be worth like $0.40. Another else run into backtesting issues where sold options sell for near the underlying price instead of a reasonable value?
Time: 01/06/2023 14:31:00 OrderID: 8 EventID: 2 Symbol: QQQ 230106C00277000 Status: Filled Quantity: -2 FillQuantity: -2 FillPrice: 262.91 USD OrderFee: 1 USD IsAssignment: False
Louis Szeto
Hi David
Please refer to this reply in your new thread.
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.
David Eldringhoff
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!