Blog / Strategy
Strategy

Twilight Star Reversal

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 Twilight Star Reversal is a pure price-action reversal strategy built around the three-candle Morning Star and Evening Star candlestick patterns — two of the most widely studied reversal formations in technical analysis. Unlike many automated strategies that lean on moving averages, oscillators, or other lagging indicators, this approach uses no indicators at all. Every decision it makes comes from raw candle bodies, wicks, and recent swing highs and lows. A "swing high" is simply the highest price reached over a recent window of bars, and a "swing low" is the lowest; the strategy uses these as structural reference points instead of an indicator line.

The Morning Star and Evening Star patterns are valued by traders because they bake confirmation directly into the formation. A reversal candle by itself can be a false alarm, but these patterns require a three-step story to unfold: an exhaustion move, a moment of indecision, and then a commitment candle pushing back the other way. The Twilight Star Reversal only acts when that full sequence appears at a meaningful extreme of price — a genuine swing low for longs, or a genuine swing high for shorts.

This makes the strategy most relevant as a swing-reversal / counter-exhaustion learning tool. It is designed for traders who want to study how classic candlestick theory can be expressed in objective, rule-based code rather than subjective chart reading. It is best suited to those learning about price structure and pattern recognition, not to anyone seeking a hands-off shortcut. As with any reversal method, it aims to identify potential turning points — which, by definition, can be wrong until price confirms.

How It Works

The strategy evaluates the chart once per newly closed bar and looks at the three most recently completed candles, labelled A (oldest), B (the "star"), and C (most recent). It only considers a new trade when there is no existing position open under its magic number.

The strategy signals a long (Morning Star) when:

The strategy signals a short (Evening Star) when the mirror image appears at a fresh swing high:

Stop-loss logic: The stop is placed on the pattern's structure. For longs, it sits just below the lowest low of the three candles; for shorts, just above the highest high. A buffer is added beyond that extreme, sized as BufferFrac multiplied by the full pattern range, so the stop allows a little room past the structural level.

Take-profit logic: The strategy measures the risk (the distance from entry to stop) and sets the take-profit at a fixed multiple of that distance, defined by RiskReward. With the default of 2.0, the target is twice the risk away from entry. This keeps every trade on a consistent, structurally derived risk/reward framework rather than a fixed pip target.

If the calculated risk is zero or negative (an unusual price condition), the strategy simply skips the trade.

Twilight Star Reversal MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.00 Fixed trade size in lots for each position the strategy opens.
SwingLookback 10 3 40 Number of bars used to define the swing window; the pattern must print the window's extreme low (long) or high (short).
RiskReward 2.0 1.0 5.0 Take-profit distance as a multiple of the structural stop distance. At 2.0, the target is twice the risk.
StarBodyRatio 0.50 0.10 0.90 Maximum size of the middle "star" candle's body relative to the average body of the outer candles. Lower values demand a smaller, more decisive star.
BufferFrac 0.10 0.00 1.00 Extra stop distance beyond the pattern extreme, expressed as a fraction of the pattern's total range.

A Magic number (default 7003) is also used internally to tag and identify the strategy's own positions so it manages only its own trades.

Recommended Chart Settings

The Twilight Star Reversal was designed with EUR/USD or XAU/USD (gold) on the H1 (1-hour) timeframe in mind, though its logic is symbol- and timeframe-agnostic and can be tested on any liquid instrument. The H1 timeframe gives each candle enough trading activity to make the Morning Star / Evening Star sequence meaningful, while still producing setups frequently enough to study.

Keep in mind that candlestick patterns behave differently across instruments and sessions. Results will vary across different market conditions, spreads, and volatility regimes, so any timeframe or symbol change should be evaluated independently before being relied upon.

Historical Backtest Results

Note: The figures below are from a historical backtest simulation. Backtests have inherent limitations — they do not account for slippage, requotes, spread widening, or psychological factors. These results should not be interpreted as a prediction of future performance.

No backtest data is currently available for this strategy. When a historical simulation has been completed, key metrics — such as net profit, profit factor, win rate, maximum drawdown, and total trades — will be published here using the real simulation figures. Until then, no performance numbers are claimed, and you are encouraged to run your own backtest in the MetaTrader 5 Strategy Tester across multiple market conditions to form your own view.

How to Install on MetaTrader 5

If you prefer to inspect or modify the logic, the TwilightStarReversal.mq5 source can be opened in MetaEditor and compiled to produce your own .ex5.

What to Consider Before Using This EA

Strengths of this approach. Because the Twilight Star Reversal uses no indicators, its logic is transparent and easy to study — every entry can be traced back to specific candle relationships you can see on the chart. The requirement that the pattern print a genuine swing extreme filters out many mid-trend formations, and placing the stop on the pattern's structure keeps risk objectively defined rather than arbitrary.

Known limitations. Reversal strategies, by nature, attempt to trade against the prevailing move, which means they can be repeatedly stopped out during strong, sustained trends that simply do not reverse. Candlestick patterns can also appear visually "perfect" yet still fail, particularly around news events or in thin liquidity. The fixed risk/reward target means winning trades are capped at a preset multiple even if price would have continued much further, and the fixed lot size does not scale with account equity or volatility.

Where it may underperform. Choppy, low-volatility ranges can produce many small stars that pass the body-ratio filter without leading to real reversals, and trending markets can keep printing fresh swing extremes that invalidate the counter-trend premise. As with any single-pattern system, performance is highly dependent on the symbol, timeframe, broker spread, and the market regime in effect.

Risk Management Tips

Sound risk management matters more than any single entry signal. As a general educational guideline, many traders limit the risk on any one trade to 1–2% of account equity, sizing their lots so that a stop-loss hit stays within that limit rather than using a fixed lot size blindly. Before committing real capital, it is wise to run the strategy on a demo account to understand how it behaves through different conditions.

Pay attention to drawdown — the peak-to-trough decline in account value — because even a strategy with a sound logic can experience extended losing streaks. Understanding the maximum drawdown you are emotionally and financially prepared to tolerate helps you decide whether a strategy fits your plan. Never trade with money you cannot afford to lose, and treat any automated tool as something to supervise and understand, not to set and forget.

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

← Back to Blog