Chart Patterns [ActiveQuants]The Chart Patterns indicator is a comprehensive tool designed to automatically identify a variety of common chart patterns directly on your price chart. By detecting sequences of pivot highs and lows , this indicator helps traders spot potential trend continuations , reversals , and key market structures such as Double Tops and Double Bottoms . Enhance your technical analysis by quickly recognizing these formations as they emerge.
How It Works
The indicator operates in a two-stage process:
Pivot Point Detection: It first identifies significant swing highs and swing lows (pivot points) based on a user-defined Period . These pivots form the fundamental building blocks for pattern recognition.
Pattern Recognition: Using the sequence of these detected pivot points, the script then applies logical rules to identify the following patterns:
Lower Low (LL)
Lower Low & Lower High (LL & LH)
Higher High (HH)
Higher High & Higher Low (HH & HL)
Double Tops
Double Bottoms
Patterns are drawn on the chart with connecting lines and labeled for easy identification. Double Tops and Double Bottoms also feature a status system: " Active " while forming, " Confirmed " upon neckline breakout, or " Invalid " if specific conditions negate the pattern before confirmation.
█ KEY FEATURES
Comprehensive Pattern Detection: Identifies six distinct types of chart patterns, offering insights into both trend continuation and potential reversals.
Pivot-Based Analysis: Uses a robust method of identifying pivot highs and lows as the foundation for pattern formation.
Pattern Status for Double Tops/Bottoms:
- Active: A Double Top or Double Bottom pattern has formed its two peaks/troughs and the intervening neckline point, but the price has not yet broken beyond the neckline. The pattern is developing .
- Confirmed: The price has decisively closed beyond the neckline (below for Double Top, above for Double Bottom), signaling a potential entry or validation of the pattern.
- Invalid: An " Active " Double Top or Double Bottom pattern can be invalidated if, before a neckline breakout occurs, a new pivot point forms that negates the pattern’s structural integrity. For example, if a new pivot low forms above or at the neckline of an Active Double Top, the pattern is considered invalid because the market failed to break down and instead showed relative strength.
Customizable Visuals: Allows users to define colors for bullish and bearish patterns, line widths, and the visibility of pivot points.
Selective Pattern Display: Users can choose to display all patterns or filter by status (Active, Confirmed, Invalid) for Double Tops/Bottoms. Individual pattern types can also be toggled on or off.
Historical Analysis Control: The Show Last History (Bars) input allows users to specify how far back the indicator should plot patterns, optimizing performance and chart readability.
Clear Labeling: Patterns are clearly labeled on the chart, with Double Tops/Bottoms also showing " Top 1 ," " Top 2 ," or " Bottom 1 ," " Bottom 2 " labels.
█ PATTERNS DETECTED
Lower Low (LL): Indicates a potential bearish continuation or the start of a downtrend. Forms when price makes a lower low during an uptrend.
Lower Low & Lower High (LL & LH): A stronger confirmation of a bearish trend, where the market forms a lower low followed by a lower high .
Higher High (HH): Signals a potential bullish continuation or the start of an uptrend. Forms when price makes a higher high during a downtrend.
Higher High & Higher Low (HH & HL): A stronger confirmation of a bullish trend, where the market forms a higher high followed by a higher low .
Double Top: A bearish reversal pattern characterized by two distinct peaks at roughly the same price level, separated by a trough (neckline). Confirmation occurs when price breaks below the neckline.
Double Bottom: A bullish reversal pattern featuring two distinct troughs at roughly the same price level, separated by a peak (neckline). Confirmation occurs when price breaks above the neckline.
█ EXAMPLE: DOUBLE TOP INVALIDATION
Understanding how a Double Top or Double Bottom can be invalidated is crucial. Here's an example for a Double Top:
Formation: The indicator identifies two peaks (Top 1, Top 2) at a similar price level, with a corrective trough (Neckline Pivot P5) in between. The pattern is labeled " Double Top " and is in an " Active " state. ( Imagine points P4 and P6 are the two tops, and P5 is the low point of the neckline between them ).
Pre-Breakout Condition: The price action continues, but before it breaks decisively below the P5 neckline level, a new significant swing low (a new pivot low) forms.
Invalidation Check: The indicator checks the price level of this new pivot low. If this new pivot low occurs at a price equal to or higher than the P5 neckline level, the " Active " Double Top pattern is re-labeled as " Invalid Double Top ". ( See image below for a visual representation of this scenario )
In this example, the Double Top formed with Top 1 (P4) and Top 2 (P6). The neckline is at P5. Before price broke below P5, a new pivot low formed at the red circle. Since this new pivot low is above the P5 neckline, the Double Top is marked " Invalid ".
The logic is that the market failed to break the neckline support and instead established a higher low (or a low at the support level), suggesting that the immediate bearish pressure has waned, thus invalidating the bearish reversal implication of the Double Top before it could confirm. A similar logic applies to Double Bottoms (a new pivot high forming below or at the neckline before an upside breakout).
█ USER INPUTS
Visibility and Common Styling
- Show Last History (Bars):
Specifies the number of recent bars the indicator will analyze and plot patterns on.
Default: 3000 bars. Min: 10.
- Patterns:
Filters which patterns are displayed based on their status.
Options: All, Active, Confirmed, Invalid.
Default: All.
- Pattern Line Width:
Sets the thickness of the lines used to draw the patterns.
Default: 1. Min: 1, Max: 10.
- Bearish Color:
Color for bearish patterns (LL, LL & LH, Double Tops).
Default: Red.
- Bullish Color:
Color for bullish patterns (HH, HH & HL, Double Bottoms).
Default: Green.
Pivot Points
- Period:
The lookback period on either side of a bar to qualify it as a pivot high or low. Higher values detect more significant pivots.
Default: 10 bars. Min: 2.
- Show Pivot Highs:
Toggles the visibility of detected pivot high markers.
Default: Enabled.
- Show Pivot Lows:
Toggles the visibility of detected pivot low markers.
Default: Enabled.
- Pivot Highs Color:
Color for the pivot high markers.
Default: #ff5252 (Reddish).
- Pivot Lows Color:
Color for the pivot low markers.
Default: #089981 (Greenish).
Patterns (Toggles)
- Lower Low:
Enable/disable detection and display of Lower Low patterns.
Default: Enabled.
- Lower Low & Lower High:
Enable/disable detection and display of Lower Low & Lower High patterns.
Default: Enabled.
- Higher High:
Enable/disable detection and display of Higher High patterns.
Default: Enabled.
- Higher High & Higher Low:
Enable/disable detection and display of Higher High & Higher Low patterns.
Default: Enabled.
- Double Tops:
Enable/disable detection and display of Double Top patterns.
Default: Enabled.
- Double Bottoms:
Enable/disable detection and display of Double Bottom patterns.
Default: Enabled.
█ CONCLUSION
The Chart Patterns indicator is a versatile and powerful assistant for traders who utilize classical chart pattern analysis. By automating the detection of key formations and providing clear visual cues along with status updates for patterns like Double Tops and Bottoms, it allows traders to focus on strategy development and execution. With its customizable settings, it can be adapted to various instruments and timeframes, making it a valuable addition to any technical trader's toolkit.
█ IMPORTANT NOTES
⚠ Pivot Period Sensitivity: The Period setting for pivot detection is crucial. A shorter period will identify more frequent, smaller swings, while a longer period will focus on more significant turning points. Adjust this setting based on the asset's volatility, the timeframe you are trading and your trading style.
⚠ Confirmation is Key: While the indicator identifies patterns, always wait for pattern confirmation (e.g., neckline breaks for Double Tops/Bottoms) and consider other factors like volume and market context before making trading decisions.
⚠ Confirmed Bars for Detection: Patterns are identified based on confirmed pivot points, which means a pivot is recognized period bars after it has formed. Status updates for Double Tops/Bottoms (Active, Confirmed, Invalid) also occur on confirmed bars. This approach enhances reliability and reduces the likelihood of repainting based on intra-bar price fluctuations.
⚠ Not a Standalone System: Chart patterns provide valuable insights, but they should be used in conjunction with other technical analysis tools (e.g., trendlines, moving averages, oscillators) and a sound risk management plan.
⚠ Lagging Nature: By their very definition, chart patterns are lagging indicators as they require a sequence of price action and several pivot points to complete their formation.
█ RISK DISCLAIMER
Trading involves a substantial risk of loss and is not suitable for every investor. The information provided by the Chart Patterns indicator is for educational and informational purposes only. It should not be considered as financial advice or a recommendation to buy or sell any security. Chart patterns indicate potential price movements but do not guarantee future results. Always perform your own due diligence and consult with a qualified financial advisor before making any investment decisions. Past performance is not indicative of future results.
📈 Happy trading! 🚀