Cập nhật
ABCD Pattern

The ABCD Pattern indicator automatically detects and draws classic harmonic ABCD structures on any instrument and timeframe. The pattern consists of four alternating swing points — A, B, C, D — where the price action forms two consecutive price legs with a retracement between them, validated using Fibonacci ratios.
Pattern Structure
A bullish ABCD begins at a swing high (A), retraces to a swing low (B), rallies to a swing high (C) below A, then drops to a swing low (D) where the reversal is expected. A bearish ABCD mirrors this logic starting from a swing low.
The indicator uses an alternating pivot buffer that enforces strict alternation between highs and lows. When a new pivot is detected that matches the existing direction, it replaces the current pivot rather than creating a new leg — this ensures only clean, well-defined structures are tracked.
Fibonacci Validation
For a pattern to qualify, two conditions must be met simultaneously:
BC/AB retracement: the BC leg must retrace between 50% and 88.6% of the AB leg
CD/BC extension: the CD leg must extend between 113% and 161.8% of the BC leg
Both ranges are fully configurable from the inputs panel. Tightening the ranges produces fewer, higher-quality signals. Widening them detects more patterns with looser Fibonacci alignment.
PRZ — Potential Reversal Zone
Before the D point is confirmed, the indicator projects a D zone box onto the chart in real time. This box is calculated from the current C pivot using the configured Fibonacci extension range, giving the trader a visual target area to watch. The moment D is confirmed by the pivot lookback, the PRZ box closes at the D bar and the full zigzag is drawn.
Visual Output
When a pattern completes, the indicator draws:
Three connecting lines across the A→B→C→D zigzag (A→B and B→C in a lighter shade, C→D in full color)
Labels at each pivot point: A, B, C, and D with a directional arrow (↑ bullish, ↓ bearish)
A triangle signal shape below/above the D bar for quick visual scanning
Bullish patterns are shown in green, bearish in red. Both colors are fully customizable.
MTF Dashboard
A compact table in the top-right corner displays the last ABCD signal direction across three independently configurable timeframes using request.security(). Each cell shows ▲ (last signal was bullish) or ▼ (last signal was bearish), color-coded green or red. Signals older than a configurable number of bars are shown as neutral (grey) to avoid acting on stale context.
Settings
Left/right bars: controls pivot sensitivity (default 5/5)
BC/AB min and max retracement ratios
CD/BC min and max extension ratios
PRZ width in bars
Toggle: PRZ box, labels, zigzag lines, MTF dashboard
Bullish/bearish colors
Three MTF timeframes + stale threshold
No repainting. All signals fire only after the D pivot is fully confirmed by the right-bar lookback. Compatible with any plan — does not require premium features.
Pattern Structure
A bullish ABCD begins at a swing high (A), retraces to a swing low (B), rallies to a swing high (C) below A, then drops to a swing low (D) where the reversal is expected. A bearish ABCD mirrors this logic starting from a swing low.
The indicator uses an alternating pivot buffer that enforces strict alternation between highs and lows. When a new pivot is detected that matches the existing direction, it replaces the current pivot rather than creating a new leg — this ensures only clean, well-defined structures are tracked.
Fibonacci Validation
For a pattern to qualify, two conditions must be met simultaneously:
BC/AB retracement: the BC leg must retrace between 50% and 88.6% of the AB leg
CD/BC extension: the CD leg must extend between 113% and 161.8% of the BC leg
Both ranges are fully configurable from the inputs panel. Tightening the ranges produces fewer, higher-quality signals. Widening them detects more patterns with looser Fibonacci alignment.
PRZ — Potential Reversal Zone
Before the D point is confirmed, the indicator projects a D zone box onto the chart in real time. This box is calculated from the current C pivot using the configured Fibonacci extension range, giving the trader a visual target area to watch. The moment D is confirmed by the pivot lookback, the PRZ box closes at the D bar and the full zigzag is drawn.
Visual Output
When a pattern completes, the indicator draws:
Three connecting lines across the A→B→C→D zigzag (A→B and B→C in a lighter shade, C→D in full color)
Labels at each pivot point: A, B, C, and D with a directional arrow (↑ bullish, ↓ bearish)
A triangle signal shape below/above the D bar for quick visual scanning
Bullish patterns are shown in green, bearish in red. Both colors are fully customizable.
MTF Dashboard
A compact table in the top-right corner displays the last ABCD signal direction across three independently configurable timeframes using request.security(). Each cell shows ▲ (last signal was bullish) or ▼ (last signal was bearish), color-coded green or red. Signals older than a configurable number of bars are shown as neutral (grey) to avoid acting on stale context.
Settings
Left/right bars: controls pivot sensitivity (default 5/5)
BC/AB min and max retracement ratios
CD/BC min and max extension ratios
PRZ width in bars
Toggle: PRZ box, labels, zigzag lines, MTF dashboard
Bullish/bearish colors
Three MTF timeframes + stale threshold
No repainting. All signals fire only after the D pivot is fully confirmed by the right-bar lookback. Compatible with any plan — does not require premium features.
Phát hành các Ghi chú
WHAT THIS ISAn ABCD is three confirmed swings and a fourth that has to land inside a Fibonacci window. Most scripts draw the shape once all four points exist — which is a drawing, not a signal, because by then the move you would have traded has already happened.
This one projects the fourth point before it exists, marks the completed pattern on the bar it actually completed on, and filters out the ones too small to be structure.
1. THE D ZONE IS PROJECTED, NOT REPORTED
As soon as A, B and C are confirmed, the region where D must complete is already determined: it is the CD extension measured off the BC leg. The script draws that zone ahead of price.
That zone is the only part of an ABCD you can act on. Everything drawn after D has printed is a record of what happened.
The zone updates as new swings confirm, and disappears when the last three pivots stop forming a valid ABCD leg structure — it does not linger as decoration once the setup it described is gone.
2. THE PATTERN IS MARKED WHERE IT HAPPENED
A swing low is only confirmed a number of bars after it forms — that is what makes a pivot a pivot, and it is why nothing here repaints.
The consequence is that the completing swing of an ABCD is recognised late. Scripts that plot a shape on the bar the pattern was detected put the arrow several bars to the right of the point it refers to, so the labels say one thing and the marker points somewhere else.
Here the labels, the zigzag legs and the triangles are all drawn on the bar they belong to.
3. SIGNIFICANCE FILTER
The Fibonacci windows are wide by nature — a BC retracement anywhere from 50% to 88.6% is most of the plausible range. Without a size filter, every minor wiggle on the chart satisfies the geometry and the chart fills with patterns spanning less than an average candle.
Minimum AB leg (× ATR) judges the reference leg of the pattern against current volatility. Raise it until only the swings you would have drawn by hand survive. This is the setting that decides whether the output is usable.
4. MULTI-TIMEFRAME DASHBOARD
A compact table shows the most recent ABCD direction on three timeframes of your choosing, and whether it is still recent enough to matter.
A column greys out to – when its last pattern is older than the staleness threshold, so an ABCD from two hundred bars ago does not sit there implying it is still in play.
The threshold is counted in bars of that timeframe: 50 on the H4 column means 50 four-hour bars, not 50 chart bars. That is usually what you want from a higher-timeframe column, but it is worth knowing before you read the row.
SETTINGS
Left / Right bars — pivot strength. Higher gives fewer and larger swings, and more delay before a pattern is confirmed.
BC/AB retracement min and max — how deep B to C must pull back. Defaults 0.50 to 0.886.
CD/BC extension min and max — how far D must extend beyond C. Defaults 1.13 to 1.618.
Minimum AB leg (× ATR) — the size filter described above.
PRZ width — how far right the projected zone is drawn.
Three dashboard timeframes and the staleness threshold.
Zigzag lines, labels, the projected zone and the dashboard can each be switched off.
ALERTS
Three conditions: bullish ABCD completed, bearish ABCD completed, and either. All fire on completion, once per pattern.
LAG, STATED
Nothing repaints, and that costs you. A pivot is confirmed Right bars after it forms, so a completed ABCD is recognised that many bars after D printed. The projected D zone does not have this problem — it is built from pivots that were already confirmed, which is precisely why it is the useful half of the tool.
WHAT THIS DOES NOT DO
It does not tell you to buy or sell at D, and it makes no claim about how often price reverses there. Geometry that fits a Fibonacci window is not evidence of anything on its own, and whether these setups survive real spread and commission on your instrument is a question this tool does not answer and does not pretend to.
Phát hành các Ghi chú
ABCD PATTERN — PROJECTED D CONTEXT AND DELAYED PIVOT CONFIRMATIONABCD Pattern retains alternating swing pivots, projects a possible D interval from the latest ABC sequence and checks the next confirmed pivot against configurable Fibonacci windows. Completed geometry is drawn at its pivot locations, while alerts become available on the later detection bar. A three-timeframe panel records the latest matched direction and whether it is still fresh.
This refresh adds softer teal/rose labels and projected zones, smaller triangles and a theme-aware panel. Stale now distinguishes an expired last match from no previous match. Zone text follows its current direction's color. Detection, pivot updates, projected price formulas, three alert conditions and the existing marker offset are unchanged; comments and tooltips now state that historical marker placement does not remove confirmation delay.
01 / HOW THE SWING SEQUENCE IS RETAINED
Left Bars and Right Bars initially equal five. A pivot needs the specified number of bars on each side. Its bar location is the detection bar minus Right Bars. The newest retained pivot is D in a four-point completed sequence; the preceding points are C, B and A.
A newly returned pivot of the opposite type shifts the sequence and sets the new-pivot flag. A more extreme pivot of the SAME type replaces the latest retained point and location without independently rerunning the completed-match test. Less extreme same-type pivots are ignored. When both types are returned on one execution, the high block runs before the low block.
Consequently, the retained ABC context and current projected zone can evolve before another alternating pivot produces a new completed match. Existing completed lines and labels are historical drawings; they are not a continuously revalidated position.
02 / COMPLETED BULLISH AND BEARISH GEOMETRY
Bullish requires high A, low B, lower high C and low D. AB = A − B, BC = C − B and CD = C − D. A, B, C and D alternate in type, C must be strictly below A, and all three leg magnitudes must be positive.
Bearish is the opposite: low A, high B, higher low C and high D. AB = B − A, BC = B − C and CD = D − C. C must be strictly above A and all magnitudes positive. There is no separate requirement that D exceed B in the pattern direction.
AB must be at least Minimum AB Leg × ATR(14), initially 1.5. The ATR is read at DETECTION, not fixed at A or B.
BC/AB must lie between BC Min and Max, initially 0.50–0.886. CD/BC must lie between CD Min and Max, initially 1.13–1.618. All ratio boundaries and the AB size boundary are inclusive. There is no separate tolerance input, AB=CD equality test, time-symmetry check, volume filter or trend vote.
The minimum and maximum inputs are not automatically sorted. Configure each minimum no greater than its maximum; reversed values can prevent completed matches and produce an unsuitable projection interval.
03 / THE PROJECTED D ZONE
The candidate uses the latest THREE retained alternating pivots as A, B and C. It applies the same AB size requirement and BC/AB window, plus the corresponding C-versus-A geometry, before displaying a zone.
For bullish ABC, the upper/lower candidate bounds are C − BC × CD Min and C − BC × CD Max. Bearish bounds are C + BC × CD Min and C + BC × CD Max.
The box begins at C's retained bar and extends PRZ Width bars beyond the current chart bar, initially 15. It is created and then moved as the latest context develops. If the evaluated ABC candidate fails its checks, the current box is deleted. It is not a permanent historical record of every provisional zone.
Projection runs on the last chart bar. It does not require a confirmed D pivot, a touch, a close inside the box, a rejection candle or subsequent follow-through. There is no zone-touch alert, automatic order, stop placement, target calculation or trade-outcome accounting.
04 / THE D BAR AND THE DETECTION BAR ARE DIFFERENT
Completed A/B/C/D labels and all three connecting lines use retained pivot coordinates. The triangle is also offset backward by Right Bars, so it sits on D. With the initial value five, the completed match is evaluated five chart bars after D's location.
An arrow drawn on D therefore does NOT mean the signal existed on that bar. Alerts fire from the unshifted detection condition. The visual offset changes placement, not information availability.
The script does not explicitly gate conditions with confirmed chart close. A current bar can still alter a candidate pivot before it closes. Requested timeframe states also develop independently. The revised wording avoids a blanket promise that every intermediate live display will match the eventual historical chart.
05 / WHAT THE MULTI-TIMEFRAME PANEL REPORTS
The initial columns are 15, 60 and 240 minutes. Each requested context evaluates the retained last completed-match direction and its signal age in that timeframe. The panel does not report the live projected-zone direction or whether price is currently inside a zone.
A bullish completed match stores +1; bearish stores −1. Freshness is age no greater than Fresh Through Age, initially 50 bars OF THE REQUESTED TIMEFRAME. Age 50 is fresh and 51 stale. Thus 50 four-hour bars is a different elapsed period from 50 fifteen-minute bars.
The refreshed table displays a dash when no previous direction exists, Stale when the stored match has expired and an arrow while fresh. Expiry does not delete the stored direction or old pattern drawings. These columns are context; cross-timeframe agreement does not filter the chart's own detections.
Requests explicitly use lookahead_off but no one-bar confirmed-value offset. The latest requested bar can change until it closes. A lower-than-chart request does not reconstruct every intrabar event or transition.
06 / DISPLAY SWITCHES AND ALERTS
ABCD Labels, Zigzag Lines, Projected D Zone and MTF Dashboard control their respective drawings. Hiding labels or lines does not disable completed-match calculations or alerts. Older drawings are subject to the indicator's object limits.
The three alerts are ABCD Long, Short and Any. They indicate a newly accepted four-pivot ratio sequence on the detection execution, not a fill at D, a touch of the projected box or a profitable reversal. For closed-chart-bar notifications, choose Once Per Bar Close when creating the alert. Recreate existing alerts if adopting the refreshed script and desired settings.
Use ABC to study the candidate interval, then distinguish a later completed match from its historical placement. The indicator does not validate executable entries, position size, stops, targets or a future trading edge.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.