stochastic
Classic Stochastic Oscillator
stochastic
examples/site_showcase.rs// Classic Stochastic Oscillator
// Defaults of "stochastic" (see the indicator reference)
let params = HashMap::from([
("d_period".to_string(), 3.0),
("k_period".to_string(), 14.0),
]);
let mut indicator = build_checked("stochastic", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}