kestrel-chartkitv0.41.0

← All examples

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

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
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. 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.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. 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.
  • Market structure and patterns
  • unit: Unitless