Download MetaTrader 5
To add comments, please log in or register
You can test an application before buying it. Find out how to do that!
Elo
82
Elo 2013.12.05 16:17 
Hi Guys,

I have faced with an issue - MTF MACD indicator (for H1 period) on M5 period chart do not refresh its values automatically when new bar has closed. It draw different values for every lower TF bar. The value of the high level bar has to be one and the same for all lower TF bars and has to be recalculated every time intil the High level bar has closed. I have marked in red rectangle the values which are after I pressed Refresh on the chart. Before that point the values were correct.

How this can be fixed within the indicator's code ?

Files:
whroeder1
13610
whroeder1 2013.12.05 17:00  
  1.   if (Time[i]<TimeArray[y]) y++;
    This fails when there are missing bars in TimeFrame chart. Use while not if. This is why I recommend not using the ArrayCopySeries but iBarShift.
          y = iBarShift(NULL, timeframe, Time[i]);
    

  2. You want to repaint all TimeFrame bar zero values
    // for(i=0,y=0;i<limit;i++)
       for(i=0,y=0;i<limit || y == 0;i++)
Elo
82
Elo 2013.12.05 22:49  
Thank you WHRoeder, now it is working fine.
/
To add comments, please log in or register