XABCD Harmonics Indicator for NinjaTrader 8
Created 20 Jun 2025
·
Updated 20 Jun 2025
The XABCD Harmonics indicator is a Premium Harmonic patterns auto-recognition indicator for the NinjaTrader 8 platform. Harmonic patterns profit from the natural order of the financial markets.
Prerequisites
To use this indicator you should have the following prerequisites available.
- NinjaTrader 8, with any license type. Click here to download
- An automated-trading.ch account with an active Premium Subscription
Description
The harmonic methodology utilizes the recognition of specific price patterns and the alignment of Fibonacci ratios to determine highly probable reversal points in the financial markets. This methodology assumes that trading patterns or cycles, like many patterns and cycles in life, repeat themselves. The key is to identify these patterns, and to enter or exit a position based upon a high degree of probability that the same historic price action will occur. Although these patterns are not 100% accurate, these situations have been historically proven. If these set-ups are identified correctly, it's possible to identify significant opportunities with a very limited risk.
Harmonics are 5-point patterns frequently referred to as XABCD patterns. The most well-known harmonic patterns are the Gartley, Bat, Crab, Butterfly, Shark, and Cypher patterns.
Those patterns are defined by swing points generally named X, A, B, C and D. These points define legs on which ratios can be calculated. For example, the AB/XA ratio is calculated by dividing the AB leg retracement by the XA price's initial move. When all of the legs respect a specific ratio rule set, those patterns are recognized.
Examples
These examples were hand-picked to show the best-case scenarios where the indicator detects valid patterns. In real-time trading, the patterns detected won't always lead to a winning trade, and you'll need to make decisions on whether to enter or skip a trade. These examples are all taken on the MES instrument on the 1-minute timeframe.
Gartley Pattern
The indicator allows setting a ratio tolerance in percentage to fine-tune the sensitivity of ratio detection. A higher tolerance value allows a higher number of detected patterns; a lower ratio tolerance results in fewer patterns detected.
The indicator also draws a horizontal ratio spanning the XB leg or the BD leg — this is the Time ratio, calculating the time ratio between the pattern's two halves (from the start point to point X, and from point B to point D). The ideal value of this ratio is 0.5 (50%), meaning the pattern is perfectly symmetrical.
Bat Pattern
For an entry on a Bat pattern, one can wait for a red-candle confirmation after the pattern forms, and target point A or point C.
Crab Pattern
For an entry on a Crab pattern, one can wait for a green-candle confirmation after the pattern forms, and target point A or point C. The indicator can also recognize and print two overlapping patterns sharing the same X, A, B and C swing points but with different D points — a valid occurrence that, in live trading, can be seen as a confirmation signal for the first pattern.
Butterfly Pattern
For an entry on a Butterfly pattern, one can wait for a red-candle confirmation after the pattern forms, and target point A or point C. The Butterfly is the least effective pattern because it ends with price action opposite to the wanted trade direction — be careful with it.
Shark Pattern
For an entry on a bullish Shark pattern, one can wait for a red-candle confirmation after the pattern forms, and target point A or point C.
Cypher Pattern
The Cypher pattern follows the same recognition logic as the other harmonic patterns above.
Parameters
We always try to keep the parameters to a minimum.
| General | |
| Swing Period | Swings are higher lows, higher highs, lower highs and lower lows. After each price bar closes, a swing can take place, but the next bar (or the one after, etc.) can cancel it by creating a new swing of the same type. The swing period sets how many bars are enough to separate two swings of the same type — increasing this parameter decreases the overall number of swings (and produces wider, bigger patterns); decreasing it increases the number of swings (and produces condensed patterns). |
| Show Price Swings | Controls showing/hiding the swing points. |
| Swings Bullish Color / Swings Bearish Color | Sets the color of bullish/bearish swings, when shown. |
| Swings Opacity (1-100) | Sets the opacity used to draw the swing markers. |
| Show Ratios | Enables drawing ratio lines between the pattern legs with a dashed line and drawing the ratio number on it. |
| Show Patterns Names | Enables drawing the pattern name. |
| Font Size | Sets the font size. |
| Show Gartley / Show Bat / Show Crab / Show Butterfly / Show Shark / Show Cypher | Enable/disable drawing each of these pattern types. |
| Per-Pattern Settings (Gartley, Bat, Crab, Butterfly, Shark, Cypher) | |
| Bullish Color / Bearish Color | Sets the color used to draw bullish/bearish instances of that pattern on the chart. |
| Ratio Tolerance % | Sets the tolerance, in percentage, on that pattern's leg ratio rules. For example, a 10% tolerance on a leg ratio that should be around 0.368 allows the actual leg ratio to fall between 0.368 - 10% and 0.368 + 10%. |
| Sound Alert | |
| Play Sound Alert | Enables playing an alert sound when a pattern is detected. |
| Play Sound File | Sets the file name to be played on sound alert — any .wav file on your computer. |
Download & Installation Instructions
License Requirements
At automated-trading.ch you can choose to either purchase a monthly subscription to use our premium products, or use our free products without subscribing.
In both cases, you need to create an account so you can get a License you can use for both premium and free products.
To obtain your license, simply sign up and then get your license on the billing page.
Download
You can also download this strategy — and every other automated-trading.ch strategy or indicator — anytime from your centralized Downloads page.
Installation Steps
Frequently Asked Questions
General
Release Notes
- First Release of the indicator