kestrel-chartkitv0.33.0

← All examples

chande_kroll

Chande Kroll Stop

chande_kroll

examples/site_showcase.rs
// Chande Kroll Stop (window extremes minus/plus a Wilder-smoothed ATR, passed through a second extreme window)
// Defaults of "chande_kroll" (see the indicator reference)
let params = HashMap::from([
    ("atr_len".to_string(), 10.0),
    ("mult".to_string(), 3.0),
    ("stop_len".to_string(), 9.0),
]);
let mut indicator = build_checked("chande_kroll", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Chande Kroll Stop (window extremes minus/plus a Wilder-smoothed ATR, passed through a second extreme window). 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.Chande Kroll Stop (window extremes minus/plus a Wilder-smoothed ATR, passed through a second extreme window). 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.
  • Volatility and trend strength
  • unit: Price