PINE LIBRARY

Harmonic Patterns Library [TradingFinder]

Updated
🔵Introduction

Harmonic patterns blend geometric shapes with Fibonacci numbers, making these numbers fundamental to understanding the patterns.

One person who has done a lot of research on harmonic patterns is Scott Carney.Scott Carney's research on harmonic patterns in technical analysis focuses on precise price structures based on Fibonacci ratios to identify market reversals.

Key patterns include the Gartley, Bat, Butterfly, and Crab, each with specific alignment criteria. These patterns help traders anticipate potential market turning points and make informed trading decisions, enhancing the predictability of technical analysis.


🟣Understanding 5-Point Harmonic Patterns

In the current library version, you can easily draw and customize most XABCD patterns. These patterns often form M or W shapes, or a combination of both. By calculating the Fibonacci ratios between key points, you can estimate potential price movements.

All five-point patterns share a similar structure, differing only in line lengths and Fibonacci ratios. Learning one pattern simplifies understanding others.


snapshot


🟣Exploring the Gartley Pattern

The Gartley pattern appears in both bullish (M shape) and bearish (W shape) forms. In the bullish Gartley, point X is below point D, and point A surpasses point C. Point D marks the start of a strong upward trend, making it an optimal point to place a buy order.

The bearish Gartley mirrors the bullish pattern with inverted Fibonacci ratios. In this scenario, point D indicates the start of a significant price drop. Traders can place sell orders at this point and buy at lower prices for profit in two-way markets.


🟣Analyzing the Butterfly Pattern

The Butterfly pattern also manifests in bullish (M shape) and bearish (W shape) forms. It resembles the Gartley pattern but with point D lower than point X in the bullish version.

The Butterfly pattern involves deeper price corrections than the Gartley, leading to more significant price fluctuations. Point D in the bullish Butterfly indicates the beginning of a sharp price rise, making it an entry point for buy orders.

The bearish Butterfly has inverted Fibonacci ratios, with point D marking the start of a sharp price decline, ideal for sell orders followed by buying at lower prices in two-way markets.


🟣Insights into the Bat Pattern

The Bat pattern, appearing in bullish (M shape) and bearish (W shape) forms, is one of the most precise harmonic patterns. It closely resembles the Butterfly and Gartley patterns, differing mainly in Fibonacci levels.

The bearish Bat pattern shares the Fibonacci ratios with the bullish Bat, with an inverted structure. Point D in the bearish Bat marks the start of a significant price drop, suitable for sell orders followed by buying at lower prices for profit.


🟣The Crab Pattern Explained

The Crab pattern, found in both bullish (M shape) and bearish (W shape) forms, is highly favored by analysts. Discovered in 2000, the Crab pattern features a larger final wave correction compared to other harmonic patterns.

The bearish Crab shares Fibonacci ratios with the bullish version but in an inverted form. Point D in the bearish Crab signifies the start of a sharp price decline, making it an ideal point for sell orders followed by buying at lower prices for profitable trades.


🟣Understanding the Shark Pattern

The Shark pattern appears in bullish (M shape) and bearish (W shape) forms. It differs from previous patterns as point C in the bullish Shark surpasses point A, with unique level measurements.

The bearish Shark pattern mirrors the Fibonacci ratios of the bullish Shark but is inverted. Point D in the bearish Shark indicates the start of a sharp price drop, ideal for placing sell orders and buying at lower prices to capitalize on the pattern.


🟣The Cypher Pattern Overview

The Cypher pattern is another that appears in both bullish (M shape) and bearish (W shape) forms. It resembles the Shark pattern, with point C in the bullish Cypher extending beyond point A, and point D forming within the XA line.

The bearish Cypher shares the Fibonacci ratios with the bullish Cypher but in an inverted structure. Point D in the bearish Cypher marks the start of a significant price drop, perfect for sell orders followed by buying at lower prices.


🟣Introducing the Nen-Star Pattern

The Nen-Star pattern appears in both bullish (M shape) and bearish (W shape) forms. In the bullish Nen-Star, point C extends beyond point A, and point D, the final point, forms outside the XA line, making CD the longest wave.

