Auto Chart Patterns [Trendoscope®]

アップデート済
🎲 Introducing our most comprehensive automatic chart pattern recognition indicator.

Last week, we published an idea on how to algorithmically identify and classify chart patterns.
Algorithmic Identification and Classification of Chart Patterns


This indicator is nothing but the initial implementation of the idea. Whatever we explained in that publication that users can do manually to identify and classify the pattern, this indicator will do it for them.

🎲 Process of identifying the patterns.

The bulk of the logic is implemented as part of the library - chartpatterns. The indicator is a shell that captures the user inputs and makes use of the library to deliver the outcome.

🎯 Here is the list of steps executed to identify the patterns on the chart.
  • Derive multi level recursive zigzag for multiple base zigzag length and depth combinations.
  • For each zigzag and level, check the last 5 pivots or 6 pivots (based on the input setting) for possibility of valid trend line pairs.
  • If there is a valid trend line pair, then there is pattern.


🎯 Rules for identifying the valid trend line pairs
  • There should be at least two trend lines that does not intersect between the starting and ending pivots.
  • The upper trend line should touch all the pivot highs of the last 5 or 6 pivots considered for scanning the patterns
  • The lower trend line should touch all the pivot lows of the last 5 or 6 pivots considered for scanning the patterns.
  • None of the candles from starting pivot to ending pivot should fall outside the trend lines (above upper trend line and below lower trend line)


The existence of a valid trend line pair signifies the existence of pattern. What type of pattern it is, to identify that we need to go through the classification rules.

🎲 Process of classification of the patterns.

We need to gather the following information before we classify the pattern.
  • Direction of upper trend line - rising, falling or flat
  • Direction of lower trend line - rising, falling or flat
  • Characteristics of trend line pair - converging, expanding, parallel


🎯 Broader Classifications
Broader classification would include the following types.

🚩 Classification Based on Geometrical Shapes
This includes
  • Wedges - both trend lines are moving in the same direction. But, the trend lines are either converging or diverging and not parallel to each other.
  • Triangles - trend lines are moving in different directions. Naturally, they are either converging or diverging.
  • Channels - Both trend lines are moving in the same direction, and they are parallel to each other within the limits of error.


🚩 Classification Based on Pattern Direction
This includes
  • Ascending/Rising Patterns - No trend line is moving in the downward direction and at least one trend line is moving upwards
  • Descending/Falling Patterns - No trend line is moving in the upward direction, and at least one trend line is moving downwards.
  • Flat - Both Trend Lines are Flat
  • Bi-Directional - Both trend lines are moving in opposite direction and none of them is flat.


🚩 Classification Based on Formation Dynamics
This includes
  • Converging Patterns - Trend Lines are converging towards each other
  • Diverging Patterns - Trend Lines are diverging from each other
  • Parallel Patterns - Trend Lines are parallel to each others


🎯 Individual Pattern Types
Now we have broader classifications. Let's go through in detail to find out fine-grained classification of each individual patterns.

🚩 Ascending/Uptrend Channel
This pattern belongs to the broader classifications - Ascending Patterns, Parallel Patterns and Channels. The rules for the Ascending/Uptrend Channel pattern are as below
  • Both trend lines are rising
  • Trend lines are parallel to each other

スナップショット

🚩 Descending/Downtrend Channel
This pattern belongs to the broader classifications - Descending Patterns, Parallel Patterns and Channels. The rules for the Descending/Downtrend Channel pattern are as below
  • Both trend lines are falling
  • Trend lines are parallel to each other

スナップショット

🚩 Ranging Channel
This pattern belongs to the broader classifications - Flat Patterns, Parallel Patterns and Channels. The rules for the Ranging Channel pattern are as below
  • Both trend lines are flat
  • Trend lines are parallel to each other

スナップショット

🚩 Rising Wedge - Expanding
This pattern belongs to the broader classifications - Rising Patterns, Diverging Patterns and Wedges. The rules for the Expanding Rising Wedge pattern are as below
  • Both trend lines are rising
  • Trend Lines are diverging.

スナップショット

🚩 Rising Wedge - Contracting
This pattern belongs to the broader classifications - Rising Patterns, Converging Patterns and Wedges. The rules for the Contracting Rising Wedge pattern are as below
  • Both trend lines are rising
  • Trend Lines are converging.

スナップショット

🚩 Falling Wedge - Expanding
This pattern belongs to the broader classifications - Falling Patterns, Diverging Patterns and Wedges. The rules for the Expanding Falling Wedge pattern are as below
  • Both trend lines are falling
  • Trend Lines are diverging.

スナップショット

🚩 Falling Wedge - Contracting
This pattern belongs to the broader classifications - Falling Patterns, Converging Patterns and Wedges. The rules for the Converging Falling Wedge are as below
  • Both trend lines are falling
  • Trend Lines are converging.

スナップショット

🚩 Rising/Ascending Triangle - Expanding
This pattern belongs to the broader classifications - Rising Patterns, Diverging Patterns and Triangles. The rules for the Expanding Ascending Triangle pattern are as below
  • The upper trend line is rising
  • The lower trend line is flat
  • Naturally, the trend lines are diverging from each other

スナップショット

