AddDataSeries(BarsPeriodType.Day, 1);
Then, when (State == State.DataLoaded), I print out the following values for BarsArray[0] and BarsArray[1]:
Instrument.FullName, Instrument.MasterInstrument.Name, Instrument.MasterInstrument.TradingHours.Name, and TradingHours.Name.
The four values are identical for both BarsArray members, and I assume this is because the call to AddDataSeries uses the BarsArray[0] information as a starting point when creating [1].
Here's the problem: When I display the data box and hover over the next-to-last bar on the daily chart for the same instrument, the value displayed in the data box for ATR(Daily,14) is 93.23; but when I extract
double atr = ATR(BarsArray[1], 14)[1];
on my minute chart and print the result to the output window, I get 74.5 (I do a little massaging to get the value of the next-highest tick to display) - so nearly a 20 point difference.
FWIW, when I do the same exercise with the one minute chart and data box, the numbers are acceptably close (though I kind of expect them to be identical; still, I'm not gonna quibble over a few thousandths of a cent).
Any suggestions would be appreciated, thanks. As an alternative to making the numbers agree, if anybody knows which one is correct, please point that out and explain. I assume the value on the daily chart as calculated by NT is the answer, but I want to derive that programmatically for myself. I suppose I could dive into the NT indicator code...


Comment