My objective is to initiate a signal when close is less than an EMA for a certain number of bars.
I have never used FOR/WHILE loops before and need help resetting my counter when a trade is initiated. So far, I can only get it to reach the counter once, enter a trade then every time it closes a trade it will immediately re-open a trade as the counter has not reset.