Hello QC,
I'm trying to deploy an algo live but seem to run into the below issue shown in the below extract from live Logs.
2021-04-28 19:07:09 :Launching analysis for L-35dfd3ed29a528d69ae94f5d708a47eb with LEAN Engine v2.5.0.0.114852021-04-28 19:08:39 :Paper Brokerage account base currency: USD2021-04-28 19:08:39 :Warning: SetBenchmark(IWM): no existing symbol found, benchmark security will be added with Equity type.2021-04-28 19:08:39 :FB: 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.2021-04-28 19:08:39 :AMZN: 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.2021-04-28 19:08:39 :NFLX: 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.2021-04-28 19:08:39 :GOOG: 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.2021-04-28 19:16:34 :Algorithm StoppedI'd thought using the self.History to pull historical data would work since these were added manually. I also tried putting a self.Warmup(50) in the init but that didnt seem to change anything either.
def OnWarmupFinished(self):
firstrun = True
if firstrun == True:
for x in ManualInputs.m_tickers:
self.AddEquity(x, Resolution.Daily)
history = self.History([x], 50, Resolution.Daily)
self.MarketOrder(x, 2)
firstrun = False
Is there a different syntax or method I should be using, maybe security.Price?
Thank you in advance,
Miguel
Derek Melchin
Hi Miguel,
We recommend calling `AddEquity` in the `Initialize` method and placing orders in the OnData method. When we add a security, it creates a data subscription and it will be only available on the next data iteration. Normally, this means we cannot add a security and place an order for that security in the same iteration.
For further assistance, please attach a backtest.
Best,
Derek Melchin
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.
Miguel Palanca
Hi Derek,
Thank you! I found your post
https://www.quantconnect.com/forum/discussion/8779/security-doesn-039-t-have-a-bar-of-data-trade-error-options-trading/p1last night and ended up coming up with something similar. Required some further fixing on my end but it looks like that may have fixed it.
Thank you again,
Miguel
Miguel Palanca
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!