Skip to content

AbsoluteTakeProfitProtections.FourthTakeProfit

property · AbsoluteTakeProfitProtections · cAlgo.API Since 5.8

DesktopCLICloud

Gets the fourth partial take profit, if any.

Definition

public AbsoluteTakeProfitProtection FourthTakeProfit {get;}
absoluteTakeProfitProtections.FourthTakeProfit: AbsoluteTakeProfitProtection

Returns AbsoluteTakeProfitProtection

Examples

var position = Positions.Find("myLabel");
var fourthTakeProfit = position?.AbsoluteTakeProfitProtections?.FourthTakeProfit;
if (fourthTakeProfit != null)
    Print("Fourth take profit: {0} units at {1}", fourthTakeProfit.Volume, fourthTakeProfit.Price);
position = api.Positions.Find("myLabel")
if position is not None and position.AbsoluteTakeProfitProtections is not None and position.AbsoluteTakeProfitProtections.FourthTakeProfit is not None:
    fourthTakeProfit = position.AbsoluteTakeProfitProtections.FourthTakeProfit
    api.Print(f"Fourth take profit: {fourthTakeProfit.Volume} units at {fourthTakeProfit.Price}")