kestrel-chartkitv0.33.0

← All examples

keltner

Keltner Channels

keltner

examples/site_showcase.rs
// Keltner Channels
// Defaults of "keltner" (see the indicator reference)
let params = HashMap::from([
    ("atr_period".to_string(), 10.0),
    ("ema_period".to_string(), 20.0),
    ("multiplier".to_string(), 2.0),
]);
let mut indicator = build_checked("keltner", &params)?;

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