Can chart patterns such as triangles, wedges, and flags in trend theory be identified quantitatively?

Although trend patterns may sound subjective, they can actually be quantified using rules and data. This is also one of the chart features that many quantitative trading models currently attempt to capture.
The essence of chart patterns is converging or diverging volatility
Take a triangle pattern as an example. At its core, it represents converging price volatility. You can define conditions such as progressively lower highs and progressively higher lows, creating price fluctuations within a diagonally symmetrical range, accompanied by declining trading volume. If the range between the highest and lowest prices during a given period continues to narrow more than three times, while volatility also declines, it can initially be identified as a symmetrical triangle.
Wedges and flags also have specific slopes
Wedges typically occur near the end of a trend, with their upper and lower boundaries showing a relatively clear slope. Slope can be used as a filtering condition—for example, the price channel slope must fall within a certain range, the retracement within the channel must be below a specified threshold, and trading volume must continue to contract. These can all serve as characteristics of a wedge pattern.
A flag, by contrast, tends to represent a brief consolidation. It usually consists of a strong preceding trend—the flagpole—followed by a mildly sloped sideways consolidation zone—the flag. For quantitative analysis, you can determine whether the price change in the preceding move exceeds a certain threshold, then check whether the slope during the consolidation phase is close to 0 and whether its duration accounts for less than a certain proportion of the overall pattern. These can all be used as screening conditions.
Of course, quantifying chart patterns is a matter of probability, and there are rarely any absolute standards. However, using rules to approximate patterns, supplemented by trading-volume and trend-strength filters, is a practical and implementable approach.

Disclaimer: Investing involves risk. This article does not constitute investment advice.