---
id: "M:cAlgo.API.Position.ModifyStopLossPrice(System.Nullable{System.Double})"
kind: "method"
type: "T:cAlgo.API.Position"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Positions/Position/ModifyStopLossPrice/"
---

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

# Position.ModifyStopLossPrice

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

## ModifyStopLossPrice(double? stopLoss)

Shortcut for Robot.ModifyPosition method to change the Stop Loss.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult ModifyStopLossPrice(double? stopLoss)
```

Python:

```python
position.ModifyStopLossPrice(stopLoss: float | None) -> TradeResult
```

### Parameters

- `stopLoss` (`double?`, Python `float | None`): New Stop Loss price

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
var position = Positions.Find("myLabel");
if (position != null)
{
    var distance = 20 * position.Symbol.PipSize;
    var stopLossPrice = position.TradeType == TradeType.Buy ? position.EntryPrice - distance : position.EntryPrice + distance;
    var result = position.ModifyStopLossPrice(stopLossPrice);
    Print("Stop loss modified: {0}", result.IsSuccessful);
}
```

Python:

```python
position = api.Positions.Find("myLabel")
if position is not None:
    distance = 20 * position.Symbol.PipSize
    stopLossPrice = position.EntryPrice - distance if position.TradeType == TradeType.Buy else position.EntryPrice + distance
    result = position.ModifyStopLossPrice(stopLossPrice)
    api.Print(f"Stop loss modified: {result.IsSuccessful}")
```

