How to have a counter per bar that goes back to zero when there is a cross
-
the goal is to have a counter of the number of bars that starts at each time a cross happens in an indicator... for more info the counter is in the yellow in the pic below

-
This is one way to do it:
https://fxdreema.com/shared/IMzeO1Jab
I used to MA as an example of crossing.