> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# SystemPerformance

## Definition

The **SystemPerformance** object holds all trades and trade performance data generated by a strategy.

Notes:

* A **NinjaScript** strategy can generate both synthetic trades (historical backtest trades) and real-time trades executed on a real-time data stream. If you wish to access only real-time trades, access the **RealTimeTrades** collection.
* The first trade of the **RealTimeTrades** collection will contain a synthetic entry execution if the strategy was NOT flat at the time you start the strategy.
* These properties require that [IncludeTradeHistoryInBacktest](/developer/desktop-sdk/references/strategy/includetradehistoryinbacktest) be set to true.

## Methods and Properties

| Method/Property                                                                                | Description                                                                                                                               |
| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [AllTrades](/developer/desktop-sdk/references/strategy/systemperformance/alltrades)            | Gets a [TradeCollection](/developer/desktop-sdk/references/strategy/tradecollection) object of all trades generated by the strategy       |
| [LongTrades](/developer/desktop-sdk/references/strategy/systemperformance/longtrades)          | Gets a [TradeCollection](/developer/desktop-sdk/references/strategy/tradecollection) object of long trades generated by the strategy      |
| [RealTimeTrades](/developer/desktop-sdk/references/strategy/systemperformance/realtime-trades) | Gets a [TradeCollection](/developer/desktop-sdk/references/strategy/tradecollection) object of real-time trades generated by the strategy |
| [ShortTrades](/developer/desktop-sdk/references/strategy/systemperformance/shorttrades)        | Gets a [TradeCollection](/developer/desktop-sdk/references/strategy/tradecollection) object of short trades generated by the strategy     |

## Examples

```csharp
protected override void OnBarUpdate()
{
     // Print out the number of long trades
     Print("The strategy has taken " + SystemPerformance.LongTrades.Count + " long trades.");
}
```