rsi
Relative Strength Index
rsi
examples/site_showcase.rs// Relative Strength Index (build_typed accepts smoothing=wilder|ema for the up/down averages; wilder is the default)
// Defaults of "rsi" (see the indicator reference)
let params = HashMap::from([
("avg_len".to_string(), 3.0),
("overbought".to_string(), 70.0),
("oversold".to_string(), 30.0),
("rsi_len".to_string(), 14.0),
("sig_len".to_string(), 3.0),
]);
let mut indicator = build_checked("rsi", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}