Learn NinjaScript: Counting Candles Since a Condition Was Met
“How many bars since the last cross?” “How many bars has price been above the SMA?” Bars since a condition was met is one of the most-reused small patterns in NinjaScript — a single int field that increments every bar and resets to zero whenever the trigger fires. This post covers the pattern, the corner…









