kestrel-chartkitv0.33.0

← All examples

bbtrend

BBTrend

bbtrend

examples/site_showcase.rs
// BBTrend (how far a short Bollinger set has moved out of a long one, in percent of the short basis; build_typed accepts variance=population|sample for both sets)
// Defaults of "bbtrend" (see the indicator reference)
let params = HashMap::from([
    ("long_len".to_string(), 50.0),
    ("mult".to_string(), 2.0),
    ("short_len".to_string(), 20.0),
]);
let mut indicator = build_checked("bbtrend", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
BBTrend (how far a short Bollinger set has moved out of a long one, in percent of the short basis; build_typed accepts variance=population|sample for both sets). 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.BBTrend (how far a short Bollinger set has moved out of a long one, in percent of the short basis; build_typed accepts variance=population|sample for both sets). 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.
  • Oscillators
  • unit: Ratio