kestrel-chartkitv0.33.0

← All examples

stoch_rsi

Stochastic RSI

stoch_rsi

examples/site_showcase.rs
// Stochastic RSI
// Defaults of "stoch_rsi" (see the indicator reference)
let params = HashMap::from([
    ("d_len".to_string(), 3.0),
    ("k_len".to_string(), 3.0),
    ("overbought".to_string(), 80.0),
    ("oversold".to_string(), 20.0),
    ("rsi_len".to_string(), 14.0),
    ("stoch_len".to_string(), 14.0),
]);
let mut indicator = build_checked("stoch_rsi", &params)?;

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