Harmonic Patterns: XABCD Ratios and How to Draw Them in MT5
Harmonic patterns are five-point XABCD price structures whose swing lengths are measured with Fibonacci ratios. Traders use them to label a chart and mark a potential reversal zone. They are subjective drawings rather than forecasts: the ratio rules are commonly cited, not proven, and no pattern can promise a particular move.
Trading forex and CFDs involves substantial risk of loss. Automation applies rules; it does not remove trading risk. Read our risk disclosure.
Key takeaways
- Harmonic patterns are XABCD swing structures measured with Fibonacci ratios, such as the Gartley and Bat.
- The ratio rules are commonly cited, and authors disagree on tolerances, so state the definition you use.
- In MT5, the Trendline and Fibonacci Retracement objects help you measure each leg, but you still choose the swing points.
- The potential reversal zone is a context area with a defined invalidation level, not a signal.
- Pattern labels are subjective and easy to see in hindsight, so record occurrences before the outcome is known and test the rule on demo.
What harmonic patterns are
Harmonic patterns are price structures built from five swing points, labelled X, A, B, C and D. The XA leg is the first swing, and later points are measured against it or against the leg before. In a bullish structure, X, B and D are swing lows and A and C are swing highs. A bearish structure is the mirror image.
Named families such as Gartley, Bat, Butterfly and Crab differ mainly in the ratios that define B and D. Each family is a set of rules written by an author. None of them is a law of markets.
Commonly cited ratio rules
| Pattern | B point (of XA) | D point (of XA) | Where D sits |
|---|---|---|---|
| Gartley | ≈ 0.618 | ≈ 0.786 | Inside XA |
| Bat | 0.382–0.50 | ≈ 0.886 | Inside XA |
| Butterfly | ≈ 0.786 | 1.27–1.618 | Beyond X (extension) |
| Crab | 0.382–0.618 | ≈ 1.618 | Beyond X (extension) |
XA = |A − X|Bullish: B = A − ratio × XABearish: B = A + ratio × XAExample (illustrative round numbers, bullish structure): X = 100.00 and A = 120.00, so XA = 20.00. B at 0.618 of XA is 120.00 − 12.36 = 107.64. D at 0.786 of XA is 120.00 − 15.72 = 104.28. This is arithmetic that shows where a rule points. It says nothing about what price will do.
Published guides also add rules for the C point and for tolerance bands around each ratio. Check the source you use, because the same pattern name can carry different numbers.
How to draw XABCD in MT5
- Open the chart on the timeframe you are analysing and mark the swing points X, A, B, C and D. Write the prices down before you look for a pattern name.
- Use Insert → Objects → Lines → Trendline to join X, A, B, C and D into a zigzag, so that each leg is visible.
- Use Insert → Objects → Fibonacci → Fibonacci Retracement across the XA leg: click X first, then A. Its default levels include 61.8%, the usual B level for a Gartley. In the worked example below, the 61.8% level should read 107.64. If it reads 112.36, the anchors are reversed, so delete the object and redraw it.
- Open the object’s properties, go to the Levels tab and add 78.6% or any other level you need. Enter (%$) in the Description field to show the price at each level.
- Read each level against the prices you wrote in step 1, rather than relying on the chart labels alone.
The default Fibonacci Retracement levels are 0, 23.6, 38.2, 50, 61.8, 100, 161.8, 261.8 and 423.6 percent. 78.6% is not among them, which is why the Levels tab matters. Menu names and item order can vary by MT5 build. See the Fibonacci Retracement help page and the Lines help page.
The potential reversal zone and invalidation
Traders call the area around D the potential reversal zone (PRZ). It is usually drawn where the D ratio and any other projections you use fall close together. Treat it as a place to watch and take notes, not as an entry signal.
Set the invalidation level before you look at price. A common choice is a level beyond X, where a move would break the structure you measured. The level and the rule for acting on it are your decisions, and they should be written down in advance.
Why harmonic patterns are subjective
- More than one set of swings is valid on the same chart. The points you label depend on the swing size you choose.
- Ratio rules come with tolerance bands, and the width of a band is a choice. A wide band can make many pullbacks fit one name.
- Hindsight is the main trap. A structure is easiest to see once D has already printed, so mark the points before the outcome is known.
- Repainting is a risk with custom indicators. An indicator that redraws past swings can show a pattern that was not visible in real time.
None of this makes the ratios useless as a way to organise a chart. It means a pattern label describes what you saw. It is not evidence of what happens next.
Testing a harmonic rule
- Write the rule in plain terms: the swing definition, the ratio bands, the PRZ definition and the invalidation level.
- Record every occurrence before you know the result, including the ones you would have skipped.
- Test the rule as code or as a fixed procedure in the Strategy Tester, using real ticks where your data allows.
- Forward test on a demo account, and keep a trading journal of entries, exits and any rule breaks.
A backtest or a demo result is not proof of live results. For what the evidence can and cannot show, read how to verify a trading bot.
Tools and automation
The MT5 help describes trend line and Fibonacci objects. It does not describe an XABCD pattern object, so any automatic labelling comes from a custom indicator. Use only indicators you wrote, bought or licensed, and read what each one measures. For installing and comparing indicators, see MT5 indicators. For how automated rules are structured, see trading bot algorithms.
Frequently asked questions
Do harmonic patterns predict price moves?
No. A harmonic pattern is a label for a set of swing points and ratios measured on past price. Many random swings can meet the same ratios, and a completed pattern has no promised outcome. Use the label to organise a chart and define your risk, not to forecast.
What is the difference between a Gartley and a Bat?
Both are XABCD structures, but the ratios differ. The Gartley’s B is commonly cited near 0.618 of XA and its D near 0.786, while the Bat’s B sits shallower, between 0.382 and 0.50, with D near 0.886. Authors vary, so the definition you use matters more than the name.
Does MT5 draw harmonic patterns automatically?
The MT5 help describes trend line and Fibonacci objects, and it does not list an XABCD pattern object. Any automatic labelling you see comes from a custom indicator. Check what it measures, whether it redraws past swings, and that you wrote, bought or licensed it.
Is a harmonic pattern the same as a golden pocket?
No. A golden pocket is a single retracement band, usually 0.618 to 0.65, on one swing. A harmonic pattern uses five points and several ratios that define B and D. For the single-zone idea, read the golden pocket guide.
Do I need an Expert Advisor to trade harmonic patterns?
No. You can mark and review patterns by hand, which is the usual way to learn the ratios. If you automate a rule, use an Expert Advisor you wrote, bought or licensed, and test it before any live use.
How should I test a harmonic rule?
Write the swing definition, ratio bands and invalidation level before testing. Record every occurrence, including the ones you would have skipped, then test in the Strategy Tester and on a demo account. A backtest is still not proof of live results.
Keep reading
- Golden pocket explained
- MT5 indicators: install and compare
- Trading bot algorithms
- Expert advisor tester
- How to verify a trading bot
Sources: Fibonacci Retracement - Fibonacci Tools - Analytical Objects - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help · Lines - Analytical Objects - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
Trading forex and CFDs involves substantial risk of loss. Past performance and backtests do not guarantee future results. Read our risk disclosure before you trade.