kestrel-chartkitv0.49.0

← All examples

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", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 27 alerts in view, the latest as markers.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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 27 alerts in view, the latest as markers.
  • Moving averages, bands and trend lines
  • unit: Price