kestrel-chartkitv0.33.0

← All examples

relative_volatility

Relative Volatility Index

relative_volatility

examples/site_showcase.rs
// Relative Volatility Index (the RSI construction applied to the standard deviation; build_typed accepts variant=close|high_low). Unrelated to "rvi", the Relative Vigor Index
// Defaults of "relative_volatility" (see the indicator reference)
let params = HashMap::from([
    ("smooth_len".to_string(), 14.0),
    ("stdev_len".to_string(), 10.0),
]);
let mut indicator = build_checked("relative_volatility", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Relative Volatility Index (the RSI construction applied to the standard deviation; build_typed accepts variant=close|high_low). 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.Relative Volatility Index (the RSI construction applied to the standard deviation; build_typed accepts variant=close|high_low). 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