kestrel-chartkitv0.33.0

← All examples

dpo

Detrended Price Oscillator

dpo

examples/site_showcase.rs
// Detrended Price Oscillator
// Defaults of "dpo" (see the indicator reference)
let params = HashMap::from([
    ("period".to_string(), 21.0),
]);
let mut indicator = build_checked("dpo", &params)?;

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