Position.StopLossBreakEven
property · Position · cAlgo.API Since 5.8
DesktopCLICloud
The stop loss break even of the position.
Definition
StopLossBreakEven StopLossBreakEven {get;}
position.StopLossBreakEven: StopLossBreakEven
Returns StopLossBreakEven
Examples
var takeProfits = new RelativeTakeProfitProtections(new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, "myLabel", new RelativeStopLossProtection(20), takeProfits, new StopLossBreakEven(15, 2));
if (result.IsSuccessful && result.Position.StopLossBreakEven != null)
Print("Break-even trigger distance: {0} pips", result.Position.StopLossBreakEven.TriggerDistance);
takeProfits = RelativeTakeProfitProtections(RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 10000, "myLabel", RelativeStopLossProtection(20), takeProfits, StopLossBreakEven(15, 2))
if result.IsSuccessful and result.Position.StopLossBreakEven is not None:
api.Print(f"Break-even trigger distance: {result.Position.StopLossBreakEven.TriggerDistance} pips")