kestrel-chartkitv0.33.0

← All examples

pmo

Price Momentum Oscillator

pmo

examples/site_showcase.rs
// Price Momentum Oscillator (twice-smoothed one-bar return with alpha = 2/length, scaled by ten)
// Defaults of "pmo" (see the indicator reference)
let params = HashMap::from([
    ("length_1".to_string(), 35.0),
    ("length_2".to_string(), 20.0),
    ("signal_len".to_string(), 10.0),
]);
let mut indicator = build_checked("pmo", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Price Momentum Oscillator (twice-smoothed one-bar return with alpha = 2/length, scaled by ten). 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.Price Momentum Oscillator (twice-smoothed one-bar return with alpha = 2/length, scaled by ten). 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