narrow_range
Narrowest range of the last period bars
narrow_range
examples/site_showcase.rs// Narrowest range of the last period bars (NR4, NR7) after Crabel (1990): 1 when the bar's high-low range is strictly smaller than each of the period - 1 bars before it; extra inside marks a bar within the previous bar's range
// Defaults of "narrow_range" (see the indicator reference)
let params = HashMap::from([
("period".to_string(), 7.0),
]);
let mut indicator = build_checked("narrow_range", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}