How to set TrailingStop On and Off as Parameter?
Created at 16 Feb 2021, 10:07
IN
How to set TrailingStop On and Off as Parameter?
16 Feb 2021, 10:07
Dear cTrader and all Experts,
How can I implement Trailing Stop as a Parameter in PlaceStopOrder, where I can choose whether to activate it or not.
I have tried:
PlaceStopOrder(TradeType.Buy, Symbol, Vol, Symbol.Bid + 10 * Symbol.PipSize, "Label", StopLoss, TakeProfit, null, "Comment01", true);
and I know TrailingStop is engaged every time.
And I have set:
[Parameter("TrailingStop", DefaultValue = true)]
public bool TrailingStop { get; set; }
But just did not work.
Thanks anyone who can help.
PanagiotisCharalampous
16 Feb 2021, 10:16
Hi intelligence21119,
You don't seem to be using the parameter in the method call. See below
You should be using this instead
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous