Harmonic Predictor

The concept of harmonic patterns was introduced in H.M. Gartley's book "Profits in the Stock Market" around 1935. Gartley formation was based on XABCD framework with particular values from Fibonacci values set. With only XABCD frame and Fibonacci values we have over 4 000 atomic combinations. Gartley formation is composed from two atomic combinations. Since then, numerous other combinations have been proposed and can be found on various internet sources. Our objective is not only to utilize known combinations, but also to develop a methodology for identifying combinations that best fit the price changes of a particular financial instrument.

The Harmonic Predictor is predicting XABCD formations based on XABC chart patterns and simulate trading with price move between points C and D. It's the second way of using harmonic patterns in trading. The script calculates ideal efficiency by entering a position at the C point and exiting either on the stop loss or point D - the take profit value.

Furthermore, you can enable the "relaxed formations" feature to search for generalized variants of the patterns.

This script can be used by any user. There is no need to have a PRO or PREMIUM account.

Harmonic Predictor is just one component of larger "Harmonic" package, which is designed to simplify the use of the ideas proposed by Gartley and to customize them for various financial instruments.
The Harmonic package includes:
⠀⠀Harmonic Scanner - A classic harmonic patterns detector that checks efficiency by entering in D point and trading move to the take profit value.
⠀⠀Harmonic Predictor - A harmonic pattern detector that checks efficiency by entering at the C point and trading the move to the D point.
⠀⠀Harmonic Scanner TakeProfitMap - A supporting script for scanner, that tracks highest potencial profits from historical transactions to better determine the appropriate take profit values for a given financial instrument.
⠀⠀More components is under developement...

If you prefer a video explanation, please refer to the "HowTo: Harmonic Idea" video.

Script with limited access, contact author to get authorization

Script settings:
Extreme area - Specifies the range in which low/high need to be the lowest/highest bar to be counted as XABCD point.
XA limit - Specifies the maximum distance between successive points in XABCD formation pattern.
Inaccuracy ‰ - It determines the maximum deviation from the conditions that must be met by the pattern. Larger value will produce more duplicates.
Relaxed formations - Formations marked with * will be relaxed on CBD retracement.
List of formations, each letter enables specific formation.

Visualization section with independent settings for the folowing groups:
- Estimated formations ( high or low are still unconfirmed but their confirmation will add new potencial formation),
- Potencial (formations tracked for statistics)
- Existing
For each group of formations following settings can be customized:
- Color used for drawing formation shape
- Checkbox for enabling/disabling shape visualization
- Checkbox for enabling/disabling target visualization
- Picker for selecting the label type
⠀⠀- h(ide)
⠀⠀- s - Labels with small font
⠀⠀- S - Labels with normal font

StopLoss - Displays stoploss value for potencial and Estiamted formations.
Hide not precised D - It is expected that the price will change direction in D points, but for some potencial formations price is reaching D point area and continue in the same direction. With this option, you can hide these formations.
Transparency settings - Adjust the transparency of formation shapes and targets.

Statistics - Picker for statistics table type:
H(ide) - Hides the statistics table.
P(ositions) - Shows a list of positions with their corresponding stop loss and take profit values. Take profit values that have been reached are highlighted.
% - Displays the efficiency of formations, split by take profit values.
%W - Displays the efficiency of formations, split by take profit values and weighted by formation size.

Position filter - A filter that works with the P(ositions) statistics.

In case of any problems, please send error details to the author of the script.

To get access or report problem write on

More details on Website and Youtube.
Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact Investor_R for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases you can find a good open-source alternative for free in our Community Scripts.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Author's instructions

To get access or report problem write on

Want to use this script on a chart?

Warning: please read before requesting access.