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", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}