kestrel-chartkitv0.49.0

← All examples

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", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.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. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 0 alerts in view, the latest as markers.
  • Volatility and trend strength
  • unit: Ratio