kestrel-chartkitv0.33.0

← All examples

ppo

Percentage Price Oscillator

ppo

examples/site_showcase.rs
// Percentage Price Oscillator
// Defaults of "ppo" (see the indicator reference)
let params = HashMap::from([
    ("fast_period".to_string(), 12.0),
    ("signal_period".to_string(), 9.0),
    ("slow_period".to_string(), 26.0),
]);
let mut indicator = build_checked("ppo", &params)?;

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