Simple Indicator repainting (how to get it to alert at next bar closed)

 

Hey Guys,


Could someone help me out with this indicator.  I have tried to get to alert at NEXT BAR CLOSED but failed......

Thanks in advance


Alan

Files:
1TTCu5TTT.mq4  5 kb
 
int limit = rates_total - prev_calculated;
for(int i = limit-1; i >= 0; i--){ ... }
return(rates_total);

After you process bar zero the first, you will never process it again, including when it becomes bar one.

Return rates_total-1. See How to do your lookbacks correctly.

 
whroeder1:

After you process bar zero the first, you will never process it again, including when it becomes bar one.

Return rates_total-1. See How to do your lookbacks correctly.


Thank you very much
Reason: