cusum
Two-sided CUSUM of standardized close-to-close returns
cusum
examples/site_showcase.rs// Two-sided CUSUM of standardized close-to-close returns
// Defaults of "cusum" (see the indicator reference)
let params = HashMap::from([
("h".to_string(), 4.0),
("k".to_string(), 0.5),
("len".to_string(), 20.0),
]);
let mut indicator = build_checked("cusum", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}