How do I setup a percent stop loss in Editor which can be optimized (using Backtest type: Optimization)? I tried so many ways, but can't get it to work. I saw an old post from a NT staff member saying to use double instead of int, and he claimed it can be optimized that way. But that's not true, is it? It's my understanding is that Optimization takes whole numbers only.
To me, the most obvious way would be to use the following code.
Stop = 100;
SetStopLoss("", CalculationMode.Percent, Stop / 10000, false);
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(ResourceType = typeof(Custom.Resource), Name = "Stop", Order = 1, GroupName = "NinjaScriptStrategyParameters")]
public int Stop
{ get; set; }
Thanks.
Comment