I am trying editing CurrentDayOHL indicator. I want to reset values when RTH opens on ETH session template with historical data.
RTH opens at 15:30 in my time zone.
This is edited condition for reseting values:
if ((ToTime(15, 30, 0) > ToTime(Time[1]) && (ToTime(15, 30, 0) <= ToTime(Time[0]))) || currentOpen == double.MinValue)
I want to compare 1 bar ago if bar is before 15:30 and current bar if time is 15:30 or more. It doesn't work. I want to use this method because I am using Range Bars. I tried printing value ToTime(Time[1]) and I got this message "Error on calling 'OnBarUpdate' method for indicator 'MyCurrentDayOHL' on bar 0: Bar index needs to be greater/equal 0". ToTime(Time[0]) works.
What am I doing wrong?
Thanks for responding.
Comment