Skip to content

AbsoluteTakeProfitProtections.LastTakeProfit

property · AbsoluteTakeProfitProtections · cAlgo.API Since 5.8

DesktopCLICloud

Gets the final take profit that closes the remaining volume.

Definition

public AbsoluteTakeProfitLastProtection LastTakeProfit {get;}
absoluteTakeProfitProtections.LastTakeProfit: AbsoluteTakeProfitLastProtection

Returns AbsoluteTakeProfitLastProtection

Examples

foreach (var position in Positions)
{
    if (position.AbsoluteTakeProfitProtections != null)
        Print("Position {0} closes the rest at {1}", position.Id, position.AbsoluteTakeProfitProtections.LastTakeProfit.Price);
}
for position in api.Positions:
    if position.AbsoluteTakeProfitProtections is not None:
        api.Print(f"Position {position.Id} closes the rest at {position.AbsoluteTakeProfitProtections.LastTakeProfit.Price}")