What is Harmonic Patterns?
Harmonic Patterns looks at the last few swing pivots and tests whether the legs between them fit the Fibonacci ratios of a known pattern. The XABCD harmonics use five pivots, and the D point is the potential reversal zone, the place the pattern says price may turn.
It carries two detectors in one script, both on by default. Harmonics finds the Gartley, Bat, Butterfly and Crab, each with its own toggle. ABCD finds the four-point measured move, where the second impulse is close in length to the first. Matches are drawn as an outline through the pivots with a label and a marker.
This is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and its code is not published.
Components
Harmonic Patterns combines 2 tools in one script. Each one has its own switch in the settings.
- Harmonics. The XABCD patterns Gartley, Bat, Butterfly and Crab, each with its own toggle, with D as the potential reversal zone.
- ABCD. The ABCD measured move, where BC retraces AB, CD extends BC, and AB and CD are close in length.
How to use Harmonic Patterns
- D as the reversal zone. A bullish pattern completes at a low D and a bearish one at a high D. Traders watch D for price to turn in the pattern's direction.
- Which harmonic. Gartley, Bat, Butterfly and Crab differ in how deep the legs retrace and extend. The label names the pattern that matched.
- ABCD symmetry. In an ABCD the legs AB and CD should be close in length. The symmetry is the core of the pattern.
- A pattern that fails. Price running well beyond D without turning is the pattern failing. The script does not mark that for you.
Settings
Components
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Show Harmonics | On | XABCD patterns: Gartley, Bat, Butterfly and Crab. | |
| Show ABCD | On | ABCD measured move: BC retraces AB, CD extends BC, AB and CD close in length. |
Structure
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Swing Length | 5 | 2 to 50 | |
| Swing Filter (ATR) | 0 | 0 to 5 |
Harmonics
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Harmonic Ratio Tolerance | 0.08 | 0.01 to 0.3 | Tolerance around each target ratio. |
| Harmonic Show Gartley | On | ||
| Harmonic Show Bat | On | ||
| Harmonic Show Butterfly | On | ||
| Harmonic Show Crab | On |
ABCD
| Setting | Default | Range | What it changes |
|---|---|---|---|
| ABCD Retracement Low | 0.382 | 0.1 to 0.9 | Minimum BC/AB retracement. |
| ABCD Retracement High | 0.886 | 0.3 to 1 | Maximum BC/AB retracement. |
| ABCD Extension Low | 1.13 | 0.8 to 2 | Minimum CD/BC extension. |
| ABCD Extension High | 1.618 | 1 to 3 | Maximum CD/BC extension. |
| ABCD Symmetry Tolerance | 0.3 | 0.05 to 0.8 | How close AB and CD lengths must be (ratio). |
Display
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Show Outline | On | ||
| Max Patterns | 10 | 1 to 50 | Per component: each keeps at most this many on the chart. |
| Show State Pane | Off | A sub-pane per component that is on, counting the patterns it has matched. |
Colours
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Bullish | #089981 | ||
| Bearish | #f23645 | ||
| Label | #b0b3b8 |
Alerts: harmonic_bullish, harmonic_bearish, abcd_bullish, abcd_bearish.
How it works
The script keeps a list of confirmed swing pivots that alternate between highs and lows. When a newer pivot on the same side as the last one is more extreme, it replaces it. The last five pivots are tested against each harmonic's textbook ratio bands, with a tolerance you can set, and the last four against the ABCD rules.
The test is repeated on every confirmed bar while the latest pivots stand, so a pattern can be drawn again while its points are unchanged. Its alert fires only once per set of pivots. If D is replaced by a more extreme pivot, that is a new pattern and it alerts again.
Max Patterns keeps the most recent ten matches per detector on the chart.
Limitations
- Confirmation lag. D has to be a confirmed swing, so a pattern appears Swing Length bars after D formed.
- Harmonics are rare. The ratio bands are strict. On some markets and timeframes the default settings find no harmonic at all for long stretches. Widening the tolerance finds more, at the cost of looser matches.
- D can move. If price pushes beyond D before turning, the more extreme pivot replaces D and a new pattern may be drawn.
- Ratios are not reasons. A good fit to the ratios says the swings have a familiar shape, not that price must reverse at D.
- It is not a strategy. There is no stop or target attached to a match.
Get Harmonic Patterns
Premium scripts are a one-time purchase in the Altrady marketplace and need a paid Altrady plan to run.
- Harmonic Patterns $12 This script on its own.
- Patterns & Confluence bundle $29 5 premium scripts, Harmonic Patterns included.
- Altrady Complete Suite $109 All 36 premium scripts.
Frequently asked questions
The Gartley, Bat, Butterfly and Crab XABCD harmonics, and the four-point ABCD measured move. Each harmonic can be switched off on its own.
Harmonic patterns need several legs to fit narrow ratio bands, so they are rare. Try a longer history, another timeframe, or a wider Harmonic Ratio Tolerance.
Patterns are drawn from confirmed pivots. While the latest pivots stand, a match can be drawn again under a new id, and if D is replaced by a more extreme swing a new pattern is drawn. The alert fires once per set of pivots.
Four. harmonic_bullish and harmonic_bearish name the matched harmonic in their message, and abcd_bullish and abcd_bearish fire for the ABCD.
Yes. Harmonic Patterns is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and the code is never shared. You buy it once in the Altrady marketplace, on its own, in the Patterns & Confluence bundle or in the Altrady Complete Suite, and it needs a paid Altrady plan to run. It is also included with your first annual Premium subscription.
Use the Get it in Altrady button on this page to open its listing in the Altrady marketplace. Once it is in your account, open the indicator picker on any chart in Altrady Charts and add Harmonic Patterns like any other indicator. Its settings are in the indicator's settings panel.