OPEN-SOURCE SCRIPT
Candle Patterns

Overview
This indicator is a modernized, high-signal-quality candlestick pattern detector designed for the price-action trader. Unlike standard pattern recognizers that trigger on "weak" or indecisive candles (Dojis), this script uses a Momentum-Verified Logic to ensure that multi-candle patterns represent true market conviction.
The script scans for the most reliable reversal and continuation patterns while providing a built-in Moving Average filter to align signals with the prevailing trend.
Key Features
1. Momentum-Verified Logic (Anti-Doji)
Standard patterns like 3 Soldiers or 3 Crows often trigger with small-bodied candles that lack momentum. This indicator uses a custom isStrong() function requiring the candle body to be at least 50% of the total candle range. This effectively filters out weak signals and "leggy" wicks, showing you only when the bulls or bears are truly in control.
2. "Real Body" Engulfing
To reduce noise, the Engulfing logic is calculated using the Real Bodies (Open to Close). The current candle's body must completely engulf the previous candle's body, ignoring the "noise" of long wicks (thicks).
3. Integrated MA Filter
Trade only in the direction of the trend. When the MA Filter is enabled, bullish signals are only shown if price is above the Moving Average, and bearish signals if price is below it.
Supported Patterns
Engulfing (Body-to-Body): Powerful reversal signals ignoring wick noise.
3 Soldiers & 3 Crows: Momentum-verified (no Dojis allowed).
Morning Star & Evening Star: Three-candle bottom/top reversal patterns.
Meeting Line: Strike patterns where closing prices align.
Piercing Line & Dark Cloud: Deep-penetration reversal signals.
Harami: Traditional "inside bar" reversal setups.
How to Use
Select Your Patterns: Use the Settings menu to toggle specific patterns on or off.
Trend Alignment: Enable the "MA Filter" and set your period (e.g., 50 or 200) to filter for high-probability trend-following setups.
Y-Axis Alignment: For the best experience, ensure your Price Scale is set to "Merge All Scales into One (Right)" to keep labels perfectly pinned to price action.
Technical Details
Version: Pine Script v5
Overlay: Yes (Plots directly on candles)
Alerts: Compatible with alertcondition for "Once Per Bar Close" notifications.
This indicator is a modernized, high-signal-quality candlestick pattern detector designed for the price-action trader. Unlike standard pattern recognizers that trigger on "weak" or indecisive candles (Dojis), this script uses a Momentum-Verified Logic to ensure that multi-candle patterns represent true market conviction.
The script scans for the most reliable reversal and continuation patterns while providing a built-in Moving Average filter to align signals with the prevailing trend.
Key Features
1. Momentum-Verified Logic (Anti-Doji)
Standard patterns like 3 Soldiers or 3 Crows often trigger with small-bodied candles that lack momentum. This indicator uses a custom isStrong() function requiring the candle body to be at least 50% of the total candle range. This effectively filters out weak signals and "leggy" wicks, showing you only when the bulls or bears are truly in control.
2. "Real Body" Engulfing
To reduce noise, the Engulfing logic is calculated using the Real Bodies (Open to Close). The current candle's body must completely engulf the previous candle's body, ignoring the "noise" of long wicks (thicks).
3. Integrated MA Filter
Trade only in the direction of the trend. When the MA Filter is enabled, bullish signals are only shown if price is above the Moving Average, and bearish signals if price is below it.
Supported Patterns
Engulfing (Body-to-Body): Powerful reversal signals ignoring wick noise.
3 Soldiers & 3 Crows: Momentum-verified (no Dojis allowed).
Morning Star & Evening Star: Three-candle bottom/top reversal patterns.
Meeting Line: Strike patterns where closing prices align.
Piercing Line & Dark Cloud: Deep-penetration reversal signals.
Harami: Traditional "inside bar" reversal setups.
How to Use
Select Your Patterns: Use the Settings menu to toggle specific patterns on or off.
Trend Alignment: Enable the "MA Filter" and set your period (e.g., 50 or 200) to filter for high-probability trend-following setups.
Y-Axis Alignment: For the best experience, ensure your Price Scale is set to "Merge All Scales into One (Right)" to keep labels perfectly pinned to price action.
Technical Details
Version: Pine Script v5
Overlay: Yes (Plots directly on candles)
Alerts: Compatible with alertcondition for "Once Per Bar Close" notifications.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。