Scan 22 harmonic families and classic chart patterns, each with entry, targets and stop
Harmonic Pattern Lab scans a zigzag of your TradingView chart for 22 harmonic XABCD and AB=CD families, the 3-Drive and seven classical chart patterns.
- 22 harmonic families, from Gartley to Anti-Nen Star, plus the 3-Drive and seven classical patterns.
- Detection on closed candles only; once a pattern is drawn, it does not change.
- Entry, Target 1, Target 2 and a stop at the far edge of the validation zone for each pattern.
- 4-hour supply and demand zones, an RSI divergence and volume mark, and a fit score at D.
- The full Pine Script source code. Paste it into the Pine Editor, save, and add “Harmonic Pattern Lab [AlgoFXStore]” to your chart.
- A 16-page PDF manual with installation, every setting and how to read the chart. One-time €47.

See Harmonic Pattern Lab on a real chart
Press play; use the full-screen button to see every detail.
Harmonic patterns are precise on paper and loose on most charts
A harmonic pattern is defined by ratios: where B retraces the XA leg, where C retraces AB, and where D completes against both. Drawn by hand with the Fibonacci tools, those ratios get rounded to whatever fits. A Gartley becomes a Bat when it is convenient, the D point slides to the latest low, and the stop goes wherever the trader feels comfortable.
Even traders who measure carefully can only check a few legs at a time. A chart holds dozens of possible XABCD combinations, nested legs and several families that overlap in their ratios. And finding the pattern is only half the work: you still need an entry, targets, a stop that means something and a rule for when the pattern has failed.
Harmonic Pattern Lab does the measuring on every closed candle. It tests each combination against each enabled family's ratio bands, scores the fit, and draws only what passes. Every drawn pattern carries the same plan: an entry a little beyond D, two targets as percentages of the measured leg, and a stop at the far edge of the zone where D was allowed to be.
Everything Harmonic Pattern Lab draws on your chart
Read from the shipped Pine Script code.
- Harmonic XABCD patterns (22 families incl. AB=CD) on the zigzag of depth 8: solid legs X-A, A-B, B-C, C-D plus the X-B and B-D edges, two closed triangles XAB and BCD shaded in the pattern colour at 70 % transparency, dotted measurement diagonals A-C and X-D (AB=CD: A-C and B-D, no X), letters X A B C D at the pivots, ratio numbers (BC/AB on A-C, CD/BC on B-D, AB/XA on X-B, AD/XA on X-D; Cypher XC/XA and CD/XC; 5-0 an open zigzag with dotted X-B / X-D guides)
- The name label at D: '<Family> up ' (bullish) or '<Family> down ' (bearish) + the 0-100 fit score + ' ' (RSI 14 divergence at D) + ' ' (D-bar volume >= 1.5 x its 20-bar average) + ' star ' when the validation zone overlaps an aligned supply / demand zone
- Classical formations and the 3-Drive: Double Top / Double Bottom (zigzag, neckline and break line), Head and Shoulders / Inverse Head and Shoulders (zigzag, 'Left Shoulder', 'Head', 'Right Shoulder' labels, horizontal neckline to the break bar), Ascending / Descending / Symmetrical Triangle (both boundaries extended to the break bar, X A B C letters and a D at the break extreme), 3-Drive (zigzag, filled tip labels 1 2 3, 'b' at the retracements, dotted lines between the drive tips carrying the extension ratios); name label '<Name> up ' / '<Name> down '
- Trade-plan segments of each drawn pattern, 6 bars long and ending 12 bars right of the current bar while it is active: 'En: <price>' (pattern colour, width 3 once entered), 'T1: <price>' and 'T2: <price>' (green), 'SL: <price>' (red); all four are removed once Target 1 is reached
- Validation zone: a dotted bracket from 11 bars before D to D at the zone's low and high, joined by a vertical line, in the pattern colour
- Prediction on the last bar: the nearest possible D of a forming pattern - a dotted blue path X-A-B-C to a future D 12 bars ahead (width 3), translucent blue triangles, a blue PRZ box from the current bar to 12 bars ahead, and the label '<Family>: <low> - <high>' for up to 4 families (nearest first) + 'Possible Patterns'; it can move or disappear on every bar
- Panel top centre (size small): header 'Pattern Name | Dir | Entry | Target 1 | Target 2 | Stop-loss | Age | Dist % | R:R | Q' and one row per active pattern
- Supply | Demand zones from the 4 hour chart: supply boxes rgb(226,61,103) 58 % transparent, demand boxes rgb(38,166,91) 60 %, 1 px border, dashed midline, from the pivot to 250 chart bars right of the current bar, up to 8 per side, deleted after a close beyond the zone; timeframe label '4H' top right
- Performance table bottom right (input 'Show performance table', ON by default): per-family statistics of the loaded history - switched off for the captures
- AlgoFXStore watermark bottom right, large grey text, always
From a zigzag to a pattern with a plan
This is the logic of the shipped Pine Script. The pattern lifecycle and every detection run on closed candles; the supply and demand module reads the 4-hour chart with lookahead off.
- 1
A zigzag on closed candles
With the default Rolling extrema swing construction, a closed candle whose high is the highest of the last 8 candles (Minimum ZigZag Period) extends or starts an up-leg, and the lowest low of 8 a down-leg. The newest endpoint is the developing D, tested at the candle close. A Confirmed pivot mode, which waits for pivot confirmation bars, is available instead.
- 2
Every combination is tested
Whenever the zigzag changes, the newest 20 pivots are enumerated into up to 40 X-A-B-C-D and 40 A-B-C-D combinations, nested legs included. Each enabled family must match its AB/XA, BC/AB and CD/BC ratios within its band, widened by the Error Rate of 8 percent, and D must sit inside the family's completion band.
- 3
Gates before a pattern is drawn
A pattern must span 20 to 150 bars, AB=CD needs CD to take 80 to 150 percent of AB's bars, and the close must not already be beyond the zone's far edge. At most 2 new patterns per bar and 8 active patterns are allowed, with no second active pattern of the same family and direction. Classical patterns and the 3-Drive have their own shape rules.
- 4
Entry, targets and stop
The measured leg is CD or AD depending on the family. Entry sits at D plus 10 percent of that leg in the trade direction, Target 1 at 40 percent and Target 2 at 94 percent, or at 1R and 2R if you prefer. In the default Zone stop mode the stop is the far edge of the validation zone. Targets are drawn in green and the stop in red.
- 5
A lifecycle on closed candles
From the next closed candle, a long is entered when a high reaches the entry, a short when a low reaches it, and the BUY or SELL entry alert fires. Before entry, a close beyond the validation zone invalidates the pattern; 160 bars after detection it expires. After entry, a close beyond the stop ends it, and Target 2 finishes it.
- 6
Context: zones, projection, panel
Supply and demand zones from the 4-hour chart are added at the next 4-hour candle and deleted after a close beyond them. On the last bar a blue projection shows the nearest possible D zones of forming patterns. A panel lists every active pattern with entry, targets, stop, age, distance, reward to risk and fit score.
Harmonic Pattern Lab on 12 different markets
Every chart below is a screenshot of TradingView itself with the shipped Harmonic Pattern Lab [AlgoFXStore] attached at its default settings. Forex, metals, indices, energy and crypto, so you can see how it reads each kind of market. They show what the indicator draws; they are not trading results. Tap or click any chart to open it full size.












Harmonic Pattern Lab on a real TradingView chart, frame by frame
Frames of a screen recording of the shipped indicator at its default settings, as the chart updates. Nothing is edited into the chart.




Working a detected pattern with its own filters
The indicator detects, draws, tracks and alerts. The decision and the orders are yours; this routine follows the PDF guide and is worth practising on a demo account first.
- 1
Choose the chart and the session
15 minutes works on gold, forex and crypto with the defaults; 1 hour gives larger patterns, and 4 hours to daily suit swing trading. On index CFDs, limit new patterns to the cash session with Detection session, for example 1430-2100 with UTC offset 0 for 09:30 to 16:00 New York in winter. Avoid new entries shortly before central bank decisions, CPI or the US jobs report.
- 2
Filter by fit and confluence
Set Minimum quality, for example 70, to keep only close fits. Turn on the trend filter, EMA 200, to keep bullish patterns above it and bearish ones below. Prefer patterns that carry a mark: a star when the zone overlaps a matching supply or demand zone, the divergence mark for RSI divergence at D, the lightning mark for a volume spike.
- 3
Read the panel before entering
The panel shows the distance from price to the entry and the Target 1 reward to risk for every active pattern. A large distance means the entry is far away; a reward to risk below 1 means Target 1 is close compared with the stop. Both are good reasons to pass.
- 4
Size from the zone stop
Subtract the stop from the entry to get the risk. The guide's bullish Gartley example on gold: entry 4316.14 and stop 4309.07 is 7.07 dollars per ounce, Target 1 is 1.4 times that and Target 2 3.9 times. With 100 ounces per lot and a risk of 50 in account currency, the size is 0.07 lots. If the zone stop is too wide, skip or trade smaller.
- 5
Manage at Target 1
Use Target 1 to reduce risk: take part of the position off, or set Stop mode to Break even or Trailing, which move the stop after Target 1. Never move the stop further away. Gold and EURUSD, or NAS100 and bitcoin, often move together, so several patterns there can be one bet.
The dashboard, row by row
- Header: Pattern Name, Dir, Entry, Target 1, Target 2, Stop-loss, Age, plus Dist %, R:R, Q (input 'Extra columns', on)
- One row per active pattern (pending, entered or past T1), up to 20: name with star marks on the pattern colour, Long / Short, entry (' tick <price>' grey once entered), T1 (' tick ' once reached), T2, stop, age in bars since detection, distance from price to entry in % ('-' once entered), T1 reward / initial risk, fit score 0-100
Everything Harmonic Pattern Lab does for you
22 harmonic families
Gartley, Butterfly, Bat, Crab, Alternate Bat, Deep Crab, Cypher, AB=CD, White Swan, Black Swan, Shark, Nen Star, Leonardo, Partizan, 5-0 and seven Anti versions, each with its own switch.
Classical patterns and the 3-Drive
Double top and bottom, head and shoulders and its inverse, ascending, descending and symmetrical triangles, and the 3-Drive, each drawn with its own labels and the same entry, target and stop logic.
Ratios and a fit score on the chart
Points X A B C D, the measured ratios on the legs and diagonals, shaded triangles and a 0 to 100 fit score at D, which shows how closely the ratios match the family. It is not a probability of success.
A plan for every pattern
Entry, Target 1 and Target 2 as percentages of the measured leg or as reward to risk, and four stop modes: Zone, Manual percent, Break even and Trailing. Targets are green and the stop red for longs and shorts.
4-hour supply and demand zones
Zones from the 4-hour chart, read from the previous closed 4-hour candle with lookahead off, up to 8 per side and deleted after a close beyond them. A star marks patterns whose zone overlaps a matching zone.
A projection of the next D
On the last bar a blue dotted path, a PRZ box and a label list the nearest possible D zones for up to four forming families. It is display only: it never creates a pattern, a signal or an alert.
A panel of active patterns
One row per active pattern: name with its marks, direction, entry, both targets, stop, age in bars, distance to entry, Target 1 reward to risk and fit score, with reached levels greyed out.
Alerts for the whole lifecycle
Eleven alert conditions, from BUY entry and SELL entry to Target 1, Target 2, Stop, Invalidation, Expiry, new supply or demand zones and zone confluence, plus template-based alert() messages in text or JSON, sent on closed realtime bars.
A pattern statistics table
A table per family of the loaded history, on by default, counting entries, targets reached and stops. It is hindsight bookkeeping that resets on reload and is not a forecast; switch it off with Show performance table.
Harmonic Pattern Lab, feature by feature
Each picture is built from real platform screenshots of the shipped indicator at its default settings, labelled so you can see what every part does. Tap any picture to open it full size.









How traders put it to work
Gold intraday on 15 minutes
The defaults work on XAUUSD; at 15 minutes a pattern spans about 5 hours to a day and a half. Gold moves fast around the London and New York opens, so check the panel's distance to entry before acting on a pattern that formed just before them.
Forex on 15 minutes to 1 hour
The defaults work on EURUSD and other pairs. The guide suggests Minimum pattern height percent of 0.1 to skip tiny patterns. On 1 hour a pattern spans about 1 to 6 days, which suits traders who check the chart a few times a day.
Index CFDs in the cash session
On NAS100 and similar, use 15 minutes and limit detection to the cash session with Detection session and its UTC offset, so overnight drift does not create patterns you would never trade.
Crypto around the clock
Bitcoin and other coins trade around the clock, so more patterns appear per day. 15 minutes to 1 hour is the starting point; raise Minimum quality or lower Error Rate percent if the chart gets crowded.
Swing trading on 4 hours and daily
On 4-hour and higher charts the supply and demand zones use the chart's own timeframe. Search 1x / 2x / 3x depth finds larger structures; leave it off on intraday charts to keep loading fast.
Every setting, with its default
The names are the ones in the script's Settings dialog in TradingView (Inputs tab); the defaults are what every chart on this page uses. Open a group to see its settings.
01 · الاكتشاف | Detection (20)
| Setting | Default | What it does |
|---|---|---|
| Minimum ZigZag Period | 8 | Bars for the rolling highest high / lowest low that end a zigzag leg (4-50). |
| D detection mode | Developing D (bar close) | Used only with Swing construction 'Confirmed pivots': test D at the bar close before the pivot is confirmed, or wait for the confirmed pivot. |
| Pivot confirmation bars | 2 | Right-side bars of a confirmed pivot (Confirmed pivots mode only, 1-20). |
| Search 1x / 2x / 3x depth | off | Also scan zigzags of 2x and 3x the period for larger patterns. |
| Search nested XABCD combinations | on | Allow skipped smaller waves inside a leg when they stay inside the leg's range. |
| Maximum candidate geometries per depth | 40 | Cap on the point combinations tested per update (1-81). |
| Error Rate % | 8 | Tolerance on every ratio band (1-20). |
| Minimum pattern bars | 20 | Shortest pattern span X to D (10-160). |
| Maximum pattern bars | 150 | Longest span (50-200); also the window in which a head must be the extreme. |
| Minimum pattern height % | 0 | Pattern height as % of price; 0 = no minimum. |
| Minimum C-D bars | 1 | Bars between C and D. |
| Direction | Both | Both, Long or Short patterns only. |
| Detection session | 0000-0000 | Detect only inside this session (24 h by default). |
| Session UTC offset | 0 | Time zone of the session, -12 to +14. |
| Maximum new patterns per bar | 2 | 1-3. |
| Maximum active patterns | 8 | Patterns pending, entered or past T1 at the same time (1-20). |
| Block same active pattern / direction | on | No second active pattern of the same family and direction. |
| Expire after bars from detection | 160 | An unfinished pattern expires after this many bars (1-2000). |
| Two-sided extreme bar | Both (continue, then reverse) | A bar that makes both the highest high and the lowest low: extend the leg then reverse, only continue, or only reverse. |
| Swing construction | Rolling extrema | Rolling extrema (at bar close, no waiting) or Confirmed pivots (ta.pivothigh / pivotlow). |
02 · عائلات الأنماط | Pattern families (12)
| Setting | Default | What it does |
|---|---|---|
| Gartley... Black Swan (11 switches) | on | Gartley, Butterfly, Bat, Crab, Alternate Bat, Deep Crab, Cypher, AB=CD, White Swan, Black Swan; Cypher minimum XC / XA 1.13 (or 1.272). |
| Shark... Anti-Nen Star (12 switches) | on | Shark, Nen Star, Leonardo, Partizan, 5-0, Anti-Gartley, Anti-Butterfly, Anti-Bat, Anti-Crab, Anti-Shark, Anti-Cypher, Anti-Nen Star. |
| 3-Drive, Double Top, Double Bottom, Head and Shoulders, Inverse Head and Shoulders, Ascending / Descending / Symmetrical Triangle | on | Classical formations and the 3-Drive, each on / off. |
| Classical symmetry tolerance % of height | 8 | How equal the two tops / bottoms and triangle flats must be (1-30). |
| H&S contained waves skipped per leg | 1 | Smaller waves allowed inside the neck-head legs (0-3). |
| H&S pivots allowed after the right shoulder | 1 | 0-3; the break bar usually adds one. |
| H&S shoulder difference % of head depth | 50 | Largest price difference between the shoulders. |
| Triangles from nested legs | off | Off: the four triangle points must be consecutive pivots. |
| Triangle minimum leg retracement | 0.618 | Minimum AB/XA and BC/AB of a triangle; 0 = off. |
| AB=CD time symmetry filter | on | Compare the CD leg's bars with the AB leg's bars. |
| AB=CD: CD may be shorter than AB by % | 20 | 0-100. |
| AB=CD: CD may be longer than AB by % | 50 | 0-200. |
03 · الدخول والأهداف | Entry and targets (9)
| Setting | Default | What it does |
|---|---|---|
| Level calculation basis | Standard (by family) | Standard (AD or CD leg by family), Standard (legacy) = same, CD for all, AD for XABCD. |
| Entry % of selected leg | 10 | Entry distance from D (0-99). |
| Target 1 % of selected leg | 40 | T1 distance from D. |
| Target 2 % of selected leg | 94 | T2 distance from D (Entry < T1 < T2 required). |
| Finish pattern at | Target 2 | Target 1 or Target 2. |
| Set targets by reward / risk | off | Targets as multiples of the initial risk instead. |
| Target 1 reward / risk | 1 | With the switch above. |
| Target 2 reward / risk | 2 | Must exceed Target 1. |
| Entry trigger | High / low touch | High / low touch, Close confirmation (close beyond Entry), Candle confirmation (engulfing or pin bar touching the zone, enters at its close). |
04 · الوقف والتحقق | Stop and validation (12)
| Setting | Default | What it does |
|---|---|---|
| Stop mode | Zone | Zone (validation zone edge), Manual %, Break even, Trailing. |
| Manual stop % of entry | 1 | Manual % mode. |
| Validation band padding % of CD | 0 | Widens the validation zone (0-25). |
| Break-even % from entry toward T1 | 0 | Break even mode: after T1 the stop moves to Entry + this % of the way to T1. |
| Trail after | Target 1 | Trailing mode starts at Entry or after T1. |
| Trail distance / entry-to-T1 | 1 | Trailing distance as a multiple of Entry-to-T1. |
| Pending invalidation source | Close | Close or High / low beyond the zone cancels a pending pattern. |
| Price must be lower/higher than Entry | off | Accept a new pattern only while price has not run past Entry. |
| Can be lower/higher % | 0 | Allowed overshoot for the switch above (0-5). |
| Validation line style | Dotted | Solid, Dashed, Dotted. |
| Confirmation close must remain in validation band | off | The detection bar must close inside the zone. |
| Stop trigger source | Close | Close (a closed bar at or beyond the stop) or High / low (a wick touch). |
05 · المظهر | Appearance (24)
| Setting | Default | What it does |
|---|---|---|
| Draw patterns | on | Legs, fills, letters, ratios and names. |
| Don't show XABCD labels | off | Hide the point letters. |
| Show Only Levels | off | Only the Entry / T1 / T2 / SL segments. |
| Show ratio measurements | on | Ratio numbers on the legs. |
| Draw entry / targets / stop | on | The trade-plan segments. |
| Show Pattern Validation Zones | on | The dotted bracket at D. |
| Shade patterns | on | Fill the two triangles. |
| Shading transparency | 70 | 0-100. |
| Pattern colors | Classic palette | Classic palette (10 colours, next free one) or Direction (bullish / bearish colour). |
| Pattern text size | normal | tiny, small, normal, large. |
| Internal measurement diagonals | on | Dotted A-C and X-D guides. |
| Level segment length | 6 | Bars (2-40). |
| Pattern color 1-10 | #2962ff, #F23645, #00E676, #787B86, #FF9800, #B2B5BE, #FDD835, #808000, #512da8, #4dd0e1 | The palette. |
| Bullish color / Bearish color | #22ab94 / #f7525f | Used in Direction mode. |
| Text color | white | Lifecycle counter text. |
| Pattern width | 2 | 1-4. |
| Pattern line style / Level line style | Solid / Solid | Solid, Dashed, Dotted. |
| Target 1 / Target 2 color | #4caf50 | T1 and T2 segments and labels (new input, colour rule). |
| Stop-loss color | #f23645 | SL segment and label (new input, colour rule). |
| Level projection bars | 12 | How far right of the current bar the segments end (1-100). |
| Show Only Active Patterns | off | Remove finished patterns at once. |
| Keep Last Pattern on the Chart | on | Keep the last finished pattern when none is active. |
| Maximum patterns drawn | 6 | Newest patterns with drawings (1-12). |
| Completed patterns retained (minimum) | 0 | 0-12. |
06 · التوقع | Projection (8)
| Setting | Default | What it does |
|---|---|---|
| Show nearest possible D zone | on | The forecast of a forming pattern. |
| Show Prediction => | Pattern&Label | Pattern&Label, Only Pattern, Only Label. |
| Families listed in the label (0 = all) | 4 | Nearest zones first. |
| Prediction for | Both | Both, Long, Short. |
| Predicted Line / Zone / Label / Text Color | #2962ff / blue 75 % / #2962ff / white | Forecast colours. |
| Prediction line width / style | 3 / Dotted | Width 1-4; Solid, Dashed, Dotted, None. |
| Draw prediction PRZ | on | The zone box. |
| Cypher forecast: prefer oldest valid X | on | Choice of X for a Cypher forecast. |
07 · اللوحات | Panels (7)
| Setting | Default | What it does |
|---|---|---|
| Show Active Patterns in the Panel | on | The panel. |
| Lifecycle counters (below the panel) | off | Found / Entry / T1 / T2 / Stops / Invalid / Expired counts. |
| Panel Size / Position / Align | small / top / center | tiny-large; bottom, middle, top; left, center, right. |
| Panel Long / Short / Reached | #4caf50 / #f23645 / #787b86 | Row colours. |
| Header / Header text / Border | #2962ff / white / white | Panel colours. |
| Detect from | 01 Jan 2021 00:00 | No detections before this date. |
| Extra columns: distance % and R:R | on | Dist %, R:R and Q columns. |
08 · التنبيهات | Alerts (5)
| Setting | Default | What it does |
|---|---|---|
| New pattern, Entry, Target 1, Target 2, Stop, Invalidation | on | alert messages per event. |
| Expiry | off | alert message on expiry. |
| Zone confluence, RSI divergence, Volume confirmation | on | alert messages for these marks. |
| Dynamic alert template | {ticker} | {tf} | {pattern} | {side} | {event} | Entry={entry} T1={t1} T2={t2} SL={sl} | Text of the alert messages; also {price} and {quality}. |
| Alert format | Text | Text, or the webhook format for trade automation tools. |
09 · العرض والطلب | Supply & Demand (14)
| Setting | Default | What it does |
|---|---|---|
| Show Supply | Demand zones | on | The zone module. |
| Zone timeframe | 240 | 4 hour; a timeframe below the chart's falls back to the chart timeframe. |
| Pivot Length | 4 | Bars on each side of a zone pivot (1-20). |
| Sensitivity | 6 | Higher = smaller displacement needed = more zones (1-10). |
| Displacement Window | 3 | Bars after the pivot to wait for the displacement close (0-20). |
| Width | 1 | Zone thickness (0.3-3.0). |
| Zones Offset | 250 | Bars the zones extend to the right. |
| Max Zones Per Side | 8 | 1-20. |
| Hide Invalidated Zones | on | Delete a zone after a close beyond it. |
| Supply Fill / Border, Demand Fill / Border | rgb(226,61,103) / rgb(38,166,91) | Zone colours. |
| Midline Style | Dashed | Dashed, Dotted, Solid. |
| Show Timeframe Label | on | '4H' label; Top / Right, size Normal. |
| Mark patterns inside a zone | on | star when the validation zone overlaps an aligned zone. |
| Confluence mark | star | The mark. |
10 · الأداء | Performance (6)
| Setting | Default | What it does |
|---|---|---|
| Show performance table | on | Per-family statistics table, bottom right (switched off for the screenshots). |
| Position / Align / Text size | bottom / right / tiny | Table placement. |
| Minimum entries to list / Maximum rows | 5 / 10 | Rows shown. |
| Deeper statistics (bars to T1, MAE, EV) | on | Three more columns. |
| Auto-disable below win % (0 = off) | 0 | Off by default. |
| Colours (Header, rows, grid) | #2962ff... | Table colours. |
11 · فلتر الاتجاه | Trend filter (4)
| Setting | Default | What it does |
|---|---|---|
| Filter | Off | Off, EMA, SMA: bullish patterns only above the average, bearish only below. |
| Length | 200 | Average length. |
| Plot the average | on | Draw it when the filter is on. |
| Color | #ff9800 | Average colour. |
12 · جودة النمط | Pattern quality (2)
| Setting | Default | What it does |
|---|---|---|
| Minimum quality (0 = off) | 0 | Reject new XABCD patterns below this fit score. |
| Show quality in the pattern name | on | The 0-100 number after the name. |
13 · دايفرجنس RSI | RSI divergence (2)
| Setting | Default | What it does |
|---|---|---|
| Mark RSI divergence at D | on | when D goes beyond B (or X) while RSI 14 does not. |
| Divergence mark | The mark. |
14 · تأكيد الحجم | Volume confirmation (4)
| Setting | Default | What it does |
|---|---|---|
| Mark volume spikes at D | on | when the D bar's volume >= multiplier x its 20-bar average. |
| Multiplier | 1.5 | From 1.0. |
| Volume mark | The mark. | |
| Require volume confirmation | off | Reject XABCD patterns without the spike. |

