Pattern analysis guide

TradingView Pattern Recognition Indicator: Algorithmic Candlestick and Chart Patterns

A TradingView pattern recognition indicator automatically scans price charts to identify candlestick reversal formations (such as engulfing bars, hammers, and morning stars) and multi-bar geometric chart patterns (such as double tops/bottoms, triangles, and flags). By replacing subjective visual scanning with mathematical criteria, these indicators deliver instant, rule-based alerts when valid formations complete.

Access Invite-Only Indicator

Why algorithmic pattern recognition outperforms manual chart reading

Manual pattern identification is prone to cognitive bias. A trader who is already bullish tends to spot inverted head-and-shoulders bottoms everywhere, while ignoring bearish distribution signals. An algorithmic pattern recognition indicator evaluates mathematical candle ratios, wick proportions, and relative volume impartially.

Pattern categoryRepresentative formationsMathematical criteriaTrading function
Single-Bar ReversalsHammer, Inverted Hammer, Shooting Star, DojiWick >= 2x body height; close near candle extremeTactical timing of trend pullbacks and intraday pivots
Multi-Bar CandlestickBullish/Bearish Engulfing, Morning/Evening StarCurrent body completely covers prior candle body with volume spikeConfirming momentum shifts at key support or resistance
Geometric Chart PatternsDouble Top/Bottom, Head & Shoulders, Ascending TriangleConsecutive swing pivots within defined percentage tolerancesMacro trend continuation breakouts and structural reversals
Pineify Signals & Overlays StructureDow Theory fractal structure + pattern recognition engineConfirmed bar-close pattern detection with trend cloud filtersHigh win-rate institutional entries with dynamic ATR stops

How to filter candlestick pattern false alarms with volume and trend context

A hammer or engulfing pattern occurring in the middle of a choppy, low-volume consolidation has minimal predictive power. Professional pattern trading requires strict contextual filters.

  • Location is Everything: Only trade reversal candlestick patterns that form at significant structural support or resistance, dynamic trend clouds, or key Fibonacci retracement levels.
  • Volume Confirmation: A valid bullish engulfing candle should display volume substantially above the 20-period volume moving average, proving institutional accumulation.
  • Wait for Follow-Through: Never buy during the formation of the pattern candle. Always wait for the pattern bar to close, and consider entering on a break of the pattern high.

Pine Script v6: Automated bullish and bearish engulfing pattern detector

This Pine Script v6 indicator algorithmically identifies confirmed bullish and bearish engulfing patterns with volume expansion and trend alignment filters.

Confirmed Engulfing Pattern Detector in Pine Script v6pinescript
//@version=6
indicator("Confirmed Engulfing Patterns [Pineify]", overlay=true)

// Settings
int trendMALength = input.int(50, "Trend Filter EMA")
int volMALength = input.int(20, "Volume MA Length")
float trendEMA = ta.ema(close, trendMALength)
float volMA = ta.sma(volume, volMALength)

plot(trendEMA, "Trend EMA", color=color.blue, linewidth=2)

// Candlestick measurements
float bodySize = math.abs(close - open)
float priorBody = math.abs(close[1] - open[1])
bool volumeSpike = volume > volMA

// Bullish Engulfing: Prior bar red, current bar green, current body engulfs prior body, above trend EMA
bool bullEngulf = close[1] < open[1] and close > open and close >= open[1] and open <= close[1] and bodySize > priorBody and volumeSpike and close > trendEMA

// Bearish Engulfing: Prior bar green, current bar red, current body engulfs prior body, below trend EMA
bool bearEngulf = close[1] > open[1] and close < open and close <= open[1] and open >= close[1] and bodySize > priorBody and volumeSpike and close < trendEMA

plotshape(bullEngulf, "Bullish Engulfing", shape.labelup, location.belowbar, color=color.green, text="ENGULF", textcolor=color.white, size=size.small)
plotshape(bearEngulf, "Bearish Engulfing", shape.labeldown, location.abovebar, color=color.red, text="ENGULF", textcolor=color.white, size=size.small)

if bullEngulf
    alert("Bullish Engulfing pattern confirmed with volume at " + str.tostring(close), alert.freq_once_per_bar_close)
if bearEngulf
    alert("Bearish Engulfing pattern confirmed with volume at " + str.tostring(close), alert.freq_once_per_bar_close)

Integrating pattern recognition into a complete trading strategy

Candlestick and chart patterns should function as tactical execution triggers within a broader trading framework.

  • Establish Macro Direction First: If the macro trend cloud is bullish, only take bullish pattern signals (hammers, bullish engulfing, double bottoms) and ignore bearish patterns.
  • Define Risk Immediately: Place your stop loss strictly beyond the pattern invalidation wick. If trading a hammer, place the stop loss below the hammer tail.
  • Target Prior Swing Pivots: Aim for a minimum 1:2 risk-to-reward ratio by targeting the prior structural swing high or major liquidity pool.
Where Pineify fits

Pineify® - Signals & Overlays™

Harness algorithmic pattern recognition and Dow Theory market structure. Delivers confirmed buy/sell signals, trend clouds, and dynamic ATR risk lines on TradingView.

Also useful: Pine Script AI Coding Agent. Build custom candlestick pattern scanners, harmonic pattern scripts, and automated TradingView alerts in Pine Script v6.

Access Invite-Only Indicator

Frequently asked questions

Educational purposes only, not financial or investment advice. Technical chart patterns reflect historical tendencies and do not guarantee future price movements. Always employ disciplined stop-loss and risk management rules.

Sources and verification