Live Trading
Data Providers
Introduction
Data providers provide a stream of asset prices and quotes delivered to your trading algorithm during live execution. You need live data provider to inject data into your algorithm so that you can make real-time trading decisions and so that the values of the securities in your portfolio update in real-time. You can source data from QuantConnect, brokerage, or a third-party source. To view the available data providers you can use in QuantConnect cloud, see Datasets. To view the available data providers you can use with local algorithms, see the Data Providers.
Data Providers
You can source data from QuantConnect, your brokerage, or third-party providers. The following table lists the data providers:
Data Provider | Cloud | Local |
---|---|---|
QuantConnect | ![]() | |
Alpaca | ![]() | ![]() |
Alpha Vantage | ![]() | |
Binance | ![]() | ![]() |
Bitfinex | ![]() | ![]() |
Bybit | ![]() | ![]() |
Charles Schwab | ![]() | ![]() |
Coinbase | ![]() | ![]() |
FactSet | ![]() | |
Interactive Brokers | ![]() | ![]() |
IQFeed | ![]() | |
Kraken | ![]() | ![]() |
Polygon | ![]() | ![]() |
Samco | ![]() | ![]() |
Theta Data | ![]() | |
TradeStation | ![]() | ![]() |
Terminal Link | ![]() | |
Tradier | ![]() | ![]() |
Zerodha | ![]() | ![]() |
Bar Building
We aggregate ticks to build bars.
In live trading, bars are built using the exchange timestamps with microsecond accuracy. This microsecond-by-microsecond processing of the ticks can mean that the individual bars between live trading and backtesting can have slightly different ticks. As a result, it's possible for a tick to be counted in different bars between backtesting and live trading, which can lead to bars having slightly different open, high, low, close, and volume values.
Latency
Live data takes time to travel from the source to your algorithm. The QuantConnect latencies vary depending on the data provider, but for US Equities, we have a latency of 5-40 milliseconds. A much more significant source of latency is the round trip order times from brokers, which can vary from 100ms to 5 seconds. QuantConnect is not intended for high-frequency trading, but we have integrations to high-speed brokers if you need.
History Requests
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
Warm Up Periods
LEAN supports an automated fast-forward system called "Warm Up". It simulates winding back the date you deployed your algorithm by a specific time period. In backtests, it changes the start date of your algorithm to an earlier time. In live trading, it fetches data from before your deployment and fast forwards through your strategy up to the present day. Warm Up is a great way to prepare your algorithm and its indicators for trading. You can't place trades during the warm-up period because the data feed is replaying historical data for setting algorithm state.