A statistical estimate of whether a series has tended to trend, mean-revert, or wander randomly — with wide error bars.
The Hurst exponent (H) is a statistic from time-series analysis, originally developed by hydrologist Harold Edwin Hurst in the 1950s to study Nile river flows, and later adopted in quantitative finance. It attempts to classify the memory of a series on a 0-to-1 scale: H above 0.5 suggests persistence (moves tended to be followed by moves in the same direction — trending behavior), H below 0.5 suggests anti-persistence (moves tended to be followed by reversals — mean-reverting behavior), and H near 0.5 is consistent with a random walk, where past direction carried no information. That is the honest answer to what it tells you: it describes which of those behaviors the sampled history statistically resembled. What it does not do is certify a regime or predict one. The estimate is exactly that — an estimate, with substantial sampling error at realistic data lengths — and a market that measured persistent last quarter is under no obligation to stay persistent. Much trading content presents Hurst values with false precision, quoting H = 0.63 as if the second decimal were meaningful; on a few hundred bars it usually is not. This entry is educational only, not financial advice, and all trading carries risk of loss.
The classical estimator is rescaled range (R/S) analysis. Take the returns of the series over a window of n observations and compute their mean. Build the cumulative sum of deviations from that mean — a running total of how far the series drifted from its average behavior. The range R is the difference between the maximum and minimum of that cumulative series, and S is the standard deviation of the returns. The rescaled range R/S measures how far the cumulative deviations wandered relative to the series' own volatility. Hurst's insight was that for many processes, R/S grows like n^H: for a random walk H ≈ 0.5, for a persistent (trending) series the cumulative deviations wander further (H > 0.5), and for an anti-persistent series they keep pulling back (H < 0.5). A proper estimate computes R/S at multiple window sizes and fits the slope of log(R/S) against log(n); the slope is H. Chart implementations, including the example below, often use a single window, estimating H as log(R/S)/log(n) — a rougher, biased shortcut, and we label it as such. The deeper caveat applies to every variant: R/S estimates are noisy and finite-sample biased (short samples of a true random walk routinely measure H well above 0.5), and volatility clustering in real markets contaminates the reading further. Treat any single number as a fuzzy indication, not a measurement.
Chart implementations typically estimate H over a rolling window of 100 to 500 bars, with a reference line at 0.5; longer windows give statistically steadier but slower estimates. Serious estimation uses multiple sub-window sizes with a log-log regression slope, and researchers often prefer alternative estimators (detrended fluctuation analysis, variance-ratio tests) because plain R/S is biased upward on short samples. Whatever the tool, the window length is the dominant setting: it decides both what period you are describing and how wide the error bars are. There are no 'best' settings, only trade-offs between recency and statistical reliability.
//@version=6
indicator("Hurst Exponent (single-window R/S estimate)", overlay = false)
// Rough single-window estimate: H ~ log(R/S) / log(n).
// A proper estimate regresses log(R/S) on log(n) across many window
// sizes; this shortcut is biased and noisy — treat it as illustrative.
length = input.int(200, "Window Length", minval = 20)
ret = math.log(close / close[1])
meanRet = ta.sma(ret, length)
sd = ta.stdev(ret, length)
float cum = 0.0
float maxCum = 0.0
float minCum = 0.0
for i = 0 to length - 1
cum += ret[length - 1 - i] - meanRet
maxCum := math.max(maxCum, cum)
minCum := math.min(minCum, cum)
rs = sd != 0 ? (maxCum - minCum) / sd : na
h = not na(rs) and rs > 0 ? math.log(rs) / math.log(length) : na
plot(h, "Hurst estimate", color = color.purple)
hline(0.5, "Random-walk reference", color = color.gray)Pro tip: Before reading anything into a Hurst value, calibrate your skepticism: generate a pure random walk of the same length and run the estimator on it a few times — the spread of values you get on data with no memory at all is your effective error bar. If your market's reading falls inside that spread, the honest conclusion is 'indistinguishable from random', however tempting the 0.61 looks. Use H to frame which class of behavior recent history resembled, never as a signal. Educational content only, not financial advice; past statistical structure does not predict future prices, and all trading involves risk of loss.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.