OPEN-SOURCE SCRIPT
Morning & Evening Star Detector [SSFX]

Morning & Evening Star Detector [SSFX] is an open-source candlestick pattern indicator designed to identify two classic 3-candle reversal formations: the Morning Star and the Evening Star.
The Morning Star is a bullish reversal pattern that typically appears after bearish pressure. The indicator identifies it using a 3-candle structure:
The Evening Star is the opposite bearish reversal pattern. It is detected when the market forms:
To make the patterns easier to read on the chart, the script automatically draws a box around the full 3-candle formation:
The box covers the full high-to-low range of the entire pattern, helping traders visually study where the reversal structure formed.
Main features:
The pattern logic is fully customizable. Users can adjust the required body size of the first candle, the maximum body size of the star candle, the minimum body size of the confirmation candle, and how deeply the third candle must close into the first candle’s body.
The optional gap setting is included for traders who prefer a more classical definition of Morning Star and Evening Star patterns. Since many markets such as forex, gold, crypto, and index CFDs often do not produce clean session gaps, the gap requirement can be turned off for more flexible detection.
This indicator is intended for educational and analytical use. It does not predict future price movement and should not be used as a standalone trading system. Morning Star and Evening Star patterns are best interpreted together with market structure, support and resistance, trend context, volume, and proper risk management.
The Morning Star is a bullish reversal pattern that typically appears after bearish pressure. The indicator identifies it using a 3-candle structure:
- A strong bearish first candle
- A small-bodied middle candle, representing hesitation or loss of momentum
- A strong bullish third candle that closes back into the body of the first candle
The Evening Star is the opposite bearish reversal pattern. It is detected when the market forms:
- A strong bullish first candle
- A small-bodied middle candle
- A strong bearish third candle that closes back into the body of the first candle
To make the patterns easier to read on the chart, the script automatically draws a box around the full 3-candle formation:
- Green box = Morning Star
- Red box = Evening Star
The box covers the full high-to-low range of the entire pattern, helping traders visually study where the reversal structure formed.
Main features:
- Detects Morning Star bullish reversal patterns
- Detects Evening Star bearish reversal patterns
- Draws visual boxes around valid 3-candle patterns
- Green highlight for Morning Star formations
- Red highlight for Evening Star formations
- Optional labels for detected patterns
- Optional background highlighting
- Adjustable candle body percentage filters
- Adjustable middle candle size filter
- Adjustable third candle close requirement
- Optional gap requirement for more traditional pattern detection
- Built-in alert conditions for both pattern types
The pattern logic is fully customizable. Users can adjust the required body size of the first candle, the maximum body size of the star candle, the minimum body size of the confirmation candle, and how deeply the third candle must close into the first candle’s body.
The optional gap setting is included for traders who prefer a more classical definition of Morning Star and Evening Star patterns. Since many markets such as forex, gold, crypto, and index CFDs often do not produce clean session gaps, the gap requirement can be turned off for more flexible detection.
This indicator is intended for educational and analytical use. It does not predict future price movement and should not be used as a standalone trading system. Morning Star and Evening Star patterns are best interpreted together with market structure, support and resistance, trend context, volume, and proper risk management.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。