Skip to content

AbsoluteTakeProfitProtections.ThirdTakeProfit

property · AbsoluteTakeProfitProtections · cAlgo.API Since 5.8

DesktopCLICloud

Gets the third partial take profit, if any.

Definition

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

Returns AbsoluteTakeProfitProtection

Examples

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