BM ChartPatterns
CATEGORY: Indicator · For NinjaTrader 8 · Automatic chart pattern recognition
HOW IT WORKS: It detects and plots five pairs of classic chart patterns based on price swing pivots: Head and Shoulders (and its inverse), Double Top/Double Bottom, Symmetrical Triangle, Flag, and Rectangle. For each detected pattern, it draws the full shape and calculates/displays three trading levels—entry, invalidation point, and a target measured by the pattern's projected height—along with a HUD panel showing the risk/reward ratio of the most recent active pattern, color-coded based on how favorable that ratio is.
Key distinguishing features:
Positioning based on academic literature rather than trading intuition. The foundation lies in the work of Lo, Mamaysky, and Wang (2000, *Journal of Financial Economics*), which proposed the automatic recognition of these patterns. A subsequent study on the S&P 500 and Russell 2000 (1990–1999) offers a more nuanced view: it finds little to no support for trading Head and Shoulders as a standalone signal, yet finds evidence that the pattern anticipates an annualized risk-adjusted excess return of 5–7%. The product adopts this conclusion—explicitly stated in its description: these patterns serve as a contextual filter rather than a standalone entry signal; the indicator provides an indication, not a guarantee.
Detection based on confirmed pivots rather than the original academic method—a deliberate choice. The original study smooths the price series using kernel regression before identifying the shape; however, that smoothing looks into the future and inherently repaints—making it useful for analyzing the past but not for live trading. Here, the indicator uses pivots confirmed a fixed number of bars after they occur (similar to BMTrendChannel), ensuring no repainting: a confirmation lag is accepted so that what appears in the backtest matches exactly what happens in live trading. Geometric tolerances are relative to the size of each pattern, rather than a fixed figure in ticks. A 40-point Head and Shoulders pattern and an 8-point one cannot share the same absolute tolerance margin—it would be too loose for one and impossible to meet for the other. All checks (shoulder symmetry, equality of extremes, horizontality) are expressed as a percentage of each pattern's specific range.
Deliberately separated from BMCandlePatternPro due to the distinct nature of the problem, not out of oversight. Candlestick patterns span 1 to 3 bars and are resolved using simple, stateless arithmetic at a constant cost per bar. Chart patterns span between 20 and 200 bars; they require pivot detection, geometric fitting with tolerances, and state tracking for patterns still in formation. Mixing the two in the same file would risk having a change in candlestick detection break the triangle detection logic.
Each detected pattern comes with a calculated risk/reward ratio, not just the drawn shape. The panel displays the reward-to-risk ratio of the active pattern and color-codes it (favorable, neutral, unfavorable)—providing the key data point for deciding whether the pattern is worth trading, available at a glance without manual calculation.
TRADER STYLE: Traders who use chart patterns as part of their analysis and want them automatically detected and measured, while understanding—based on the academic evidence supporting the product—that they work best as contextual confirmation within a broader strategy rather than as standalone entry signals.
TECHNICAL REQUIREMENTS: NinjaTrader 8. Any instrument with intraday data. Calibrated by default for minute-based charts.
NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with, interest in, or ownership of the owner, developer, or provider of the products described herein, nor do they endorse, promote, or recommend any such products or services.