indicator · own pane · open source
Higher High Lower Low Counter
Running…
Loading chart…
About
HH/LL Counter counts how many bars have passed since the last confirmed higher high (positive) and lower low (negative). Trend continuation while both counters are climbing.
- A higher-high streak + a deeper LL streak usually resolves with a strong breakout.
- Symmetric positive/negative reads = trend exhaustion.
Source code
//@version=5
indicator("Higher High Lower Low Counter", overlay=false)
len = input.int(5, "Swing Strength", minval=2)
hh = ta.pivothigh(high, len, len)
ll = ta.pivotlow(low, len, len)
cumH = ta.barssince(not na(hh))
cumL = ta.barssince(not na(ll))
hline(0, "Zero", color=color.gray, linestyle=hline.style_dashed)
p_Bars_Since_HH = plot(cumH, "Bars Since HH", color=color.green, style=plot.style_columns, linewidth=2)
p_Bars_Since_LL = plot(-cumL, "Bars Since LL", color=color.red, style=plot.style_columns, linewidth=2)
alertcondition(not na(hh), "New swing high", "Higher-high confirmed")
alertcondition(not na(ll), "New swing low", "Lower-low confirmed")
No comments yet.
Sign in to comment.