Parameter sequencing

View as Markdown

Parameter sequencing

Indicator and strategy parameters (user defined inputs) will always be displayed in an order that the user specifies in the NinjaScript file.

In the NinjaScript Editor, expand the “Properties” region of your code where all of your parameters are defined. In this example, this will be our Properties section:

1[Range(1, int.MaxValue), NinjaScriptProperty]
2[Display(ResourceType = typeof(Custom.Resource), Name = "Fast", GroupName = "NinjaScriptStrategyParameters", Order = 0)]
3public int Fast
4{ get; set; }
1[Range(1, int.MaxValue), NinjaScriptProperty]
2[Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptStrategyParameters", Order = 1)]
3public int Slow
4{ get; set;}

In this case, the Fast parameter will show up as the first parameter with the Slow parameter showing as the second.

To switch the order around, we could modify Order. If we change Slow’s Order to 0 and Fast’s Order to 1 as shown below …

1[Range(1, int.MaxValue), NinjaScriptProperty]
2[Display(ResourceType = typeof(Custom.Resource), Name = "Fast", GroupName = "NinjaScriptStrategyParameters", Order = 1)]
3public int Fast
4{ get; set; }
5
6[Range(1, int.MaxValue), NinjaScriptProperty]
7[Display(ResourceType = typeof(Custom.Resource), Name = "Slow", GroupName = "NinjaScriptStrategyParameters", Order = 0)]
8public int Slow
9{ get; set; }

… the Slow property will show first and the Fast property second.