I am running live with IBKR.
at Initialize() during pre market I add the equity and warmupping in the following format:
var added = AddEquity("CGEM", Resolution.Minute, fillForward: false, dataNormalizationMode: DataNormalizationMode.Raw, extendedMarketHours: true);
SetWarmUp(TimeSpan.FromDays(1));
EnableAutomaticIndicatorWarmUp = true;
When I try to make a trade 15 minutes later, I get the following error:
2024-07-22T09:27:03.7129850Z ERROR:: SubscriptionDataSourceReader.InvalidSource(): File not found: ../Data/equity\usa\minute\cgem\20240722_quote.zip
2024-07-22T09:27:04.6517342Z ERROR:: CGEM: 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.
I am subscribed to ibkr real data thingiez, other stocks are successfully traded at the same time by the same algo.
No tickers have data in the minute folder at all. so its weird it is working for some but not for others.
I cannot understand why is it not working, can you please help me?
Mia Alissi
The error message you're seeing indicates that the algorithm is trying to place a trade for a security that it doesn't have price data for yet. This can happen if the data for the security hasn't arrived yet or if there's an issue with the data subscription.
In your case, it seems like the algorithm is unable to find the data file for the security "CGEM". This could be due to a number of reasons:
The data file might not exist in the specified location. Make sure that the data file is present in the correct directory and that the file name is correct.
There might be an issue with the data subscription. Make sure that you have an active subscription for the asset class you're trying to trade.
The security might not have received a bar of data yet. This can happen if the security is added and a trade is attempted in the same iteration. To avoid this, you can use the
SetWarmUp
method to warm up your algorithm before placing a trade. This will ensure that the algorithm has received at least one bar of data for the security before it tries to place a trade.Here is an example of how you can use the
SetWarmUp
method in your algorithm:This will warm up your algorithm for 20 days before it starts trading. You can adjust the number of days to suit your needs.
If you're still having issues, it would be helpful to see a more complete example of your code to better understand what might be going wrong.
Sources:
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.
Super Richman
I have already done the things you say to do.
Louis Szeto
Hi Super Richman
This happens on (1) very illiquid stocks, (2) newly-subscribed stocks or (3) newly-listed stocks in which they do not have any price data ever received when you place the order. For case (1) & (2), you may assume the last known price as a credited current price by seeding it through the security initializer:
For case (3), it is impossible to have a prior price for a newly trading stock, so you can just ignore the warning.
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.
Super Richman
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!