kestrel-chartkitv0.33.0

← All examples

zscore

Rolling Z-Score Engine

zscore

examples/site_showcase.rs
// Rolling Z-Score Engine
// Defaults of "zscore" (see the indicator reference)
let params = HashMap::from([
    ("period".to_string(), 20.0),
]);
let mut indicator = build_checked("zscore", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Rolling Z-Score Engine. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.Rolling Z-Score Engine. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.
  • Oscillators
  • unit: Ratio