kestrel-chartkitv0.33.0

← All examples

true_range

True Range in price units

true_range

examples/site_showcase.rs
// True Range in price units
// Defaults of "true_range" (see the indicator reference)
let params = HashMap::new();
let mut indicator = build_checked("true_range", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
True Range in price units. 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.True Range in price units. 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: Unitless