---
id: "P:cAlgo.API.RelativeTakeProfitProtections.LastTakeProfit"
kind: "property"
type: "T:cAlgo.API.RelativeTakeProfitProtections"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/RelativeTakeProfitProtections/LastTakeProfit/"
---

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

# RelativeTakeProfitProtections.LastTakeProfit

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

## LastTakeProfit

Gets the final take profit that closes the remaining volume.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public RelativeTakeProfitLastProtection LastTakeProfit {get;}
```

Python:

```python
relativeTakeProfitProtections.LastTakeProfit: RelativeTakeProfitLastProtection
```

### Returns

`RelativeTakeProfitLastProtection` — 

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var order = PendingOrders.FirstOrDefault(pendingOrder => pendingOrder.RelativeTakeProfitProtections != null);
if (order != null)
    Print("Order {0} closes the rest at {1} pips", order.Id, order.RelativeTakeProfitProtections.LastTakeProfit.Distance);
```

Python:

```python
orders = [pendingOrder for pendingOrder in api.PendingOrders if pendingOrder.RelativeTakeProfitProtections is not None]
if len(orders) > 0:
    api.Print(f"Order {orders[0].Id} closes the rest at {orders[0].RelativeTakeProfitProtections.LastTakeProfit.Distance} pips")
```

