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.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.