Blog / Strategy
Strategy

RSI Failure Swing

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 RSI Failure Swing is a momentum-reversal strategy built around Wilder's Relative Strength Index (RSI), a classic oscillator that measures the speed and magnitude of recent price changes on a scale of 0 to 100. Unlike the common beginner approach of buying simply because RSI dips below 30, this strategy waits for a specific multi-step pattern on the RSI line itself — known as a "failure swing" — before it signals a potential turning point. By requiring the indicator to confirm its own structure before acting, the approach aims to be far more selective and to filter out many of the false signals that plague naive overbought/oversold rules.

This is a counter-trend, swing-style strategy. It is designed to look for moments when downward or upward momentum is structurally exhausting itself, rather than to chase an established trend. As such, it tends to be most interesting in markets that oscillate, range, or experience sharp pushes that then reverse — conditions where momentum exhaustion is a recurring theme. It runs on a single timeframe selected at backtest time and adapts its risk sizing to volatility using the Average True Range (ATR) indicator.

As a learning tool, the RSI Failure Swing is well suited to intermediate traders who already understand basic oscillator behavior and want to study how a disciplined, rules-based pattern can be encoded in software. It demonstrates the difference between a simple threshold cross and a genuine momentum-structure signal, and it offers a clean example of a finite state machine driving trade logic. It is best treated as a study in signal selectivity and risk framing — not as a shortcut to results.

How It Works

The strategy runs two mirrored detectors at the same time: one watching for bullish failure swings near the oversold zone, and one watching for bearish failure swings near the overbought zone. Each detector advances through phases as the RSI line evolves, and it only fires when the full pattern completes.

Bullish failure swing (signals a potential LONG):

Bearish failure swing (signals a potential SHORT):

How signals become trades:

RSI failure swing MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
RsiPeriod 14 5 30 Number of bars used to calculate the RSI oscillator. Lower values make RSI more reactive; higher values smooth it.
Oversold 30.0 15.0 40.0 RSI level that defines the oversold zone. The bullish failure swing forms around this threshold.
Overbought 70.0 60.0 85.0 RSI level that defines the overbought zone. The bearish failure swing forms around this threshold.
AtrPeriod 14 5 30 Number of bars used to calculate ATR, which drives stop-loss and take-profit distances.
SlAtrMult 1.5 0.5 4.0 Stop-loss distance as a multiple of ATR. Larger values give the trade more room but increase risk per trade.
TpAtrMult 2.5 0.5 6.0 Take-profit distance as a multiple of ATR. Together with SlAtrMult it sets the reward-to-risk ratio.
Lots 0.10 0.01 1.0 Fixed order volume (position size) submitted on each entry.

With the default settings, the take-profit distance (2.5× ATR) is larger than the stop distance (1.5× ATR), giving a reward-to-risk ratio of roughly 1.67 to 1 before spread and slippage.

RSI failure swing MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy is designed to run on a single timeframe selected at backtest time, applied to one symbol at a time. RSI failure swings are a general-purpose oscillator pattern, so the approach is not locked to a specific instrument — but liquid major forex pairs (for example EUR/USD) on intermediate intraday timeframes such as M15 to H1 are a sensible starting point for study, because they tend to produce cleaner oscillator structure than thin or highly news-driven markets.

You should treat any single configuration as a starting point only. Results will vary significantly across different symbols, timeframes, and market regimes. The same parameters that historically behaved well in a ranging environment may underperform in a strong, sustained trend. Always test on the specific instrument and timeframe you intend to study before drawing conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The failure-swing pattern is meaningfully more selective than a plain RSI threshold cross. By demanding a higher low (or lower high) on the oscillator plus a break of the fail point, the strategy waits for the indicator to confirm a genuine shift in momentum structure before committing. This selectivity can reduce the number of premature counter-trend entries. The ATR-based stop and target are another strength: they keep risk proportional to current volatility rather than using a fixed pip distance that may be far too tight or too loose as conditions change.

Known limitations. Like all RSI-based reversal logic, this is fundamentally a counter-trend method, and counter-trend strategies are vulnerable in strong, persistent trends. During a powerful directional move, RSI can remain "oversold" or "overbought" for a long time, and a higher-low signal may simply mark a pause before the trend resumes against the position. Because the pattern requires several stages to complete, signals can be relatively infrequent, which means fewer learning samples in a given period. The strategy also uses a fixed lot size and a single position per side, so it does not scale exposure to account equity on its own.

Where it may underperform. Choppy, low-volatility chop with no follow-through can trigger the pattern and then immediately stall, while sharp trending breakouts can run straight through the ATR stop. News spikes that gap past the stop level are another well-known hazard for any reversal system. None of this makes the approach invalid — it simply means the pattern is best understood as one tool with specific blind spots, to be studied and tested rather than relied upon blindly.

Risk Management Tips

Sound risk management matters far more than any single entry signal. As a general educational guideline, many traders aim to risk no more than 1–2% of account equity on any one trade, and they size positions accordingly rather than using a fixed lot for every account — the default Lots value here is a placeholder you should adjust to your own situation.

A few principles worth internalizing:

Risk management is the part of trading you control directly. A modest, consistent approach to position sizing and loss limits will protect your capital far better than chasing any individual setup.

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