kestrel-chartkitv0.33.0

← All examples

zigzag_advanced

ZigZag with backstep, running-leg/confirmation status, and ATR-mode deviation

zigzag_advanced

examples/site_showcase.rs
// ZigZag with backstep, running-leg/confirmation status, and ATR-mode deviation (deviation_mode=percent|atr_multiple, in build_checked as 0|1; deviation_pct is the deviation in percent or in ATR multiples, deviation_value its former typed name); AdvancedZigZagEngine::reduce/project_to_timeframe for recursive levels and HTF projection
// Defaults of "zigzag_advanced" (see the indicator reference)
let params = HashMap::from([
    ("atr_len".to_string(), 14.0),
    ("backstep".to_string(), 2.0),
    ("depth".to_string(), 3.0),
    ("deviation_mode".to_string(), 0.0),
    ("deviation_pct".to_string(), 1.0),
]);
let mut indicator = build_checked("zigzag_advanced", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
ZigZag with backstep, running-leg/confirmation status, and ATR-mode deviation (deviation_mode=percent|atr_multiple, in build_checked as 0|1; deviation_pct is the deviation in percent or in ATR multiples, deviation_value its former typed name); AdvancedZigZagEngine::reduce/project_to_timeframe for recursive levels and HTF projection. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 18 alerts in view, the latest as markers.ZigZag with backstep, running-leg/confirmation status, and ATR-mode deviation (deviation_mode=percent|atr_multiple, in build_checked as 0|1; deviation_pct is the deviation in percent or in ATR multiples, deviation_value its former typed name); AdvancedZigZagEngine::reduce/project_to_timeframe for recursive levels and HTF projection. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 18 alerts in view, the latest as markers.
  • Market structure and patterns
  • unit: Price