gap
Price gap between consecutive bars: the open beyond the previous bar's range or close, size in ATR of the p…
gap
examples/site_showcase.rs// Price gap between consecutive bars: the open beyond the previous bar's range or close, size in ATR of the previous bar, every open gap with its filled fraction, closing as an event
// Defaults of "gap" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("max_bars".to_string(), 100.0),
("min_atr".to_string(), 0.0),
("reference".to_string(), 0.0),
]);
let mut indicator = build_checked("gap", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}