Live Trading

Charting and Logging

Introduction

The live results page shows your algorithm's live trading performance. You can add custom charts and logs to the results page.

Charting

Custom charts are limited to 4,000 data points. Intensive charting requires hundreds of megabytes of data, which is too much to stream online or display in a web browser. If you exceed the quota, the following message displays:

Exceeded maximum points per chart, data skipped

You can create up to 10 custom chart series per algorithm. If you exceed the quota, your algorithm stops executing and the following message displays:

Exceeded maximum series count: Each backtest can have up to 10 series in total.

In live trading, charts are sampled every one and ten minutes. If you create 1-minute resolution custom charts, the IDE charting will downgrade the granularity and display the 10-minutes sampling after a certain amount of samples.

Logging

Logging statements are statements you can add to your algorithm in order to add information to the log file, add information to the Cloud Terminal, or even stop the algorithm. Use these statements to debug your backtests and live algorithms. Consider adding them in the code block of an if statement to signify an error has been caught.

It's good practice to add logging statements to live algorithm so that you can understand its behavior and keep records to compare against backtest results. If you don't add logging statements to a live algorithm and the algorithm doesn't trade as you expect, it's difficult to evaluate the underlying problem.

If you run algorithms on QuantConnect, you must stay within the log quota. To only log when your algorithm is live, use the LiveMode property.

if (LiveMode)
{
    Log("My log message");
}
if self.LiveMode:
    self.Log("My log message")

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: