Hello, my algorithm relies on historical data updates using self.History method. It works nicely for backtesting, but as I run it live, I get the following messages:
2021-01-13 19:00:01 : WARN: No ETHUSD in history update(2021-01-13 19:00:00.043728, 2021-01-13 18:00:00, 0)
2021-01-13 21:00:01 : WARN: No ETHUSD in history update(2021-01-13 21:00:00.036281, 2021-01-13 20:00:00, 0)
2021-01-13 23:00:01 : WARN: No ETHUSD in history update(2021-01-13 23:00:00.086389, 2021-01-13 22:00:00, 0)
2021-01-14 01:00:02 : WARN: No ETHUSD in history update(2021-01-14 01:00:00.026546, 2021-01-14 00:00:00, 0)
2021-01-14 03:00:01 : WARN: No ETHUSD in history update(2021-01-14 03:00:00.063581, 2021-01-14 02:00:00, 0)
generated by this snippet (called from OnData method)
hist = self.History(symbol, self.last_bar_time(), tostamp)
if symbol not in hist.index:
self.Log(f"WARN: No {symbol} in history update({tostamp}, {self.last_bar_time()}, {n_bars})")
What could be the reason for the difference between backtest/live here?
Ilshat Garipov
Hi Andrey Ustyuzhanin QCAlgorithm's History method calls brokerages' GetHistory method under the hood, for example this one is called for Binance -
https://github.com/QuantConnect/Lean/blob/master/Brokerages/Binance/BinanceBrokerage.cs#L277and the same method is called by the algorithm at start when you use SetWarmUp in your algorithm. Can you get historical data when use SetWarmup - does the data come to OnData?
Derek Melchin
Hi Andrey,
For assistance with live algorithms, contact support@quantconnect.com with the algorithm attached.
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.
Andrey Ust
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!