Count New Bars since start of EA

 

Hi I am trying to count the bars for the time of starting my own ea?

So at start Bars = 0

then every new bar causes the number to increase by 1.

At a specific number of bars, it should beginn with 0 again.

so the max number of bars is 10, counting would be:

1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

 
   datetime barTime=iTime(_Symbol,_Period,0);
Den Rest bringst du schon zustande.