Time line

 
I find there is a big problem with the time in MT.

For example, if I wish to update my indicator exactly every 5 minutes on a 1 minutes chart, it seems simple, but I found it is actually quite difficult to realise.

The problem lies which time reference to use: LocalTime( ), CurTime( ), or Time[0].

The indicator updates/runs every time there is a new incoming price data, however, the inter-arrival time of the new price data follows a random exponential distribution, ie, you never know exactly when it will arrive.

So, if there is no incoming data for 10 minutes, then your indicator will sit there for 10 minutes, doing nothing.

I can understand the benifit for doing that, it saves a lot computation power. If there is nothing changed, then don't bother to re-calculate the indicator.

However, when it comes to the problem I mentioned before, then it seems there is no easy solution.
 
Yes indeed, it is not an easy task, I also faced it once.
I needed Bid every sec for one minute.
I made an array[59][1], and checked on every run(tick): if there were no price for the last second, the previous price was copied there.

I don't know your indicator, but I hope I could give an idea.
Reason: