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", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}