Chart Pattern Rectangle

The rectangle forms the price movement between two horizontal lines. A rectangle is considered an undefined pattern. It is expected that after the price crosses one of the horizontal lines, it will proceed moving for approximately the height of the rectangle in the direction of the breakthrough.

The indicator analyzes the last 600 bars in search of matches with a given template of 4 points. The points found by the indicator are tied to the most suitable pivot points. Once they are found, the indicator checks whether the points comply with the pattern’s rules and the specified maximum permissible deviation: in the interval between the first and the last points, the price is allowed to cross the horizontal lines with ‘high’ and ‘low’, but not with ‘close’ or ‘open’. The largest non-intersecting rectangles among the found patterns that fit the description above are drawn on the chart.


Invert Pattern - Changes the sequence of minima and maxima in the rectangle: the pattern starts with a high pivot if this is ‘false’ and with a low pivot if switched to ‘true’.

Source - Source for the primary search.

Permissible Deviation - The maximum allowable deviation of points from horizontal lines. It is calculated as a percentage of the height of the rectangle.