AbsoluteTakeProfitProtections.FirstTakeProfit
property · AbsoluteTakeProfitProtections · cAlgo.API Since 5.8
DesktopCLICloud
Gets the first partial take profit, if any.
Definition
public AbsoluteTakeProfitProtection FirstTakeProfit {get;}
absoluteTakeProfitProtections.FirstTakeProfit: AbsoluteTakeProfitProtection
Returns AbsoluteTakeProfitProtection
Examples
var position = Positions.Find("myLabel");
var firstTakeProfit = position?.AbsoluteTakeProfitProtections?.FirstTakeProfit;
if (firstTakeProfit != null)
Print("First take profit: {0} units at {1}", firstTakeProfit.Volume, firstTakeProfit.Price);
position = api.Positions.Find("myLabel")
if position is not None and position.AbsoluteTakeProfitProtections is not None and position.AbsoluteTakeProfitProtections.FirstTakeProfit is not None:
firstTakeProfit = position.AbsoluteTakeProfitProtections.FirstTakeProfit
api.Print(f"First take profit: {firstTakeProfit.Volume} units at {firstTakeProfit.Price}")