I'm using a one minute chart as my primary chart and I've used Add(PeriodType.Day,1) and Add(PeriodType.Week,52) in Initialize() to obtain the daily and 52 week chart values. The Day chart is therefore BarsArray[1] and the Week chart is BarsArray[2] (unless I'm mistaken).
For the current session's values I've tried:
double dayhigh = CurrentDayOHL().CurrentHigh[0];
double daylow = CurrentDayOHL().CurrentLow[0];
and
double dayhigh = Highs[1][0];
double daylow = Highs[1][0];
and
double dayhigh = BarsArray[1].GetHigh(0);
double daylow = BarsArray[1].GetLow(0);
Each of these returns a value, but it is not consistent with the actual values of the market.
Similarly, I've tried the following for the 52 week high and low values:
double the52weekhigh = Highs[2][0];
double the52weeklow = Lows[2][0];
and
double the52weekhigh = BarsArray[2].GetHigh(0);
double the52weeklow = BarsArray[2].GetLow(0);
And, again, while results are presented, they are not consistent with reality.
Put simply, I just want to obtain these values (the current session's high and low and the 52 week high and low). How can I do that, please?
Thanks for your assistance.


Comment