---
id: "M:cAlgo.API.Position.Close"
kind: "method"
type: "T:cAlgo.API.Position"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Positions/Position/Close/"
---

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

# Position.Close

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

## Close()

Shortcut for the Robot.ClosePosition method.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult Close()
```

Python:

```python
position.Close() -> TradeResult
```

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
foreach (var position in Positions.FindAll("myLabel"))
{
    var result = position.Close();
    Print("Position {0} closed: {1}", position.Id, result.IsSuccessful);
}
```

Python:

```python
for position in api.Positions.FindAll("myLabel"):
    result = position.Close()
    api.Print(f"Position {position.Id} closed: {result.IsSuccessful}")
```

