stoch_rsi_divergence
Divergence on Stoch RSI
stoch_rsi_divergence
examples/site_showcase.rs// Divergence on Stoch RSI (%K, 14/14/3) with the pivots found in the oscillator (TradingView's divergence scripts); price read at the same bars; alerts and extras as oscillator_pivot_divergence
// Defaults of "stoch_rsi_divergence" (see the indicator reference)
let params = HashMap::from([
("left".to_string(), 5.0),
("max_distance".to_string(), 60.0),
("max_prior_pivots".to_string(), 1.0),
("min_distance".to_string(), 5.0),
("right".to_string(), 5.0),
]);
let mut indicator = build_checked("stoch_rsi_divergence", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}