---
id: "P:cAlgo.API.Deal.TradeType"
kind: "property"
type: "T:cAlgo.API.Deal"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/TradeType/"
---

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

# Deal.TradeType

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

## TradeType

Gets the TradeType.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeType TradeType {get;}
```

Python:

```python
deal.TradeType: TradeType
```

### Returns

`TradeType` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var trade = History.FindLast("myLabel");
if (trade != null)
    Print("Position was {0}, closing deal was {1}", trade.TradeType, trade.ClosingDeal.TradeType);
```

Python:

```python
trade = api.History.FindLast("myLabel")
if trade is not None:
    api.Print(f"Position was {trade.TradeType}, closing deal was {trade.ClosingDeal.TradeType}")
```

