My Indicator needs to refresh chart to be visible

 
Dear Freiends
I wrote an Indicator which should run in 5 minutes timeframe but use daily ATR , so when I run it in daily time frame and bigger its ok, but in lower time frame should I refresh The chart, Can you please check it, I attached it. 
Files:
ACD.mq5  7 kb
 
    today=TimeToString(time[i],TIME_DATE);

In MT5, you must set the direction.

To define the indexing direction in the time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[] arrays, call the ArrayGetAsSeries() function. In order not to depend on defaults, call the ArraySetAsSeries() function for the arrays to work with.
          Event Handling / OnCalculate - Reference on algorithmic/automated trading language for MetaTrader 5
 
So what Should I do,
After refreshing the chart indicator do well,  is it related to time series !!