Chart Pattern Head and Shoulders

The head and shoulders is a reversal pattern formed by three consecutive highs and two intermediate lows. The first and third peaks are called shoulders and are located below the second - the head. The neck line - the line drawn along the intermediate minima - is also of importance. The pattern is considered completed only when the price reaches the right shoulder and falls below the neck line. It is expected that the further downward movement of the price will be approximately equal to the height of the head.


The inverted version of the pattern is also valid.


The indicator analyzes the last 600 bars in search of matches with a given template of 7 points.


Points 2-6 in the patterns are tied to pivots. Points 1 and 7 are placed at the low values located below the neck line. The indicator checks whether the points comply with the pattern’s rules and the specified minimum allowable height difference between the head and shoulders. Of all the patterns that have been found, those that are closest to the source and to the end of the chart are drawn.


Inputs:


Invert Pattern - Invert the pattern to search for inverted head and shoulders.


Source - Source for the primary search.


Minimum Required Difference - The minimum allowable difference in the height of the shoulders and the head. The height of the head and shoulders is calculated from the smallest of the intermediate minima. Percentage value.