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

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

# PendingOrder.ModifyTakeProfitPrice

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

## ModifyTakeProfitPrice(double? takeProfit)

Shortcut for Robot.ModifyPendingOrder method to change Take Profit

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult ModifyTakeProfitPrice(double? takeProfit)
```

Python:

```python
pendingOrder.ModifyTakeProfitPrice(takeProfit: float | None) -> TradeResult
```

### Parameters

- `takeProfit` (`double?`, Python `float | None`): New Take Profit value in Price

### Returns

`TradeResult` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
foreach (var order in PendingOrders)
{
    var distance = 40 * order.Symbol.PipSize;
    var takeProfitPrice = order.TradeType == TradeType.Buy ? order.TargetPrice + distance : order.TargetPrice - distance;
    var result = order.ModifyTakeProfitPrice(takeProfitPrice);
    Print("Order {0} take profit set at {1}: {2}", order.Id, takeProfitPrice, result.IsSuccessful);
}
```

Python:

```python
for order in api.PendingOrders:
    distance = 40 * order.Symbol.PipSize
    takeProfitPrice = order.TargetPrice + distance if order.TradeType == TradeType.Buy else order.TargetPrice - distance
    result = order.ModifyTakeProfitPrice(takeProfitPrice)
    api.Print(f"Order {order.Id} take profit set at {takeProfitPrice}: {result.IsSuccessful}")
```

