Library/Price Action and Candlesticks/Candlestick Scanning and Context/Overlapping-Pattern Conflict Resolver

D06-F05-A07 / Complete engineering topic

Overlapping-Pattern Conflict Resolver

A production-minded guide to Overlapping-Pattern Conflict Resolver.

Overlapping-Pattern Conflict ResolverD06 / D06-F05

Candlestick scanners become difficult to trust when a pattern name is the only evidence they return. This tutorial builds the missing contract around one question: Which occurrence survives when several pattern labels consume overlapping bars? By the end, you can form connected overlap components and choose one reproducible winner using declared precedence and stable tie-breaks and verify the same result in Python and TypeScript.

Begin with the decision, not the chart decoration

Overlap is transitive within a connected component. Resolving only adjacent pairs can leave inconsistent winners, so the algorithm groups the entire component first. TA-Lib’s official catalog demonstrates that many candlestick detectors can share an OHLC-array interface, while its API supports both whole-array and streaming execution (function catalog, core API). Our task is not to imitate undocumented vendor settings. It is to make the scanner boundary observable.

The selected formula is:

overlap(a,b)    asbebsae;winner=argmax(priority,confidence,geometry)overlap(a,b)\iff a_s\le b_e\land b_s\le a_e;\quad winner=\arg\max(priority,confidence,geometry)

The comparison is inclusive, the remaining tie-breaks are stable, and unavailable evidence never becomes a convenient zero. Those are implementation choices. They make behavior testable; they do not prove a market edge.

Follow the data contract

The canonical input and output tables live in the topic README. Preserve source-qualified instrument identity, interval and session, price basis, detector version, event time, availability time, and closed-bar state. Binance’s official kline stream shows why finality must be explicit: its payload distinguishes an updating bar from a closed one (provider schema). The exact fields differ across providers, so adapt at ingestion and keep the algorithm provider-neutral.

Rendering system map…

What to notice: validation and time eligibility happen before the decision. A plausible pattern found with later information is still invalid for a point-in-time scan.

Overlapping-Pattern Conflict Resolver worked decision

Open the accessible full-size diagram. The guided lab lets you step through canonical, equality-boundary, and rejected states with reduced-motion support.

Recalculate the fixture

Occurrence A overlaps higher-priority B, so B wins their component even though A has higher confidence. Non-overlapping C remains a second winner. This is labeled synthetic teaching data. The stored expected values were frozen independently of either implementation; both languages must match them within 1e-9 for numbers and exactly for identifiers, arrays, booleans, reason codes, and states.

Implement one source of scanner semantics

The topic-specific Python and TypeScript entry points delegate to a shared D06-F05 family core. That architecture prevents nine packages from inventing nine versions of finite-number checks, inclusive boundaries, and error semantics. It does not hide the topic algorithm: each public wrapper names exactly one core function, and the canonical README freezes its behavior before derivatives.

Run the Python test with python tests/test_conflict_resolver.py and the TypeScript test with node --test tests/conflict_resolver.test.ts from the topic folder. The shared fixture is the cross-language oracle.

Interpret the result carefully

A detector can match geometry, the context can score highly, confirmation can occur, and the ranked alert can still lose money. Lo, Mamaysky, and Wang’s computational work is useful here because it separates systematic recognition from an empirical evaluation design (NBER Working Paper 7613). A production claim needs point-in-time universe membership, survivorship controls, costs, multiple-testing controls, out-of-sample data, and uncertainty. This tutorial claims only reproducible infrastructure behavior.

Failure checklist

  • Reject provisional terminal bars and future-known levels.
  • Do not mix raw and adjusted prices or incompatible session calendars.
  • Preserve warm-up, zero-scale, invalid, suppressed, and expired states.
  • Version definitions before changing thresholds or precedence.
  • Keep ranking scores distinct from probabilities and expected returns.
  • Retain reason codes so an operator can explain every accepted or rejected event.

What comes next

Continue through the related topics listed in the canonical package. Together the family moves from a stable detector registry to occurrence evidence, causal scanning, context, conflict handling, confirmation, and final ranked deduplicated output. Full sources and applicability boundaries are in REFERENCES.md.

