RealTest User Guide
RealTest User Guide

 

 

 

 

 

Category

Multi-Bar Functions

Description

Hurst exponent (trending vs mean-reverting)

Syntax

Hurst(expr, count, maxlag {20})

Parameters

expr - data series formula

count - lookback period (minimum 8)

maxlag - largest lag used in the estimate -- optional, default 20 (clamped to count / 2)

Notes

Estimates the Hurst exponent of the series over the lookback window using the variance-of-lagged-differences method: the standard deviation of the lag-t differences is computed for each lag from 2 to maxlag, and H is the slope of the least-squares regression of log(std dev) on log(lag).

A value near 0.5 indicates a random walk (no memory). Values above 0.5 indicate persistence (a series that trends), and values below 0.5 indicate anti-persistence (a series that mean-reverts).

The typical use is as a regime filter: favor trend-following entries while H > 0.5 and mean-reversion entries while H < 0.5.

Use generous lookbacks -- 100 bars or more. The estimate is statistically noisy in short windows, and since the output is the raw regression slope (not clamped to the 0-1 range), short-window readings can even be negative. Read it as a slowly-changing regime indication rather than a bar-to-bar signal.

Example

Trending: Hurst(Close, 252) > 0.5

True when the symbol has been in a persistent (trending) regime over the past year of daily bars.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC