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

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

# HistoricalTrade.GrossProfit

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

## GrossProfit

Profit and loss before swaps and commission

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double GrossProfit {get;}
```

Python:

```python
historicalTrade.GrossProfit: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
var grossProfit = History.Sum(trade => trade.GrossProfit);
Print("Total gross profit: {0}", grossProfit);
```

Python:

```python
grossProfit = sum(trade.GrossProfit for trade in api.History)
api.Print(f"Total gross profit: {grossProfit}")
```

