Help with this counter, dont work properly
-
https://fxdreema.com/shared/ouNxjI1M
I shared the EA, its really simple, i did to make proofs with the counter function
the idea is:
- cross of emas
- when the distancie between emas will be greater than 5 pips, open sell
i put a reset for the counter every "n" bars, the number of bars I put 500 to be sure that reset work ok, but as you can see in the screenshot below, the counter dont reset, because the EA make consecutive operations

I have done this proof too, but don´t make operactions
https://fxdreema.com/shared/tpF3Bw8Hc
Or the counter dont work properly, or i do something wrong
Some help pleased
-
Here is my simple test for the counter blocks: https://fxdreema.com/shared/gD1k3Y8db
If there is no Pass once, there will be one arrow for each candle. If blocks 4 and 5 are not there, there will be only one arrow in the beginning. But since I reset the counter every 5 bars, I got this expected result:

Your problem is logical. You have a Condition for cross between two MAs, but at that time the distance between them is probably very small.