I'm in the process of porting a technical study from WealthLab 3.0 to Ninjatrader. This study will often reference a previous bar's index. Bar indexing in WL starts from 0 for the earliest bar in the bar array. As a new bar is formed, an incremented index is assigned to this bar. Within this scheme, bars that meet certain conditions can be 'landmrked' by their index which will not change.
In Ninjatrader, a bar's index does not remain constant. This obviously makes the port of the above study difficult. The most obvious solution would be to perform the entire analysis each time a new bar arrives. Unfortunately this is far from being efficient.
So the question is, is there a way around this? Is there a way to keep track of a bar's unique index that is constant?
Along the same lines, the function DrawLine uses 'x bars ago from the current bar' as the input for the x axis coordinate. Do the coordinates of the line change as new bars arrive?
Thanks in advance.
Comment