---
id: "M:cAlgo.API.RelativeTakeProfitLastProtection.#ctor(System.Double)"
kind: "constructor"
type: "T:cAlgo.API.RelativeTakeProfitLastProtection"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitLastProtection/Constructor/"
---

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

# RelativeTakeProfitLastProtection constructor

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

## RelativeTakeProfitLastProtection(double Distance)

Represents the final take profit in a relative take profit ladder, closing the remaining order volume at a distance (in pips) from the entry price.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public RelativeTakeProfitLastProtection(double Distance)
```

Python:

```python
RelativeTakeProfitLastProtection(Distance: float)
```

### Parameters

- `Distance` (`double`, Python `float`): The take profit distance, in pips, from the order's entry price.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var takeProfits = new RelativeTakeProfitProtections(new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Sell, SymbolName, 10000, "myLabel", new RelativeStopLossProtection(20), takeProfits);
if (result.IsSuccessful)
    Print("Take profit price: {0}", result.Position.TakeProfit);
```

Python:

```python
takeProfits = RelativeTakeProfitProtections(RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Sell, api.SymbolName, 10000, "myLabel", RelativeStopLossProtection(20), takeProfits)
if result.IsSuccessful:
    api.Print(f"Take profit price: {result.Position.TakeProfit}")
```

## RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original)



Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original)
```

Python:

```python
RelativeTakeProfitLastProtection(original: RelativeTakeProfitLastProtection)
```

### Parameters

- `original` (`RelativeTakeProfitLastProtection`, Python `RelativeTakeProfitLastProtection`):

Available since cAlgo.API 5.8.