The alert events, one by one
In TradingView: Create alert, choose “Harmonic Pattern Lab [AlgoFXStore]” as the condition and pick the event. TradingView then notifies you the way you set in that dialog: a pop-up in TradingView, a sound, the TradingView app on your phone or an e-mail.
- BUY entry
- SELL entry
- New confirmed pattern
- Target 1
- Target 2
- Stop
- Invalidation
- Expiry
- New Supply Zone
- New Demand Zone
- Zone confluence
- Event message from the 'Dynamic alert template' (events: New pattern, Entry, Target 1, Target 2, Stop, Stop (entry bar ambiguity), Invalidated, Expired, RSI divergence, Volume confirmation, Demand / Supply zone confluence; each switchable in group 08)
- Alert format 'JSON (webhook)' (off): one machine-readable webhook message per event for trade automation tools
Harmonic Pattern Lab next to the usual options
Where it wins, and where it does not.
| Harmonic Pattern Lab | Typical free harmonic indicator | Reading it by hand | |
|---|---|---|---|
| Families | 22 harmonic families, the 3-Drive and seven classical patterns | Often a handful of the classic harmonics | Whatever you remember the ratios of |
| Ratio checks | Every XABCD combination of the newest 20 pivots, nested legs included | Usually the last zigzag points only | A few legs at a time with the Fibonacci tool |
| Trade plan | Entry, two targets and a stop from the validation zone, tracked on closed candles | Often a PRZ or a D point only | Your own levels |
| Context | 4-hour zones, RSI divergence and volume marks, fit score | Rarely | Extra tools and extra time |
| Learning curve | Fourteen input groups to understand | A few inputs | Only what you already know |
| Chart load | Heavier; candidate caps and the multi-depth search affect loading | Lighter | None |
| Cost | A one-time purchase | Free | Free, paid for in screen time |
Honest about who this fits
A good fit if you
- You trade harmonic patterns and want the ratios checked by fixed bands instead of by eye.
- You want classical patterns, the 3-Drive and supply and demand zones in the same tool as the harmonics.
- You want every pattern to come with an entry, two targets and a stop, and a clear rule for when it is invalid.
- You like to filter by fit score, trend, divergence, volume and zone confluence before taking a pattern.
- You are willing to spend time on the settings, which are many but grouped and documented.
Not for you if you
- You want a simple indicator with two or three inputs: this one has fourteen input groups.
- You want a system that places trades: it detects, draws and alerts, and the orders are yours.
- You want every pattern the history produced to stay on the chart: only the newest few keep their drawings.
- You need the projection of the next D to be a signal: it is display only and moves with every bar.
The full code, one manual, installed in two minutes
- 1Pine Script source codeHarmonic_Pattern_Lab_TradingView_Code.txt (142 KB): the full code. Paste it into the Pine Editor and it appears as “Harmonic Pattern Lab [AlgoFXStore]”.
- 16Page PDF manualInstallation, every setting with its default and how to read the chart.
- ✓Every main setting explainedThe table above lists the main settings with the defaults the charts use.
- ✓Alert eventsYou choose which ones are on in the settings.
- 60Day money-back guaranteeIf it is not for you, request a full refund within 60 days through your Digistore24 order e-mail.
Install in five steps
- Download the zip from the page Digistore24 sends you to after checkout and unzip it.
- Open Harmonic_Pattern_Lab_TradingView_Code.txt in a text editor, select all and copy the whole code.
- In TradingView, open the Pine Editor, paste the code over everything that is there and click Save.
- Click Add to chart: “Harmonic Pattern Lab [AlgoFXStore]” appears on your chart.
- Read the PDF manual; the defaults are the settings shown on this page.

