my first custom indicator
Don't use the CURRENT time, use the time of the BAR you are drawing.
int tHour=TimeHour(TimeCurrent()); | int tHour=TimeHour(Time[i]); |
I am trying to develop my first custom indicator. I only want the indicator to show on the charts during the overnight session. Therefore I added a simple IF clause to check for the hour of the day. The problem is that the indicator shows up for each hour of the day. I made a small change shown below from the standard indicator Bands.mq4. Any help would be greatly appreciated.
original code
new code