---
id: "P:cAlgo.API.HistoricalTrade.NetProfit"
kind: "property"
type: "T:cAlgo.API.HistoricalTrade"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/History/HistoricalTrade/NetProfit/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# HistoricalTrade.NetProfit

Member of [HistoricalTrade](https://help.ctrader.com/ctrader-algo/references/Trading/History/HistoricalTrade/index.md).

## NetProfit

Profit and loss including swaps and commissions

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double NetProfit {get;}
```

Python:

```python
historicalTrade.NetProfit: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
var winners = History.Count(trade => trade.NetProfit > 0);
Print("Winning trades: {0} of {1}", winners, History.Count);
```

Python:

```python
winners = len([trade for trade in api.History if trade.NetProfit > 0])
api.Print(f"Winning trades: {winners} of {api.History.Count}")
```

