double_pattern
Double bottom/top as a streaming event: forming on the second pivot
double_pattern
examples/site_showcase.rs// Double bottom/top as a streaming event: forming on the second pivot (equal level within tolerance_atr, counter-swing ≥ min_depth_atr), confirmed on a close through the neckline; extra: neckline, target (measured move), wick (invalidation, natural stop)
// Defaults of "double_pattern" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("max_gap".to_string(), 100.0),
("max_wait".to_string(), 50.0),
("min_depth_atr".to_string(), 1.5),
("pivot_len".to_string(), 5.0),
("tolerance_atr".to_string(), 0.5),
]);
let mut indicator = build_checked("double_pattern", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}