🚩 Rising/Ascending Triangle - Contracting
This pattern belongs to the broader classifications - Rising Patterns, Converging Patterns and Triangles. The rules for the Contracting Ascending Triangle pattern are as below
  • The upper trend line is flat
  • The lower trend line is rising
  • Naturally, the trend lines are converging.

スナップショット

🚩 Falling/Descending Triangle - Expanding
This pattern belongs to the broader classifications - Falling Patterns, Diverging Patterns and Triangles. The rules for the Expanding Descending Triangle pattern are as below
  • The upper trend line is flat
  • The lower trend line is falling
  • Naturally, the trend lines are diverging from each other

スナップショット

🚩 Falling/Descending Triangle - Contracting
This pattern belongs to the broader classifications - Falling Patterns, Converging Patterns and Triangles. The rules for the Contracting Descending Triangle pattern are as below
  • The upper trend line is falling
  • The lower trend line is flat
  • Naturally, the trend lines are converging.

スナップショット

🚩 Converging Triangle
This pattern belongs to the broader classifications - Bi-Directional Patterns, Converging Patterns and Triangles. The rules for the Converging Triangle pattern are as below
  • The upper trend line is falling
  • The lower trend line is rising
  • Naturally, the trend lines are converging.

スナップショット

🚩 Diverging Triangle
This pattern belongs to the broader classifications - Bi-Directional Patterns, Diverging Patterns and Triangles. The rules for the Diverging Triangle pattern are as below
  • The upper trend line is rising
  • The lower trend line is falling
  • Naturally, the trend lines are diverging from each other.

スナップショット

🎲 Indicator Settings - Auto Chart Patterns

🎯 Zigzag Settings
Zigzag settings allow users to select the number of zigzag combinations to be used for pattern scanning, and also allows users to set zigzag length and depth combinations.

スナップショット

🎯 Scanning Settings
  • Number of Pivots - This can be either 5 or 6. Represents the number of pivots used for identification of patterns.
  • Error Threshold - Error threshold used for initial trend line validation.
  • Flat Threshold - Flat angle threshold is used to identify the slope and direction of trend lines.
  • Last Pivot Direction - Filters patterns based on the last pivot direction. The values can be up, down, both, or custom. When custom is selected, then the individual pattern specific last pivot direction setting is used instead of the generic one.
  • Verify Bar Ratio - Provides option to ignore extreme patterns where the ratios of zigzag lines are not proportionate to each other.
  • Avoid Overlap - When selected, the patterns that overlap with existing patterns will be ignored while scanning. Meaning, if the new pattern starting point falls between the start and end of an existing pattern, it will be ignored.

スナップショット

🎯 Group Classification Filters
Allows users to enable disable patterns based on group classifications.

🚩 Geometric Shapes Based Classifications
  • Wedges - Rising Wedge Expanding, Falling Wedge Expanding, Rising Wedge Contracting, Falling Wedge Contracting.
  • Channels - Ascending Channel, Descending Channel, Ranging Channel
  • Triangles - Converging Triangle, Diverging Triangle, Ascending Triangle Expanding, Descending Triangle Expanding, Ascending Triangle Contrcting and Descending Triangle Contracting


🚩 Direction Based Classifications
  • Rising - Rising Wedge Contracting, Rising Wedge Expanding, Ascending Triangle Contracting, Ascending Triangle Expanding and Ascending Channel
  • Falling - Falling Wedge Contracting, Falling Wedge Expanding, Descending Triangle Contracting, Descending Triangle Expanding and Descending Channel
  • Flat/Bi-directional - Ranging Channel, Converging Triangle, Diverging Triangle


🚩 Formation Dynamics Based Classifications
  • Expanding - Rising Wedge Expanding, Falling Wedge Expanding, Ascending Triangle Expanding, Descending Triangle Expanding, Diverging Triangle
  • Contracting - Rising Wedge Contracting, Falling Wedge Contracting, Ascending Triangle Contracting, Descending Triangle Contracting, Converging Triangle
  • Parallel - Ascending Channel, Descending Channgel and Ranging Channel


スナップショット

🎯 Individual Pattern Filters
These settings allow users to enable/disable individual patterns and also set last pivot direction filter individually for each pattern. Individual Last Pivot direction filters are only considered if the main "Last Pivot Direction" filter is set to "custom"

スナップショット

🎯 Display Settings
These are the settings that determine the indicator display. The details are provided in the tooltips and are self explanatory.
スナップショット

🎯 Alerts
A basic alert message is enabled upon detection of new pattern on the chart.
リリースノート
Added option to enable/disable repainting.

When permitted, repainting only updates a pattern if the new coordinates yield a more geometrically accurate representation. While repainting can be beneficial for maintaining precise patterns on the chart, it often carries a negative connotation. Therefore, we've set this option to be off by default, allowing users to choose based on their preferences
リリースノート
Updates

  • Added option to detect patterns based on custom OHLC. This means, users can select external inputs and apply the pattern detection algorithm on oscillators or other indicators provided they have their OHLC values and not a single value.
  • Added option to limit number of patterns on chart.
リリースノート
Library Updates
リリースノート
Minor library updates
リリースノート
Update libraries
リリースノート
Library updates and update to V6
リリースノート
Update to V6
autochartingChart patternsHarmonic PatternshewhomustnotbenamedtrendoscopeZig Zag Indicator

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

チャートでこのスクリプトを利用したいですか?

免責事項