kestrel-chartkitv0.33.0

← All examples

wavetrend

WaveTrend Oscillator

wavetrend

examples/site_showcase.rs
// WaveTrend Oscillator (wt1, wt2)
// Defaults of "wavetrend" (see the indicator reference)
let params = HashMap::from([
    ("n1".to_string(), 10.0),
    ("n2".to_string(), 21.0),
    ("ob_level".to_string(), 60.0),
    ("os_level".to_string(), -60.0),
]);
let mut indicator = build_checked("wavetrend", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
WaveTrend Oscillator (wt1, wt2). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 22 alerts in view, the latest as markers.WaveTrend Oscillator (wt1, wt2). Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 22 alerts in view, the latest as markers.
  • Oscillators
  • unit: Ratio