theEccentricTrader

Head and Shoulders Patterns [theEccentricTrader]

█  OVERVIEW


This indicator automatically draws head and shoulders patterns and price projections derived from the ranges that constitute the patterns.


█  CONCEPTS


Green and Red Candles

• A green candle is one that closes with a close price equal to or above the price it opened.
• A red candle is one that closes with a close price that is lower than the price it opened.

Swing Highs and Swing Lows

• A swing high is a green candle or series of consecutive green candles followed by a single red candle to complete the swing and form the peak.
• A swing low is a red candle or series of consecutive red candles followed by a single green candle to complete the swing and form the trough.

Peak and Trough Prices (Basic)

• The peak price of a complete swing high is the high price of either the red candle that completes the swing high or the high price of the preceding green candle, depending on which is higher.
• The trough price of a complete swing low is the low price of either the green candle that completes the swing low or the low price of the preceding red candle, depending on which is lower.

Historic Peaks and Troughs

The current, or most recent, peak and trough occurrences are referred to as occurrence zero. Previous peak and trough occurrences are referred to as historic and ordered numerically from right to left, with the most recent historic peak and trough occurrences being occurrence one.

Upper Trends

• A return line uptrend is formed when the current peak price is higher than the preceding peak price.
• A downtrend is formed when the current peak price is lower than the preceding peak price.
• A double-top is formed when the current peak price is equal to the preceding peak price.

Lower Trends

• An uptrend is formed when the current trough price is higher than the preceding trough price.
• A return line downtrend is formed when the current trough price is lower than the preceding trough price.
• A double-bottom is formed when the current trough price is equal to the preceding trough price.

Range

The range is simply the difference between the current peak and current trough prices, generally expressed in terms of points or pips.

Support and Resistance

• Support refers to a price level where the demand for an asset is strong enough to prevent the price from falling further.
• Resistance refers to a price level where the supply of an asset is strong enough to prevent the price from rising further.

Support and resistance levels are important because they can help traders identify where the price of an asset might pause or reverse its direction, offering potential entry and exit points. For example, a trader might look to buy an asset when it approaches a support level , with the expectation that the price will bounce back up. Alternatively, a trader might look to sell an asset when it approaches a resistance level , with the expectation that the price will drop back down.

It's important to note that support and resistance levels are not always relevant, and the price of an asset can also break through these levels and continue moving in the same direction.

Breakouts and Breakdowns

• A breakout occurs when the price of an asset breaks above a resistance level.
• A breakdown occurs when the price of an asset breaks below a support level.
• A confirmed breakout occurs when the price of an asset breaks and closes above a resistance level.
• A confirmed breakdown occurs when the price of an asset breaks and closes below a support level.

It's important to note that breakouts and breakdowns of resistance and support levels are not always relevant, and the price of an asset can also reverse once it has broken through a level to carry on in the opposite direction.

Trendlines

Trendlines are straight lines that are drawn between two or more points on a price chart. These lines are used as dynamic support and resistance levels for making strategic decisions and predictions about future price movements. For example traders will look for price movements along, and reactions to, trendlines in the form of rejections or breakouts/downs.

Head and Shoulders Patterns

Head and shoulders patterns are generally characterised by three peaks with the one in the middle being the highest of the three.

The current trough acts as neckline support and the trendline drawn from the preceding trough to current trough acts as dynamic neckline support.

Traders typically look for breakdowns of head and shoulders necklines to identify potential trading opportunities, with targets and stop losses set as multiples of the pattern's range.


█  FEATURES


Inputs

• Show Historic
• Show Necklines
• Show Dynamic Necklines
• Show Projections
• Pattern Color
• Pattern Neckline Color
• Extend Current Pattern Lines
• Extend Current Pattern Necklines
• Extend Current Projection Lines


█  LIMITATIONS


All green and red candle calculations are based on differences between open and close prices, as such I have made no attempt to account for green candles that gap lower and close below the close price of the preceding candle, or red candles that gap higher and close above the close price of the preceding candle. This may cause some unexpected behaviour on some markets and timeframes. I can only recommend using 24-hour markets, if and where possible, as there are far fewer gaps and, generally, more data to work with.
Release Notes:
Added alert functionality.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

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.

Want to use this script on a chart?