Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The Star Pattern Reversal is a candlestick-pattern, mean-reversion trading strategy that automates two of the most recognised three-candle reversal formations in technical analysis: the Morning Star (a bullish reversal) and the Evening Star (a bearish reversal). A "candlestick pattern" is simply a shape formed by the open, high, low, and close prices of one or more bars on a chart, and the star family is among the most widely studied exhaustion signals in price action.
What makes this particular implementation distinct is that it does not act on a star pattern in isolation. It adds a second layer of confluence — support and resistance — by demanding that the middle "star" candle prints at a fresh swing extreme. In plain terms, the strategy only fades a move when the market has stalled at a meaningful price level it has recently tested, rather than somewhere in the middle of a range. Support is a price floor where buying interest has historically appeared; resistance is a ceiling where selling pressure has tended to emerge. Requiring the pattern to occur at one of these levels is intended to filter out the many star-shaped candles that form mid-range, which is where a large share of false reversals tend to occur.
As a learning tool, this strategy is well suited to traders who want to understand how classic candlestick reversals can be made more selective through location-based filtering. It is a reversal/counter-trend approach by design, so it is best studied by those interested in fading exhaustion rather than following momentum. It is not a "set and forget" money machine — it is a structured framework for studying how pattern recognition, swing-extreme detection, and volatility-based risk sizing can be combined into a single rule set.
How It Works
The strategy evaluates the market once per completed bar. It inspects the three most recently closed candles — the lead candle (c1), the star candle (c2), and the confirmation candle (c3) — and compares them against a window of prior bars that defines both the average candle size and the recent swing extremes.
Entry conditions — Morning Star (long signal):
- The lead candle (c1) is a strong bearish impulse — it closes lower than it opens, and its body is at least the average body size multiplied by the
ImpulseBodyFactor. - The middle candle (c2) is a small indecision star — its body is no larger than the lead candle's body multiplied by the
StarBodyFactor. - The confirmation candle (c3) is a strong bullish impulse — it closes higher than it opens and meets the same impulse-size requirement.
- The confirmation candle closes at or above the midpoint of the lead candle's body, signalling that buyers have reclaimed the prior selling.
- The star's low reaches the prior swing low (a tested support level) over the lookback window.
Entry conditions — Evening Star (short signal):
- The lead candle (c1) is a strong bullish impulse.
- The middle candle (c2) is a small indecision star.
- The confirmation candle (c3) is a strong bearish impulse that closes at or below the midpoint of the lead candle's body.
- The star's high reaches the prior swing high (a tested resistance level).
Stop-loss logic:
- For a long trade, the stop is placed below the lowest low of the three pattern candles, with extra room added equal to the Average True Range (ATR) multiplied by
SlAtrBuffer. ATR is a volatility measure of how far price typically moves per bar; here it is used only to size the protective buffer, never as an entry signal. - For a short trade, the stop is placed above the highest high of the three pattern candles, plus the same ATR-based buffer.
Take-profit logic:
- The distance between entry and stop is treated as one unit of risk ("R"). The take-profit is set at a multiple of that risk, defined by the
RewardRiskparameter. With the default of 2.0, the target sits twice as far from entry as the stop.
Trade management:
- Only one position per symbol is allowed at a time, so the strategy does not pyramid or open overlapping reversals. A new signal is ignored while a position is open.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| StarBodyFactor | 0.50 | 0.20 | 0.80 | Maximum size of the middle "star" candle's body relative to the leading impulse candle's body. Lower values demand a smaller, more decisive indecision candle. |
| ImpulseBodyFactor | 1.00 | 0.50 | 2.00 | Minimum body size of the lead and confirmation candles, expressed as a multiple of the average body over the lookback window. Higher values require stronger impulse candles. |
| ExtremeLookback | 20 | 5 | 50 | Number of prior bars used to define the swing extreme (support/resistance) the star must reach, and to compute the average candle body. |
| AtrPeriod | 14 | 5 | 30 | The Average True Range period used purely to size the protective-stop buffer. |
| SlAtrBuffer | 0.50 | 0.00 | 2.00 | Extra room placed beyond the pattern's extreme, expressed in ATR multiples. Larger values give the stop more breathing space. |
| RewardRisk | 2.00 | 1.00 | 4.00 | Take-profit distance as a multiple of the measured risk (the structural R-multiple). |
| Lots | 0.10 | 0.01 | 1.00 | The trade volume in lots used for each position. |

Recommended Chart Settings
The Star Pattern Reversal strategy was designed to be applied to a single symbol and timeframe at a time. Because it is a reversal approach that relies on clean, readable candlestick structure and identifiable swing extremes, it is generally studied on liquid instruments such as major forex pairs (for example, EUR/USD) on intraday-to-swing timeframes such as the H1 (1-hour) or H4 (4-hour) charts, where candle bodies tend to be more meaningful and noise is reduced relative to very low timeframes.
That said, no single setting is universally optimal. The behaviour of candlestick patterns and swing extremes varies considerably across instruments, sessions, and volatility regimes. Results will vary across different market conditions, and any chosen symbol or timeframe should be studied and tested thoroughly before drawing conclusions about how the strategy behaves.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
What to Consider Before Using This EA
Like any strategy, the Star Pattern Reversal has both strengths and limitations that are worth understanding before you study it on live or demo data.
Strengths of this approach:
- Confluence-based filtering. By requiring the star to form at a tested support or resistance level, the strategy aims to ignore the many mid-range star patterns that historically produce weaker signals. This focus on location is its central design idea.
- Defined, structural risk. Every trade has a pre-calculated stop based on the pattern's own extreme plus a volatility buffer, and a take-profit defined as a multiple of that risk. This makes the risk on each trade explicit before entry.
- Clear, symmetrical logic. The long and short rules are mirror images, which makes the strategy relatively easy to study, audit, and reason about.
Known limitations:
- Counter-trend by nature. Reversal strategies attempt to fade existing momentum. In strongly trending markets, support and resistance levels can break repeatedly, and a reversal signal may indicate a turn that does not materialise. The strategy may underperform during persistent trends.
- Pattern frequency. Demanding a strict three-candle structure and a fresh swing extreme is selective, so qualifying signals may be relatively infrequent. Fewer signals can mean longer periods without trades.
- Parameter sensitivity. The body-size factors, lookback length, and ATR buffer all influence which patterns qualify. Settings that suit one instrument or volatility regime may not transfer to another, so over-tuning to past data is a real risk.
- Whipsaw conditions. In choppy, low-conviction markets, the confirmation candle may trigger entries that are quickly reversed.
The goal of studying this EA is to understand how and when candlestick reversals at key levels tend to behave — not to assume any particular outcome.
Risk Management Tips
Sound risk management is what separates disciplined study from gambling. Whatever strategy you explore, the following general principles apply:
- Risk a small, fixed fraction per trade. A common educational guideline is to risk no more than 1–2% of account equity on any single position. Position sizing should follow from your stop distance, not the other way around.
- Use a demo account first. Always study a new strategy on a demo or simulated environment until you fully understand its behaviour, signal frequency, and drawdown characteristics.
- Understand drawdown. Even a well-designed strategy will experience losing streaks. Knowing the depth and duration of historical drawdowns helps you set realistic expectations and avoid abandoning a method at the worst moment.
- Keep position sizes proportionate. The
Lotsparameter directly controls exposure; larger sizes amplify both gains and losses. Size positions according to your account and risk tolerance, not your hopes for a single trade. - Diversify your study, not your risk. Avoid concentrating all activity in one correlated set of instruments at once.
Risk management is a skill in its own right, and it is at least as important as the entry logic itself.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: StarPatternReversal.ex5 (1 downloads)
- Source Code: StarPatternReversal.mq5 (1 downloads)
- Documentation: StarPatternReversal.pdf (1 downloads)