Here is a snippet of code from NinjaTrader_Ray...
protected override void OnBarUpdate()
{
if(CurrentBar < 6)
return;
diff.Set(Median[0] - Median[6]);
double mid = diff[3];
double wtd = 0.75 * (diff[0] - diff[6]) + 0.25 * (diff[2] - diff[4]);
diff is a DataSeries, and on the seven bar, he loads (sets) a value into diff[0].... but a few lines later he accesses diff[6], diff[4], diff[2] and does some math with their values.
What do diff[2], diff[4] and diff[6] contain on the first pass through this code, on the close of the 7th bar?
I have been pre-loading something in mine to make sure something is there.... maybe I don't have to?
Comment