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

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

# PendingOrder.ModifyStopLossPrice

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

## ModifyStopLossPrice(double? stopLoss)

Shortcut for Robot.ModifyPendingOrder method to change Stop Loss

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

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

Python:

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

### Parameters

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

### Returns

`TradeResult` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
foreach (var order in PendingOrders)
{
    var distance = 20 * order.Symbol.PipSize;
    var stopLossPrice = order.TradeType == TradeType.Buy ? order.TargetPrice - distance : order.TargetPrice + distance;
    var result = order.ModifyStopLossPrice(stopLossPrice);
    Print("Order {0} stop loss set at {1}: {2}", order.Id, stopLossPrice, result.IsSuccessful);
}
```

Python:

```python
for order in api.PendingOrders:
    distance = 20 * order.Symbol.PipSize
    stopLossPrice = order.TargetPrice - distance if order.TradeType == TradeType.Buy else order.TargetPrice + distance
    result = order.ModifyStopLossPrice(stopLossPrice)
    api.Print(f"Order {order.Id} stop loss set at {stopLossPrice}: {result.IsSuccessful}")
```

