zlema
Zero-lag EMA: the EMA of the close plus its change over the last
zlema
examples/site_showcase.rs// Zero-lag EMA: the EMA of the close plus its change over the last (period - 1) / 2 bars, seeded with its first input; with a period of 1 or 2 it is the plain EMA. Published from bar floor((period - 1) / 2) + 1.
// Defaults of "zlema" (see the indicator reference)
let params = HashMap::from([
("period".to_string(), 20.0),
]);
let mut indicator = build_checked("zlema", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}