kestrel-chartkitv0.33.0

← All examples

bollinger

Bollinger Bands

bollinger

examples/site_showcase.rs
// Bollinger Bands (build_typed accepts variance=population|sample for the standard-deviation divisor; population is the default)
// Defaults of "bollinger" (see the indicator reference)
let params = HashMap::from([
    ("len".to_string(), 20.0),
    ("mult".to_string(), 2.0),
]);
let mut indicator = build_checked("bollinger", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Bollinger Bands (build_typed accepts variance=population|sample for the standard-deviation divisor; population is the default). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 19 alerts in view, the latest as markers.Bollinger Bands (build_typed accepts variance=population|sample for the standard-deviation divisor; population is the default). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 19 alerts in view, the latest as markers.
  • Moving averages, bands and trend lines
  • unit: Price