Morning & Evening Star Detector [SSFX]Morning & Evening Star Detector 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:
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.
Chỉ báo









