PROTECTED SOURCE SCRIPT
Candlestick Pattern Detector with Smart Context Signals

This indicator identifies and labels classic candlestick patterns—such as Doji, Hammer, Shooting Star, Engulfing, Morning Star, Evening Star, Piercing Line, Dark Cloud Cover, Three White Soldiers, and Three Black Crows—and automatically translates each into a directional trading bias.
What makes it unique is its context-aware logic. It doesn’t just detect shapes—it interprets them based on recent market behavior.
By combining candle structure ratios with a trend-recognition filter (ta.rising and ta.falling), it distinguishes whether a pattern is likely a reversal or a continuation.
For example:
A long-wick candle after a series of falling closes is labeled Hammer → Long.
The same candle during a rising trend becomes Hanging Man → Short.
The script uses adaptive thresholds instead of fixed pip distances, calculating the 5-bar simple moving average of both body size and total candle range.
All pattern definitions are expressed as proportional relationships (for instance, a Doji body ≤ 10 % of average body size and total range ≥ 80 % of average).
This allows the algorithm to scale automatically across instruments and timeframes.
Visual outputs:
Pattern name and trade direction label above or below candles
Green triangles for Long setups, red for Short, Grey for neutral
Built-in alerts fire once per new signal to prevent repetitive notifications
This tool helps traders read price action rather than rely solely on indicators, offering an educational bridge between visual candlestick analysis and coded automation.
What makes it unique is its context-aware logic. It doesn’t just detect shapes—it interprets them based on recent market behavior.
By combining candle structure ratios with a trend-recognition filter (ta.rising and ta.falling), it distinguishes whether a pattern is likely a reversal or a continuation.
For example:
A long-wick candle after a series of falling closes is labeled Hammer → Long.
The same candle during a rising trend becomes Hanging Man → Short.
The script uses adaptive thresholds instead of fixed pip distances, calculating the 5-bar simple moving average of both body size and total candle range.
All pattern definitions are expressed as proportional relationships (for instance, a Doji body ≤ 10 % of average body size and total range ≥ 80 % of average).
This allows the algorithm to scale automatically across instruments and timeframes.
Visual outputs:
Pattern name and trade direction label above or below candles
Green triangles for Long setups, red for Short, Grey for neutral
Built-in alerts fire once per new signal to prevent repetitive notifications
This tool helps traders read price action rather than rely solely on indicators, offering an educational bridge between visual candlestick analysis and coded automation.
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Geschütztes Skript
Dieses Script ist als Closed-Source veröffentlicht. Sie können es kostenlos und ohne Einschränkungen verwenden – erfahren Sie hier mehr.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.