autocorrelation
Rolling sample autocorrelation of one-bar log returns at a lag, as in Box and Jenkins: the denominator runs…
autocorrelation
examples/site_showcase.rs// Rolling sample autocorrelation of one-bar log returns at a lag, as in Box and Jenkins: the denominator runs over all returns of the window with no small-sample adjustment; -1..1
// Defaults of "autocorrelation" (see the indicator reference)
let params = HashMap::from([
("lag".to_string(), 1.0),
("period".to_string(), 50.0),
]);
let mut indicator = build_checked("autocorrelation", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}