Learn NinjaScript: Calculating Consecutive Bars Up/Down
“Three consecutive higher closes.” “Five bars without a lower low.” Pattern rules like these depend on a run counter — a small int that tracks how many bars in a row share a direction. The logic looks trivial but the corner cases are real: what counts as up, what to do with doji bars, how…









