Live Trading

Key Concepts

Introduction

Algorithms should generally work seamlessly shifting from backtesting to live trading with no changes required. In backtesting algorithm events are triggered as fast as possible, whereas in live trading events are triggered in realtime.

Algorithm Portfolio

The live trading algorithm portfolio is loaded from the brokerage holdings, including open orders. When there are unsupported asset types in the portfolio the live trading strategy is stopped as we cannot be sure how to model the asset.

In paper trading the algorithm starts from no portfolio, and attempts to remember the previous portfolio state from the last time the portfolio was deployed.

Your algorithm should not assume it starts from an empty portfolio as you may have holdings from previous deployments.

Stateful Strategies

There is no automatic state management of live strategies in QuantConnect. We recommend algorithms reconstruct state or indicator needs using the WarmUp and History methods.

Once the algorithm has warmed up some objects you can use the Object Store to save the data for the next algorithm restart.

In the event the algorithm is terminated unexpectedly, you should review the live algorithm portfolio at the brokerage to confirm it will behave as expected.

Data Delivery Times

Most data is available at the same time as in backtesting, with the exception of daily data which is often delayed by 4-8 hours (4am - 8am).

US Equities universe selection data is processed at 7-8am ET.

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 required.

Other Brokerages

If we do not support your brokerage reach out to let us and we can attempt to add them to the roadmap. With enough community requests we can build and open-source the brokerage integration.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: