kestrel-chartkitv0.33.0

← All examples

smi

Stochastic Momentum Index

smi

examples/site_showcase.rs
// Stochastic Momentum Index (double-smoothed position of the close relative to the midpoint of the high-low range)
// Defaults of "smi" (see the indicator reference)
let params = HashMap::from([
    ("len".to_string(), 10.0),
    ("signal_len".to_string(), 3.0),
    ("smooth_1".to_string(), 3.0),
    ("smooth_2".to_string(), 3.0),
]);
let mut indicator = build_checked("smi", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Stochastic Momentum Index (double-smoothed position of the close relative to the midpoint of the high-low range). 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.Stochastic Momentum Index (double-smoothed position of the close relative to the midpoint of the high-low range). 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