The bearish Nen-Star has inverted Fibonacci ratios, with point D indicating the start of a significant price drop. Traders can place sell orders at point D and buy at lower prices to profit from this pattern in two-way markets.


The 5-point harmonic patterns, commonly referred to as XABCD patterns, are specific geometric price structures identified in financial markets. These patterns are used by traders to predict potential price movements based on historical price data and Fibonacci retracement levels.

Here are the main 5-point harmonic patterns:
  • Gartley Pattern
  • Anti-Gartley Pattern
  • Bat Pattern
  • Anti-Bat Pattern
  • Alternate Bat Pattern
  • Butterfly Pattern
  • Anti-Butterfly Pattern
  • Crab Pattern
  • Anti-Crab Pattern
  • Deep Crab Pattern
  • Shark Pattern
  • Anti- Shark Pattern
  • Anti Alternate Shark Pattern
  • Cypher Pattern
  • Anti-Cypher Pattern



🔵How to Use

To add "Order Block Refiner Library", you must first add the following code to your script.




🟣Parameters




🟣Genaral Parameters

Name: The name of the pattern.
Type: Enter "Bullish" to draw a Bullish pattern and "Bearish" to draw an Bearish pattern.
Show: Enter "true" to display the template and "false" to not display the template.
Color: Enter the desired color to draw the pattern in this parameter.
LineWidth: You can enter the number 1 or numbers higher than one to adjust the thickness of the drawing lines. This number must be an integer and increases with increasing thickness.
LabelSize: You can adjust the size of the labels by using the "size.auto", "size.tiny", "size.smal", "size.normal", "size.large" or "size.huge" entries.

🟣Logical Parameters

ShVF: If this parameter is on "true" mode, only patterns will be displayed that they have exact format and no noise can be seen in them. If "false" is, the patterns displayed that maybe are noisy and do not exactly correspond to the original pattern.


snapshot


FLPC: if Turned on, you can see this ability of patterns when their last pivot is formed. If this feature is off, it will see the patterns as soon as they are formed. The advantage of this option being clear is less formation of fielded patterns, and it is accompanied by the lateest pattern seeing and a sharp reduction in reward to risk.

FLPCPeriod: Using this parameter you can determine that the last pivot is based on Pivot period.


snapshot


Pivot: You need to determine the period of the zigzag indicator. This factor is the most important parameter in pattern recognition.

ABXAmin: Minimum retracement of "AB" line compared to "XA" line.
ABXAmax: Maximum retracement of "AB" line compared to "XA" line.
BCABmin: Minimum retracement of "BC" line compared to "AB" line.
BCABmax: Maximum retracement of "BC" line compared to "AB" line.
CDBCmin: Minimum retracement of "CD" line compared to "BC" line.
CDBCmax: Maximum retracement of "CD" line compared to "BC" line.
CDXAmin: Minimum retracement of "CD" line compared to "XA" line.
CDXAmax: Maximum retracement of "CD" line compared to "XA" line.


snapshot


snapshot

🟣Function Outputs

This library has two outputs. The first output is related to the alert of the formation of a new pattern. And the second output is related to the formation of the candlestick pattern and you can draw it using the "plotshape" tool.

Candle Confirmation Logic:

snapshot


Example:



Release Notes
🚀New Update
v2

Added patterns "0XABCD", "ABCD" and "THREE DRIVE"

The general parameters are the same as the pattern "XABCD" and the difference in Ratios is explained in the images.

By using new functions, the ability to identify patterns "0-5 Harmonic Pattern", "ABCD Harmonic Pattern" and "Three Drive Harmonic Pattern" was added to the library.


0-5 Harmonic Pattern (0XABCD Pattern)





snapshot



ABCD Harmonic Pattern





snapshot


Three Drive Harmonic Pattern





snapshot
alertalertsformattingharmonicpattrenharmonicsignalsharmonictradeharmonictradersharmonicwavesstatisticstradingfinderZigzagzigzagpattern

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.


Get Access to TradingFinder indicators and Education for FREE: tradingFinder.com/

Forex, Crypto, Stocks, Futures & Index informational materials and Trading Tools in Turkish language: tradingFinder.com/tr/
Also on:

Disclaimer