kestrel-chartkitv0.49.0

← All examples

ultimate_smoother

Ehlers' UltimateSmoother, a two-pole smoother with unity gain at zero frequency and no lag on a straight li…

ultimate_smoother

examples/site_showcase.rs
// Ehlers' UltimateSmoother, a two-pole smoother with unity gain at zero frequency and no lag on a straight line; the first three values are the closes, published from the `period`-th bar. The coefficients use pi in full, where Ehlers' listings truncate it to 3.14159 in the exponent.
// Defaults of "ultimate_smoother" (see the indicator reference)
let params = HashMap::from([
    ("period".to_string(), 20.0),
]);
let mut indicator = build_checked("ultimate_smoother", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Ehlers' UltimateSmoother, a two-pole smoother with unity gain at zero frequency and no lag on a straight line; the first three values are the closes, published from the `period`-th bar. 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.Ehlers' UltimateSmoother, a two-pole smoother with unity gain at zero frequency and no lag on a straight line; the first three values are the closes, published from the `period`-th bar. 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.
  • Moving averages, bands and trend lines
  • unit: Price