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

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

# Position.ModifyTakeProfitPips

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

## ModifyTakeProfitPips(double? takeProfitPips)

Shortcut for the Robot.ModifyPosition method to change the Take Profit pips

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TradeResult ModifyTakeProfitPips(double? takeProfitPips)
```

Python:

```python
position.ModifyTakeProfitPips(takeProfitPips: float | None) -> TradeResult
```

### Parameters

- `takeProfitPips` (`double?`, Python `float | None`): New Take Profit in Pips

### Returns

`TradeResult` — 

### Examples

C#:

```csharp
var position = Positions.Find("myLabel");
if (position != null)
{
    var result = position.ModifyTakeProfitPips(30);
    Print("Take profit modified: {0}", result.IsSuccessful);
}
```

Python:

```python
position = api.Positions.Find("myLabel")
if position is not None:
    result = position.ModifyTakeProfitPips(30)
    api.Print(f"Take profit modified: {result.IsSuccessful}")
```

