kestrel-chartkitv0.33.0

← All examples

bottom_formation

Bottom/top formation as a sequence of stages: attempt

bottom_formation

examples/site_showcase.rs
// Bottom/top formation as a sequence of stages: attempt (new low below the last swing low of a falling sequence, reclaimed on the bar), stabilized (higher low), structure shift (close above the intermediate high), confirmed (retest holds, new high); top mirrored; extra: wick (attempt extreme, natural stop), bottom_stage, top_stage
// Defaults of "bottom_formation" (see the indicator reference)
let params = HashMap::from([
    ("max_stage_bars".to_string(), 30.0),
    ("pivot_len".to_string(), 5.0),
    ("retest_atr".to_string(), 0.5),
]);
let mut indicator = build_checked("bottom_formation", &params)?;

for bar in &bars {
    if let Some(output) = indicator.on_bar(bar) {
        // output.value, output.extra[...], indicator.alerts()
    }
}
Bottom/top formation as a sequence of stages: attempt (new low below the last swing low of a falling sequence, reclaimed on the bar), stabilized (higher low), structure shift (close above the intermediate high), confirmed (retest holds, new high); top mirrored; extra: wick (attempt extreme, natural stop), bottom_stage, top_stage. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 2 alerts in view, the latest as markers.Bottom/top formation as a sequence of stages: attempt (new low below the last swing low of a falling sequence, reclaimed on the bar), stabilized (higher low), structure shift (close above the intermediate high), confirmed (retest holds, new high); top mirrored; extra: wick (attempt extreme, natural stop), bottom_stage, top_stage. Default parameters on synthetic 4-hour bars of a fictitious CASOON share (invented prices), the last 150 bars; 2 alerts in view, the latest as markers.
  • Market structure and patterns
  • unit: Unitless