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

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

# Position.Reverse

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

## Reverse()

Shortcut for the Robot.ReversePosition method to change the direction of the trade.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult Reverse()
```

Python:

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

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
var position = Positions.Find("myLabel");
if (position != null)
{
    var result = position.Reverse();
    if (result.IsSuccessful)
        Print("Position reversed to {0}", result.Position.TradeType);
}
```

Python:

```python
position = api.Positions.Find("myLabel")
if position is not None:
    result = position.Reverse()
    if result.IsSuccessful:
        api.Print(f"Position reversed to {result.Position.TradeType}")
```

## Reverse(double volume)

Shortcut for the Robot.ReversePosition method to change the direction of trade and the volume.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult Reverse(double volume)
```

Python:

```python
position.Reverse(volume: float) -> TradeResult
```

### Parameters

- `volume` (`double`, Python `float`): New Volume in Units

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
var position = Positions.Find("myLabel");
if (position != null)
{
    var result = position.Reverse(20000);
    if (result.IsSuccessful)
        Print("Position reversed to {0} {1}", result.Position.TradeType, result.Position.VolumeInUnits);
}
```

Python:

```python
position = api.Positions.Find("myLabel")
if position is not None:
    result = position.Reverse(20000)
    if result.IsSuccessful:
        api.Print(f"Position reversed to {result.Position.TradeType} {result.Position.VolumeInUnits}")
```

