PendingOrder.HasTrailingStop
property · PendingOrder · cAlgo.API
DesktopCLICloud
When HasTrailingStop set to true, server updates Stop Loss every time position moves in your favor.
Definition
bool HasTrailingStop {get;}
pendingOrder.HasTrailingStop: bool
Returns bool
Examples
var result = PlaceLimitOrder(TradeType.Buy, SymbolName, 10000, Symbol.Bid - 20 * Symbol.PipSize, "myLabel", 20, 40, ProtectionType.Relative, null, "Trailing", true);
if (result.IsSuccessful)
Print("Order has trailing stop: {0}", result.PendingOrder.HasTrailingStop);
result = api.PlaceLimitOrder(TradeType.Buy, api.SymbolName, 10000, api.Symbol.Bid - 20 * api.Symbol.PipSize, "myLabel", 20, 40, ProtectionType.Relative, None, "Trailing", True)
if result.IsSuccessful:
api.Print(f"Order has trailing stop: {result.PendingOrder.HasTrailingStop}")