rogers_satchell
Rogers-Satchell volatility estimator
rogers_satchell
examples/site_showcase.rs// Rogers-Satchell volatility estimator (Rogers and Satchell 1991), independent of the drift of the price: the mean of ln(H/O) ln(H/C) + ln(L/O) ln(L/C) over the window, floored at zero, rooted and annualised with periods_per_year, in percent; a window with a non-positive price publishes nothing
// Defaults of "rogers_satchell" (see the indicator reference)
let params = HashMap::from([
("period".to_string(), 20.0),
("periods_per_year".to_string(), 252.0),
]);
let mut indicator = build_checked("rogers_satchell", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}