kestrel-chartkitv0.33.0

← All examples

mass_index

Mass Index Reversal Detector

mass_index

examples/site_showcase.rs
// Mass Index Reversal Detector
// Defaults of "mass_index" (see the indicator reference)
let params = HashMap::from([
    ("period".to_string(), 25.0),
]);
let mut indicator = build_checked("mass_index", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Mass Index Reversal Detector. 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.Mass Index Reversal Detector. 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.
  • Volatility and trend strength
  • unit: Ratio