Kestutis Balciunas
AlgoFXStore · chart indicators
Kestutis Balciunas builds and publishes chart indicators under the AlgoFXStore name. Every product page shows what the indicator draws on real charts, and every number on it comes from the shipped build.
The charts on this page were captured in TradingView from the shipped Harmonic Pattern Lab [AlgoFXStore] at its default settings and are shown unedited.
No get-rich claims and no quoted win rates. Every trade is uncertain, and no indicator changes that. If you want to know whether it suits the way you trade before you buy, e-mail [email protected] and you will get a straight answer.
One price, one payment
- The full Pine Script source code of Harmonic Pattern Lab and the 16-page PDF manual
- Delivered as a digital download: one zip with the code file and the PDF manual on your download page
- Return period: 60 days, with a full refund if it is not for you
- Free updates to the current version on the same download page
60-day money-back guarantee. Install it, run it on your own charts and read the manual. If Harmonic Pattern Lab is not for you within 60 days of purchase, request a full refund from Digistore24, no questions asked: use the refund link in your Digistore24 order e-mail or Digistore24's order page digistore24.com/en/cancel-revoke-contract. Digistore24 refunds to your original payment method. It is a digital download: right after checkout you land on your download page, and the link to it is also in your Digistore24 order e-mail.
About the patterns
Does Harmonic Pattern Lab repaint?
Patterns are detected, entered and finished only on closed candles, and a drawn pattern does not change. Three things move. With Rolling extrema a later candle can extend the last leg, so the drawn D is not always the final swing extreme, although the pattern stays frozen. The blue projection is recomputed on every bar. The level segments follow the chart's right edge. Supply and demand zones come from the previous closed 4-hour candle with lookahead off.
What does the number after the pattern name mean?
It is the fit score from 0 to 100: how closely the leg ratios match the family's bands. Each defining ratio scores fully inside the band and less outside it. It is not a probability of success, and you can use Minimum quality to hide patterns below a score you choose.
What do the star, divergence and lightning marks mean?
The star means the pattern's validation zone overlaps a matching supply or demand zone. The divergence mark means RSI 14 diverges at D, for example D below B while RSI is higher. The lightning mark means the D candle's volume is at least 1.5 times its 20-bar average.
Why do old patterns disappear?
Only the newest 6 patterns keep their drawings by default. Stopped, invalidated and expired patterns are removed at once, and patterns that reached their targets 160 bars after finishing. Raise Maximum patterns drawn, up to 12, to keep more on the chart.
Levels and tuning
How is the stop placed?
In the default Zone mode the stop sits at the far edge of the validation zone: the zone low for a long, the zone high for a short, at least one tick from the entry. For harmonics the zone is where the family's D band and the CD/BC extension band overlap. Manual percent, Break even and Trailing are the other modes.
The chart shows too many patterns. What should I change?
Lower Error Rate percent, raise Minimum quality, or switch off families you do not trade in the Pattern families group. To use only the harmonics, switch the classical families off there and the zones off in the Supply and Demand group.
I see no patterns. Why?
Scroll back for more history, since the first patterns need a few hundred bars. Then check Direction, Detection session, Detect from (1 January 2021 by default), Minimum quality and the family switches. The script also shows a message when inputs contradict each other, such as a minimum span above the maximum.
Why are the input names in two languages?
Every input label is written in English and Arabic, for example Detection with its Arabic name. The behaviour is the same; only the labels in the Settings dialog show both languages.
Alerts and performance
Which alerts can I create?
Eleven alert conditions by name: BUY entry, SELL entry, New confirmed pattern, Target 1, Target 2, Stop, Invalidation, Expiry, New Supply Zone, New Demand Zone and Zone confluence. For messages with prices choose Any alert() function call: they follow the Dynamic alert template with placeholders such as ticker, pattern, side, entry, targets and stop.
Can the alerts be sent as JSON?
Yes. Set Alert format to JSON (webhook) and each event is sent as one object with the symbol, timeframe, pattern, side, prices, fit score and marks, plus an optional id you choose. Webhook delivery needs a paid TradingView plan. The indicator itself never sends orders anywhere.
What is the performance table?
A per-family table of the patterns on the loaded history: entries, targets reached, stops and deeper averages such as bars to Target 1. It is on by default and sits bottom right. It is hindsight bookkeeping, resets on reload and is not a forecast; switch it off if you do not use it.
Does it slow the chart down?
It does a lot of work per bar. If loading feels slow, leave Search 1x / 2x / 3x depth off and keep Maximum candidate geometries per depth at 40, the default. It runs on TradingView's free plan; its only extra data is the same symbol's 4-hour chart.
How it works
Will it place trades for me?
No. Harmonic Pattern Lab is an indicator: it draws on the chart and can alert you. It never sends an order.
Which markets and timeframes does it work on?
Any symbol and timeframe: the rules are price ratios, so they scale to every market. The zigzag (8 bars), pattern span (20-150 bars) and expiry (160 bars) are counted in bars: on 15 minutes a pattern spans 5 hours to about 1.5 days, on 1 hour about 1 to 6 days. Day trading on 15 minute to 1 hour charts, swing trading on 4 hour and daily. The supply / demand zones come from the 4 hour chart; on 4 hour and higher charts they use the chart's own timeframe. Needs a few hundred bars before the first patterns. No session filter by default (0000-0000).
Do I need a paid TradingView plan?
No. It reads only the chart's own bars, so the free TradingView plan runs it. Alerts count against your plan's alert limit.
After you buy
How do I get it after paying?
Digistore24 runs the checkout. Right after payment it takes you to your download page with one zip holding the Pine Script source code file and the PDF guide; the link to that page is also in your Digistore24 order e-mail, so you can download again at any time.
How do I install it?
Open the code file, open the Pine Editor in TradingView, paste the whole code, click Save and then Add to chart: “Harmonic Pattern Lab [AlgoFXStore]” appears on your chart. The guide walks through it step by step.
Who is Digistore24?
Digistore24 is the reseller that sells Harmonic Pattern Lab for Kestutis Balciunas (AlgoFXStore): it runs the checkout, charges your card or PayPal, collects the VAT for your country and delivers the download. Its name is the one on your statement, and its order e-mail holds your download link and the refund link.
What is the refund policy?
A 60-day money-back guarantee, handled by Digistore24. If Harmonic Pattern Lab is not for you within 60 days of purchase, use the refund link in your Digistore24 order e-mail or Digistore24's order page (digistore24.com/en/cancel-revoke-contract) for a full refund, no questions asked. Digistore24 makes the refund to your original payment method.
Do I get the source code?
Yes. You get the full Pine Script source code as a text file for your own use; the licence line at the top of the code does not allow resale, sharing or republishing.
Harmonic Pattern Lab for TradingView.
Put every harmonic and classical pattern that fits its ratios on your chart with a plan attached, and choose the ones worth trading. The full code, the manual and every setting explained. Instant download for €47, one payment.
Get instant access