indicator · own pane · open source
Hurst Exponent indicator
Hurst Exponent is a free open-source indicator. Hurst Exponent — simplified log-ratio approximation of the rescaled-range statistic. Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Hurst Exponent does
Hurst Exponent — simplified log-ratio approximation of the rescaled-range statistic. Above 0.5 the series is trending (persistent), below 0.5 it's mean-reverting (anti-persistent), exactly 0.5 is a random walk.
- Pair with an EMA crossover: only trade trend signals when Hurst > 0.5.
- Mean-reversion setups only when Hurst < 0.5.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Hurst Exponent", overlay=false)
len = input.int(20, "Length", minval=4, maxval=100)
colorMid2 = input.color("color.teal", "Color Mid2")
colorNeutral = input.color("color.gray", "Color Neutral")
hurst = math.log10(math.abs(close - close[len])) / (math.log10(2) * math.log10(len))
hline(0.5, "Random walk", color=colorNeutral)
p_Hurst = plot(hurst, "Hurst", color=colorMid2, linewidth=2)
alertcondition(hurst > 0.5 and not (hurst[1] > 0.5), "Trending regime", "Hurst crossed above 0.5 — trend regime")
alertcondition(hurst < 0.5 and not (hurst[1] < 0.5), "Mean-reverting regime", "Hurst crossed below 0.5 — mean-reverting regime")
No comments yet.
Sign in to comment.