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