really need help

 

actually i created a indicator which plots histogramm in sub window according to the time taken from the candle open to close. i created this indi for offline charts but the indicator when ploted to offline chart i am getting erroras out of array in experts tab. but when ploted in 4hr chart it works and when ploting other standard time frame i am getting same error.

please someone help. i need this for offline chart only. the basic idea is the histogram will plot according to time taken by bar from open to close.

Files:
timer.mq4  2 kb