OPEN-SOURCE SCRIPT

Triple Bottom Patterns [theEccentricTrader]

█  OVERVIEW


This indicator automatically draws triple bottom 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.

Broken and Unbroken Peaks and Troughs

Upon the completion of a new swing low the high of the green candle that completes the swing low will be above, below or equal to the current peak price. And similarly, upon the completion of a new swing high the low of the red candle that completes the swing high will be above, below or equal to the current trough price.

If the high price of the green candle that completes the current swing low is higher than or equal to the current peak price then the current peak is broken. If the high of the green candle that completes the current swing low is below the current peak price, then the current peak is unbroken.

Similarly, if the low price of the red candle that completes the current swing high is lower than or equal to the current trough price then the current trough is broken. If the low price of the red candle that completes the current swing high is above the current trough price, then the current trough is unbroken.

Range

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

Retracement and Extension Ratios

Retracement and extension ratios are calculated by dividing the current range by the preceding range and multiplying the answer by 100. Retracement ratios are those that are equal to or below 100% of the preceding range and extension ratios are those that are above 100% of the preceding range.

Triple Bottom and Triple Top Patterns

• Triple bottom patterns are composed of two peaks and three troughs, with the second and third troughs being roughly equal to the first trough.
• Triple top patterns are composed of two troughs and three peaks, with the second and third peaks being roughly equal to the first peak.

Measurement Tolerances

In general, tolerance in measurements refers to the allowable variation or deviation from a specific value or dimension. It is the range within which a particular measurement is considered to be acceptable or accurate. In this script I have applied this concept to the measurement of triple bottom and triple top patterns to increase to the frequency of pattern occurrences.

For example, a perfect triple bottom is very rare. We can increase the frequency of pattern occurrences by setting a tolerance. A ratio tolerance of 10% to both downside and upside, which is the default setting, means we would have a tolerable ratio measurement range between 90-110% for the second and third troughs as ratios of the first trough, thus increasing the frequency of occurrence.


█  FEATURES


Inputs

• Unbroken Peaks
• Lower Tolerance
• Upper Tolerance
• Pattern Color
• Neckline Color
• Extend Current Neckline
• Show Labels
• Label Color
• Show Projection Lines
• Extend Current Projection Lines

Alerts

Users can set alerts for when the patterns occur.


█  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.
Chart patternsWave Analysis

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad