---
title: "Statistics"
description: "LEAN automatically monitors a set of statistics as your algorithms execute. You can even create custom statistics for further analysis."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/statistics
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/statistics.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/39%20Statistics
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Statistics

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Statistics

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

LEAN automatically monitors a set of statistics as your algorithms execute. You can even create custom statistics for further analysis.

- [Algorithm Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/algorithm-statistics.md): Trade statistics and rolling KPIs
- [Runtime Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/runtime-statistics.md): Performace at a single moment in time
- [Trade Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/trade-statistics.md): Get and customize trade statistics
- [Server Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/server-statistics.md): Resources of the node that runs the algorithm

### See Also

- [Cloud Backtest Results](https://www.quantconnect.com/docs/v2/cloud-platform/backtesting/results.md)

## Pages in This Section

- [Algorithm Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/algorithm-statistics.md): The StatisticsResults object tracks all the statistics of your algorithm. You can access them during execution.
- [Runtime Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/runtime-statistics.md): Runtime statistics show the performace of your algorithm at a single moment in time.
- [Trade Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/trade-statistics.md): The TradeBuilder tracks your trades and calculates some statistics. You can adjust how it defines a trade and how it matches offsetting order fills.
- [Server Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics/server-statistics.md): Server statistics describe the node that runs your algorithm.
