LightningChartAn Introduction to XABCD Pattern

ArticleReviewing XABCD Pattern, applications, types, ratios and trading chart library.

Written by a human | Updated on April 22nd, 2025

Introduction to XABCD Pattern (Harmonic Pattern)

XABCD Pattern, also known as Harmonic Pattern, is a trading drawing tool originally created by Harold McKinley Gartley. It is designed to highlight various patterns on the chart. These patterns consist of five separate points (XABCD) and four lines drawn between them. The four lines, also called legs, are named XA, AB, BC, and CD.

The five points can be freely added to anywhere on a trading chart, but most commonly they are placed to mark significant, alternating high and low prices. Respectively, the four legs mark noteworthy trends of price movement.

XABCD-Harmonic-Pattern

An XABCD Pattern drawn in LightningChart

XABCD Pattern Types

There are four main types of XABCD Pattern: Gartley, Butterfly, Crab, and Bat. The pattern type is based on percentage ratios between various legs. For example, in the Gartley Pattern, the price movement between points A and B should be 61.8% of the price movement between points X and A.

Each pattern can also be either bullish (prices are expected to rise) or bearish (prices are expected to fall). This is determined by the direction of the first leg between X and A points. If the price rises from X to A, the pattern is bullish and resembles the letter M. A Falling price marks a bearish pattern which resembles the letter W.

Pattern
AB/XA ratio
BC/AB ratio
CD/BC ratio
CD/XA ratio
Pattern
Gartley
AB/XA ratio
61.8%
BC/AB ratio
38.2% or 88.6%
CD/BC ratio
127.2% or 161.8%
CD/XA ratio
78.6%
Pattern
Butterfly
AB/XA ratio
78.6%
BC/AB ratio
38.2% or 88.6%
CD/BC ratio
161.8% or 261.8%
CD/XA ratio
127% or 161.2%
Pattern
Crab
AB/XA ratio
38.2% or 61.8%
BC/AB ratio
38.2% or 88.6%
CD/BC ratio
224% or 361.8%
CD/XA ratio
161.8%
Pattern
Bat
AB/XA ratio
38.2% or 50%
BC/AB ratio
38.2% or 88.6%
CD/BC ratio
161.8% or 261.8%
CD/XA ratio
88.6%

The ratios in the above table are for the so-called “perfect” patterns. In the real market, finding patterns following these exact ratios is rare. Therefore, the ratios can vary quite a lot.

Gatterly-Pattern-and-Crab-Pattern

Gartley Pattern on the left, Crab pattern on the right. Both are not perfect patterns, as the ratios are only close to optimal.

The percentages themselves come from Fibonacci numbers and the golden ratio. In the Fibonacci sequence, each number is the sum of two previous numbers. When a number in the sequence is divided by the previous number, the result will be approximately the golden ratio of 1.618 (or 0.618 inversed).

This is true especially when the numbers get bigger. In trading, values of 38.2%, 50%, and 61.2% are most common. Multiples like 78.6% and 161.8% are also often used. As a result, the XABCD Pattern is commonly combined with Fibonacci drawing tools such as retracements or time measurements.

Interpretation and Application of XABCD Patterns

XABCD Patterns can be used to detect buy and sell signals. In general, the last point of the pattern, D, can be considered as a time to buy or sell depending on whether the pattern is bullish or bearish. In bullish patterns, one can expect the prices to rise after point D, while in bearish patterns the prices are likely to fall at that point.

Bearish-XABCD-Pattern

A bearish XABCD Pattern. Prices fall significantly after the pattern. Therefore, point D would have been a good time to sell.

It is possible to use the XABCD Pattern to predict where point D could lie in the future. In this case, the last point or points of the pattern are drawn based not on the actual data but on the Fibonacci ratios. When the price then reaches point D, one should consider selling or buying.

Bullish-Bat-Pattern

A bullish Bat pattern predicting a point to buy.

It should be noted that XABCD Pattern, similarly to other Fibonacci based tools, is based on human emotions and beliefs. Therefore, there is always room for error. What happened in the past does not guarantee similar results in the future.

LightningChart JS Trader

XABCD Patterns are available as a built-in feature in the new LightningChart JS Trader. The LightningChart JS Trader is a revolutionary Technical Analysis chart library that can be integrated into JavaScript-based software applications.

LightningChart JS Trader arrives as the best trading charts solution for developing financial and stock trading applications that require sufficient processing power to run even microsecond-level stock price monitoring.

This is a technical analysis chart library that runs only at the fastest and highest performance powered by its parent library LightningChart JS. Technical indicators such as the XABCD Pattern are included in the LightningChart JS Trader but the list is vast featuring more than 100 technical indicators of types such as:

  1. Envelopes
  2. Moving Averages
  3. Oscillators for Money Flow
  4. Oscillators for Price
  5. Statistics
  6. Trend Indicators
  7. Volatility and a lot more

LightningChart JS Trader comes also with built-in drawing tools, several UI themes for customization, compare symbols, and a full library of compatible 2D and 3D charts.

Conclusion

This article was a starting point for understanding basic concepts related to the XABCD pattern, its use in financial markets, and the different types of XABCD Patterns.

Additionally, we reviewed some standard ratio parameters and what a bullish pattern and bearish pattern mean. With the help of LightningChart JS Trader, we could also visualize the Gartley and Crab XABCD Patterns with close-to-optimal ratios.

I also mentioned the goal of XABCD Patterns for interpreting buying and selling signals. Moreover, we also reviewed how the XABCD Pattern could predict a point (“D”) and estimate a buying or selling moment.

I really hope you found this article useful. See you in the next article!

Lasse Portin Senior Developer

Lasse Portin

Senior Developer

LinkedIn icon
divider-light

Continue learning with LightningChart

Global Temperature Trends

Global Temperature Trends

Discover the insights behind global temperature trends through effective visualizations using LightningChart Python for climate data analysis.

Disease Symptom Data Visualization

Disease Symptom Data Visualization

Explore effective techniques for displaying complex health trends through disease symptom data visualization using LightningChart Python.