harmonic_patterns
Harmonic XABCD patterns
harmonic_patterns
examples/site_showcase.rs// Harmonic XABCD patterns (gartley, bat, butterfly, crab, deep crab, shark) from ZigZag swings as they confirm, one event per structure on the close out of its potential reversal zone. value is the direction of the latest confirmed pattern (1, -1, 0); alerts bull_<name> and bear_<name>; extras pattern (table row 1-6), prz_low, prz_high, d, invalidation, active, confirmed
// Defaults of "harmonic_patterns" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("backstep".to_string(), 2.0),
("depth".to_string(), 3.0),
("deviation_mode".to_string(), 0.0),
("deviation_pct".to_string(), 1.0),
("min_prz_share".to_string(), 0.005),
("pending_swings".to_string(), 2.0),
("ratio_tolerance".to_string(), 0.03),
]);
let mut indicator = build_checked("harmonic_patterns", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}Not yet verified: no independent second implementation yet.