Historical Data
Common Errors
Indicator Readiness
Indicators can't produce a valid value until they have enough historical data to be ready.
If your indicators require more data than what is currently available (for example, data before an asset's IPO), the indicator_history
IndicatorHistory
method will return fewer data points than you request and the warm-up techniques for manual and automatic indicators won't be able to make your indicators ready.
Numerical Precision
Some factor files have INF split values, which indicate that the stock has so many splits that prices can't be calculated with correct numerical precision. To allow history requests with these symbols, we need to move the starting date forward when reading the data or use raw data normalization. If there are numerical precision errors in the factor files for a security in your history request, LEAN throws the following error:
Live Intraday Data Source
In live trading, if you make a history request for minute data at noon and the history period covers the start of the previous day to the present moment, the data from the previous day will be backtest data. The data of the current day will be live data that we collected throughout the morning. If you make this history request in a backtest, you might get slightly different data for the current day because of post-processing from the data vendor.
In cloud deployments, QuantConnect is the default data provider. If you remove it and use a different data provider, you won't get any price data from QuantConnect. However, we provide the following datasets:
- US Equity Security Master
- US Futures Security Master
- US Equity Option Universe
- US Index Option Universe
- Universe selection datasets
- Non-streaming alternative datasets
QC Data Provider Limitations
When you request historical data or run warm-up, the amount of historical data you can access depends on the resolution of your data subscriptions. The following table shows the amount of trailing historical data you can access for each data resolution:
Resolution | Available History |
---|---|
Daily | All historical data |
Hour | All historical data |
Minute | 1 year |
Second | 2 months |
Tick | 1 month |
In live trading, history requests for Index or Options with the QuantConnect data provider only returns data up to the end of the previous day. For example, if you make a history request for these asset classes at 1 PM Eastern Time (ET), you won't get any data for the current day.
For more information about the QuantConnect data provider, see QuantConnect.
Other Data Provider Limitations
LEAN supports other data providers, including IQFeed and Polygon. For more information about the limitations of these other data providers, see their respective documentation in Cloud Platform, Local Platform, or the CLI.
Brokerage Limitations
LEAN supports several brokerages that can provide historical data. However, some of them have limitations on historical data. For example, Interactive Brokers can be slow, so it can timeout if you request historical data for too many assets at once. For more information about these brokerages and the data they provide, see Datasets.