kestrel-chartkitv0.49.0

← All examples

mama

Ehlers' MESA Adaptive Moving Average of the median price with its follower FAMA

mama

examples/site_showcase.rs
// Ehlers' MESA Adaptive Moving Average of the median price with its follower FAMA (extras `fama`, `period`); published from the 50th bar. The price smoothing starts from the first closes and the Hilbert transform from the 7th bar, MAMA and FAMA from the price (Ehlers' listing starts every series from 0)
// Defaults of "mama" (see the indicator reference)
let params = HashMap::from([
    ("fast_limit".to_string(), 0.5),
    ("slow_limit".to_string(), 0.05),
]);
let mut indicator = build_checked("mama", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Ehlers' MESA Adaptive Moving Average of the median price with its follower FAMA (extras `fama`, `period`); published from the 50th bar. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.Ehlers' MESA Adaptive Moving Average of the median price with its follower FAMA (extras `fama`, `period`); published from the 50th bar. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 4 alerts in view, the latest as markers.
  • Moving averages, bands and trend lines
  • unit: Price