ar1_half_life
Half-life of mean reversion in bars from a least-squares AR(1) fit with intercept to the raw closes: -ln 2 …
ar1_half_life
examples/site_showcase.rs// Half-life of mean reversion in bars from a least-squares AR(1) fit with intercept to the raw closes: -ln 2 / ln(phi); extra phi is the coefficient; nothing is published when phi is at most 0 or within 1e-9 of 1
// Defaults of "ar1_half_life" (see the indicator reference)
let params = HashMap::from([
("period".to_string(), 100.0),
]);
let mut indicator = build_checked("ar1_half_life", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}