OPEN-SOURCE SCRIPT
Reversal Candlestick Patterns

Reversal Candlestick Patterns
Reversal Candlestick Patterns is an indicator designed to detect classic candlestick reversal patterns with additional market context filtering.
The indicator identifies ten well-known reversal candlestick patterns and displays them directly on the chart as visual blocks. Each pattern is detected using its own logic, based on candle structure, position relative to local extremes, and the direction of the current trend.
Bullish patterns:
> Bullish Engulfing
> Morning Star
> Hammer
> Inverted Hammer
> Three White Soldiers
Bearish patterns:
> Bearish Engulfing
> Evening Star
> Hanging Man
> Shooting Star
> Three Black Crows
Pattern configuration
Detection of each individual pattern, its short name displayed on the chart, and the color of the highlighting block can be configured separately in the first two settings groups:
Bullish Patterns and Bearish Patterns.
This allows you to fully customize which patterns are used, how they are labeled, and how they are visually represented.
Trend filtering
The indicator includes an optional trend filter based on two Simple Moving Averages.
It is enabled using the Check Trend setting. The Trend Detection Length parameter is used simultaneously for several calculations:
> Length of the fast moving average
> Half of the slow moving average length
> Number of consecutive bars required to confirm trend direction
This approach helps filter out reversal patterns that form against a well-established trend.
External filters
The indicator supports external confirmation filters for bullish and bearish patterns. External filter settings are located in the External Filters group. For each filter, you can specify the value of an external indicator that must be met for a pattern to be confirmed. This allows flexible integration with oscillators, volume-based indicators, or custom scripts.
Visualization settings
Visualization settings control:
> Pattern name display
> Text size
> Block fill transparency
These settings affect only the visual presentation and do not influence the detection logic.
Alerts
The indicator provides two types of alerts:
1. Global alert for any detected pattern. Created by selecting “Any alert() function call” when setting up an alert.
2. Dedicated alert conditions for:
> Each individual pattern
> Any bullish pattern
> Any bearish pattern
Please note: if detection of a specific pattern is disabled in the settings, alerts for that pattern will not trigger.
Important note
Candlestick patterns should not be used as standalone trading signals. This indicator is intended to be used as part of a broader analysis, together with trend structure, key levels, volume, and other analytical tools.
Reversal Candlestick Patterns is an indicator designed to detect classic candlestick reversal patterns with additional market context filtering.
The indicator identifies ten well-known reversal candlestick patterns and displays them directly on the chart as visual blocks. Each pattern is detected using its own logic, based on candle structure, position relative to local extremes, and the direction of the current trend.
Bullish patterns:
> Bullish Engulfing
> Morning Star
> Hammer
> Inverted Hammer
> Three White Soldiers
Bearish patterns:
> Bearish Engulfing
> Evening Star
> Hanging Man
> Shooting Star
> Three Black Crows
Pattern configuration
Detection of each individual pattern, its short name displayed on the chart, and the color of the highlighting block can be configured separately in the first two settings groups:
Bullish Patterns and Bearish Patterns.
This allows you to fully customize which patterns are used, how they are labeled, and how they are visually represented.
Trend filtering
The indicator includes an optional trend filter based on two Simple Moving Averages.
It is enabled using the Check Trend setting. The Trend Detection Length parameter is used simultaneously for several calculations:
> Length of the fast moving average
> Half of the slow moving average length
> Number of consecutive bars required to confirm trend direction
This approach helps filter out reversal patterns that form against a well-established trend.
External filters
The indicator supports external confirmation filters for bullish and bearish patterns. External filter settings are located in the External Filters group. For each filter, you can specify the value of an external indicator that must be met for a pattern to be confirmed. This allows flexible integration with oscillators, volume-based indicators, or custom scripts.
Visualization settings
Visualization settings control:
> Pattern name display
> Text size
> Block fill transparency
These settings affect only the visual presentation and do not influence the detection logic.
Alerts
The indicator provides two types of alerts:
1. Global alert for any detected pattern. Created by selecting “Any alert() function call” when setting up an alert.
2. Dedicated alert conditions for:
> Each individual pattern
> Any bullish pattern
> Any bearish pattern
Please note: if detection of a specific pattern is disabled in the settings, alerts for that pattern will not trigger.
Important note
Candlestick patterns should not be used as standalone trading signals. This indicator is intended to be used as part of a broader analysis, together with trend structure, key levels, volume, and other analytical tools.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。