kestrel-chartkitv0.33.0

← All examples

zigzag

ZigZag Swing Leg Engine

zigzag

examples/site_showcase.rs
// ZigZag Swing Leg Engine
// Defaults of "zigzag" (see the indicator reference)
let params = HashMap::from([
    ("depth".to_string(), 12.0),
    ("deviation_pct".to_string(), 5.0),
]);
let mut indicator = build_checked("zigzag", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
ZigZag Swing Leg 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.ZigZag Swing Leg 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.
  • Market structure and patterns
  • unit: Price