hurst_rs
Hurst exponent by rescaled-range analysis
hurst_rs
examples/site_showcase.rs// Hurst exponent by rescaled-range analysis (Hurst 1951, Mandelbrot and Wallis 1969) of the one-bar log returns: about 0.5 for a random walk, above for persistent and below for anti-persistent returns; the plain R/S estimator has no small-sample correction and is biased upward on short chunks
// Defaults of "hurst_rs" (see the indicator reference)
let params = HashMap::from([
("min_chunk".to_string(), 8.0),
("period".to_string(), 128.0),
]);
let mut indicator = build_checked("hurst_rs", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}