Skip to content

RelativeTakeProfitProtections.LastTakeProfit

property · RelativeTakeProfitProtections · cAlgo.API Since 5.8

DesktopCLICloud

Gets the final take profit that closes the remaining volume.

Definition

public RelativeTakeProfitLastProtection LastTakeProfit {get;}
relativeTakeProfitProtections.LastTakeProfit: RelativeTakeProfitLastProtection

Returns RelativeTakeProfitLastProtection

Examples

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);
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")