Chart Pattern Wedge

A wedge is a reversal pattern consisting of two converging dynamic lines limiting the price movement. The lines are tilted to one side. Depending on the direction of the lines, the wedge can be ascending or descending. It is expected that after the price has broken through the wedge line in the direction opposite to the direction of the wedge, its further movement will be approximately the height of the wedge base.

The indicator analyzes the last 600 bars in search of patterns. The DTW (Dynamic Time Warping) algorithm is used for the primary recognition. This algorithm allows you to find compressed and time-stretched sequences of values of the specified source that match a given template of 4 points.The points found by the DTW are tied to pivots. Once they are found, the indicator checks whether the points comply with the pattern’s rules: between the first and the last point of the pattern, the price is allowed to cross the wedge lines with ‘high’ and ‘low’, but not with ‘close’ or ‘open’. The largest non-overlapping wedges among the found patterns that fit the description above are drawn on the chart.


Invert Pattern - Invert the pattern to search for a descending wedge.

Source - Source for the primary search. The indicator searches for the pattern in the source data using the DTW algorithm.

Channel Width Ratio Start/End - The minimum allowed channel height difference at the beginning and end of the pattern. Percentage value.

Change Pivots Sequence - Changing the sequence of minima and maxima: the pattern starts with a low pivot if this is ‘false’ and with a high pivot if switched to ‘true’.