---
id: "T:cAlgo.API.Deal"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/"
---

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

# Deal (interface)

Represents a deal.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public interface Deal
```

Available since cAlgo.API 5.1.

## Examples

C#:

```csharp
foreach (var position in Positions)
{
    foreach (var deal in position.Deals)
        Print("Position {0} deal {1}: {2} {3} {4} units at {5}, {6}", position.Id, deal.Id, deal.PositionImpact, deal.TradeType, deal.VolumeInUnits, deal.ExecutionPrice, deal.ExecutionTime);
}
```

Python:

```python
for position in api.Positions:
    for deal in position.Deals:
        api.Print(f"Position {position.Id} deal {deal.Id}: {deal.PositionImpact} {deal.TradeType} {deal.VolumeInUnits} units at {deal.ExecutionPrice}, {deal.ExecutionTime}")
```

C#:

```csharp
foreach (var trade in History)
{
    var deal = trade.ClosingDeal;
    Print("Trade closing deal {0}: {1} units at {2}, status {3}", deal.Id, deal.VolumeInUnits, deal.ExecutionPrice, deal.Status);
}
```

Python:

```python
for trade in api.History:
    deal = trade.ClosingDeal
    api.Print(f"Trade closing deal {deal.Id}: {deal.VolumeInUnits} units at {deal.ExecutionPrice}, status {deal.Status}")
```

## Properties

- `string Channel {get;}` — Gets the channel. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Channel/index.md)
- `IReadonlyList<Deal> ClosedBy {get;}` — If deal was an opening deal then this property will return the deals that closed current deal. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/ClosedBy/index.md)
- `IReadonlyList<Deal> Closing {get;}` — If deal was a closing deal then this property will return the deals that were closed by current deal. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Closing/index.md)
- `string Comment {get;}` — Gets the comment. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Comment/index.md)
- `double? ExecutionPrice {get;}` — Returns deal execution price if deal is filled otherwise null. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/ExecutionPrice/index.md)
- `DateTime ExecutionTime {get;}` — Returns deal execution time. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/ExecutionTime/index.md)
- `long Id {get;}` — Unique deal Id. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Id/index.md)
- `string Label {get;}` — Gets the label. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Label/index.md)
- `int OrderId {get;}` — Order Id. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/OrderId/index.md)
- `int PositionId {get;}` — Position Id. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/PositionId/index.md)
- `DealPositionImpact? PositionImpact {get;}` — Returns deal position impact if deal is filled otherwise null. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/PositionImpact/index.md)
- `DealStatus Status {get;}` — Returns status of deal. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/Status/index.md)
- `string SymbolName {get;}` — Gets the symbol name. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/SymbolName/index.md)
- `TradeType TradeType {get;}` — Gets the TradeType. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/TradeType/index.md)
- `double VolumeInUnits {get;}` — Deal filled volume amount in units. [details](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/VolumeInUnits/index.md)

