Choose four points in time order
For a bullish reversal hypothesis, A is a high, B a low, C a lower high and D a lower low. The bearish version reverses those directions. Use the same timeframe, session and price source throughout. Wick extremes and closing prices can produce different measurements, so specify which one defines your points.
- Require A, B, C and D to occur on increasing bar indices; do not reuse one bar for two points
- Define how to handle equal highs or lows and a newer, more extreme pivot before coding
- Cancel an unfinished bullish candidate if price breaks above A; reverse the condition for a bearish candidate
- Keep the last unconfirmed swing provisional instead of rewriting earlier trades after it moves
| Point | Bullish reversal candidate | Selection constraint |
|---|
| A | Starting swing high | Use a fixed pivot or reversal-threshold rule |
| B | Swing low below A | Measure AB only after B is confirmed |
| C | Retracement high between B and A | Freeze the candidate once C is confirmed |
| D | Completion low below B | Distinguish a projected price from a confirmed swing |
AB=CD, classic ABCD and extensions use different ratios
TradingView distinguishes three versions in its drawing-tool documentation. Pick the version before measuring. For the formulas below, L_AB = |B - A|, L_BC = |C - B| and L_CD = |D - C| are absolute price distances, not the visual lengths of lines on a screen.
- Equal-leg projection: D = C + (B - A). The signed AB move is repeated from C
- Retracement ratio: r = L_BC / L_AB. If CD equals AB, its BC extension is 1 / r
- A 0.618 retracement therefore pairs with about 1.618 of BC; a 0.786 retracement pairs with about 1.272
- Carney describes C retracements from 0.382 to 0.886 for his AB=CD framework. State the framework instead of mixing its range with an unrelated pattern definition
| Version | Price relationship | Time relationship |
|---|
| AB=CD | L_CD / L_AB = 1 | TradingView describes equal AB and CD duration |
| Classic ABCD | L_CD / L_BC = 1.272 or 1.618 | Specify any time filter separately |
| ABCD extension | L_CD / L_AB = 1.272 or 1.618 | Specify any time filter separately |
Keep exact definitions separate from tolerances
Exact equality is a reference value. A detector needs an explicit acceptance interval. The following bullish example is hypothetical, uses linear price differences and measures duration in chart bars. The tolerances are illustrative testing choices, not established settings or evidence of profitability.
- Price agreement does not imply time agreement; report both ratios
- Choose chart-bar count or elapsed clock time. Sessions, weekends and missing bars make them different measurements
- Record tolerance units: a 5% leg-length error differs from five percentage points of retracement
- If the price zone is reached after the time window, reject it under this rule rather than widening the window afterward
| Measurement | Hypothetical values | Result |
|---|
| Observed points | A = 120, B = 100, C = 112.36 | AB = 20; BC = 12.36; retracement = 0.618 |
| Equal-leg completion | D = 112.36 + (100 - 120) | D = 92.36; CD = 20 |
| Price tolerance | |L_CD / L_AB - 1| ≤ 0.05 | CD from 19 to 21; D from 91.36 to 93.36 |
| Time symmetry | A at bar 10, B at 20, C at 26 | AB takes 10 bars; exact time match puts D at bar 36 |
| Time tolerance | 0.8 ≤ duration_CD / duration_AB ≤ 1.2 | CD takes 8 to 12 bars; D at bars 34 to 38 |
A D label can appear before the trade was knowable
A pivot method that needs three bars to the right can confirm a D low at bar 36 only after bar 39 has closed. Drawing the label back on bar 36 does not make the signal available there. Keep the swing bar, detection bar, confirmation bar and order fill as separate timestamps. TradingView documents this past-plotting issue in its repainting guide.
- If entry requires a confirmed D pivot, evaluate it no earlier than the pivot confirmation
- A projected-zone entry can occur earlier, but it is a different rule that does not yet know the final D swing
- If confirmation requires a close above a particular high after D, define that high and the maximum wait in advance
- Use actual strategy fill timestamps: TradingView market orders normally fill on the next available tick, often the next bar open under default settings
Incomplete structure and failed reversal are different outcomes
An ABCD label describes geometry. It does not establish a trade result. In the hypothetical bullish example, separate the states below so an unfinished candidate is not counted as a completed trade and a losing trade is not removed by relabeling the pattern.
- A sample test could cancel a bullish candidate below 91.36 and require a close above the confirmed D-bar high within five bars of confirmation
- If testing that sample, specify the stop, target and position risk before entry; a zone boundary alone is not a complete exit policy
- A gap through a stop can produce a worse fill than the stop price. Model costs and inspect the order assumptions
| State | What happened | How to record it |
|---|
| Incomplete | A, B and C are known; price has not reached the D zone | Candidate only; no completed D or reversal entry |
| Completed, unconfirmed | Price reaches the allowed zone but the entry trigger never occurs | No trade; expire it at the written deadline |
| Invalidated before entry | Price crosses the preset cancellation boundary before confirmation | Canceled candidate; keep it in the detection audit |
| Failed reversal | An eligible entry occurs, then its stop or time exit closes the trade | Retain the loss and all trading costs |
| Extension | CD runs beyond the equal-leg tolerance | Reject the equal-leg setup; assess an extension only under a separately declared rule |
Turn the measurements into an auditable TradingView test
For ABCD pattern trading, give the Pine Script AI Coding Agent the pivot method, allowed ratios, tolerances, expiry and trade rules. Ask for separate markers for the swing and the time it became known. Review the generated source and compile it in TradingView before evaluating a strategy on standard price candles.
- Keep a later period out of parameter selection; report candidate count as well as executed trades
- Export the TradingView trade list and use Backtest Report to inspect the recorded entries, exits, drawdown and trade distribution
- Compare exported entry times with the confirmation markers yourself. A report of trades cannot prove that the original signal avoided future information
- For five-point XABCD work, the Harmonic Pattern Calculator accepts XABC prices and calculates candidate D zones. It does not select ABCD swings or scan live charts