Decision flow

Purpose: show the causal position of Overlapping-Pattern Conflict Resolver.

Rendering system map…

Takeaway: the output records both the decision and the evidence boundary.

ReferencesPrimary sources and evidence notes

Expand the source trail, evidence role, and limitations behind the engineering choices.

SRC-01 — TA-Lib function catalog and pattern-recognition group

  • Organization or authors: TA-Lib project
  • Source type: Official maintained function documentation
  • Publication or effective date: Continuously maintained
  • Version: Website state accessed 2026-08-01
  • URL or DOI: https://ta-lib.org/functions/
  • Accessed: 2026-08-01
  • Jurisdiction: Software documentation; not market regulation
  • Supports: Pattern recognition is a distinct function category; documented functions consume OHLC arrays and may be dispatched programmatically.
  • Limitations: TA-Lib's names and outputs do not define this package's registry metadata, thresholds, scores, conflict policy, or state machine.

SRC-02 — TA-Lib C/C++ Core API

  • Organization or authors: TA-Lib project
  • Source type: Official API documentation
  • Publication or effective date: Continuously maintained
  • Version: Website state accessed 2026-08-01
  • URL or DOI: https://ta-lib.org/api/
  • Accessed: 2026-08-01
  • Jurisdiction: Software documentation
  • Supports: The library distinguishes batch array processing, streaming, and dynamic abstraction-layer dispatch.
  • Limitations: This family is dependency-free and does not claim TA-Lib numerical parity.

SRC-03 — Binance Spot kline/candlestick stream

  • Organization or authors: Binance
  • Source type: Official provider API documentation
  • Publication or effective date: Continuously maintained
  • Version: Website state accessed 2026-08-01
  • URL or DOI: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#klinecandlestick-streams-for-utc
  • Accessed: 2026-08-01
  • Jurisdiction: Provider-specific spot-market data
  • Supports: A provider kline message can expose open/close times, OHLC, volume, trade counts, and an explicit closed-bar flag.
  • Limitations: Field meaning, interval calendars, revision behavior, and licensing are provider-specific; the synthetic fixture is not Binance market data.

SRC-04 — CME Group chart types and support/resistance lessons

  • Organization or authors: CME Group
  • Source type: Official exchange education
  • Publication or effective date: Continuously maintained
  • Version: Website state accessed 2026-08-01
  • URL or DOI: https://www.cmegroup.com/education/courses/technical-analysis/chart-types-candlestick-line-bar
  • Accessed: 2026-08-01
  • Jurisdiction: General market education
  • Supports: Candlesticks encode OHLC and practitioners commonly interpret them with trend, volume, support, and resistance context.
  • Limitations: Educational descriptions do not prescribe universal detector thresholds or validate forecasting value.

SRC-05 — Foundations of Technical Analysis

  • Organization or authors: Andrew W. Lo, Harry Mamaysky, and Jiang Wang
  • Source type: Original academic working paper and Journal of Finance article
  • Publication or effective date: 2000
  • Version: NBER Working Paper 7613
  • URL or DOI: https://doi.org/10.3386/w7613
  • Accessed: 2026-08-01
  • Jurisdiction: Empirical U.S. equities study for its declared historical sample
  • Supports: Subjective chart recognition can be translated into systematic computational rules; empirical usefulness requires a separate study design.
  • Limitations: It does not validate this family’s candlestick rules, weights, universe, or current predictive performance.

Evidence and licensing boundary

The external sources support data fields, software organization, common contextual concepts, and the need for systematic definitions. Every numeric weight, inclusive comparison, tie-break, expiry rule, and synthetic value in this package is an implementation choice or author-derived calculation. The fixtures are synthetic and CC0-1.0; no provider observations are redistributed.

conflict_resolver.ts
/** Topic entry point for Overlapping-Pattern Conflict Resolver. */
export { resolveConflicts } from "../../../f05Core.ts";
import { resolveConflicts } from "../../../f05Core.ts";
export function calculateTopic(data: Record<string, unknown>) { return resolveConflicts(data); }
Full-height labplaygroundOpen full screen