Skip to main content

Module chart_patterns

Module chart_patterns 

Source
Expand description

Chart pattern framework: swing-based trendline fits, tolerance-checked pattern rules, confidence ranking, overlap eviction, and a lifecycle state — built on super::zigzag_advanced::ZigZagNode sequences (e.g. from super::zigzag_advanced::AdvancedZigZagEngine::nodes) rather than re-detecting swings.

Covers the triangle family (symmetrical, ascending, descending) and its diverging counterpart the broadening formation, Rising/Falling Wedge, the 1-2-3 Reversal, the Wolfe Wave, the classic reversal family (double and triple top/bottom, head and shoulders and its inverse), and auto-fitted trendlines. Each detector is a fixed, documented geometric rule over swing points — a deterministic approximation of how these patterns are described in TA literature, not a claim that every instance found is a “real” tradable pattern.

§Complete is not confirmed

Two roughly equal highs are not a double top. They become one when the trough between them breaks. The reversal detectors therefore emit their candidates as PatternState::Forming even though every defining node is already in place, and only PatternState::Confirmed once price closes through the neckline. That distinction is the whole point of the family: the shape is visible long before it means anything, and a detector that reported the shape as the result would encode exactly the misreading these patterns are famous for.

Structs§

ChartPatternCandidate
ChartPatternDetector
Scans a swing-node sequence for pattern candidates and evicts overlapping lower-confidence ones, so the result is a ranked, non-redundant set rather than every geometrically-possible match.
TrendLine
A two-point price line, usable to project a value at any timestamp.

Enums§

ChartPatternKind
PatternState
Lifecycle of a detected pattern candidate.