---
id: "T:cAlgo.API.RelativeTakeProfitLastProtection"
kind: "record"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitLastProtection/"
---

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

# RelativeTakeProfitLastProtection (record)

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.

## Definition

```csharp
public class RelativeTakeProfitLastProtection
```

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}")
```

## Constructors

- `public 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. [details](https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitLastProtection/Constructor/index.md)
- `public RelativeTakeProfitLastProtection(RelativeTakeProfitLastProtection original)` —  [details](https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitLastProtection/Constructor/index.md)

## Properties

- `public double Distance {get; set;}` — The take profit distance, in pips, from the order's entry price. [details](https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitLastProtection/Distance/index.md)

