When I access any of the Properties in the Initialize() section of NT7 they carry the user selected values.
However, when I access any of the Properties while State == State.SetDefaults the user selectable parameters still carry the hardcoded default values. I need to go to State == State.Configure to access the user selected parameters.
This has an impact on where some of the other settings should be implemented.
Example: BarsRequiredToPlot
Typically you do not wish to plot any false values on your chart. Therefore for a simple moving average the logical solution would be
BarsRequiredToPlot = Period
BarsRequiredToPlot = 3*Period
The problem here is that the current value of "Period" cannot be accessed while the inidcator is in State.SetDefaults. Period always returns the default value and not the user selected period. Therefore BarsRequiredToPlot should always be set in State.Configure.
This is a bit confusing, as NinjaTrader 7 allowed for accessing properites in both Initialize() and OnStartUp(). Accordingly it was possible to set BarsRequired in both Initialize() and OnStartUp().
Are there any other limitations I should be aware of?
Shouldn't the help file specify that BarsRequiredToPlot be set in State.Configure?
Comment