---
id: "P:cAlgo.API.Position.Id"
kind: "property"
type: "T:cAlgo.API.Position"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Positions/Position/Id/"
---

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

# Position.Id

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

## Id

The position's unique identifier.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
int Id {get;}
```

Python:

```python
position.Id: int
```

### Returns

`int` — 

### Examples

C#:

```csharp
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, "myLabel");
if (result.IsSuccessful)
    Print("Opened position Id: {0}", result.Position.Id);
```

Python:

```python
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 10000, "myLabel")
if result.IsSuccessful:
    api.Print(f"Opened position Id: {result.Position.Id}")
```

