- Strategy
- Buys when RSI closes back above the oversold level and sells when it closes back below the overbought level, optionally only on the side of the 200 EMA. The take-profit is the 20-period moving average.
- Risk model
- 1% of balance per trade (configurable), ATR-based stop-loss on every order, one position at a time
What it does
RSI Reversal EA trades the moment momentum turns back from an extreme. Instead of buying as soon as RSI drops below 30, it waits for RSI to close back above the level, which shows that selling pressure has started to fade. The trade then aims for the average price of recent bars rather than for a new trend.
An optional 200 EMA filter keeps the EA on the side of the larger trend, so in an uptrend it only buys oversold dips and in a downtrend it only sells overbought rallies.
How it works
On each new bar the EA reads the last two closed bars:
- Buy: RSI on the previous bar was below the oversold level and RSI on the last closed bar is at or above it.
- Sell: RSI on the previous bar was above the overbought level and RSI on the last closed bar is at or below it.
- Trend filter (optional): a buy needs the close above the 200 EMA, a sell needs it below.
- Stop-loss: entry price minus (or plus) 1.5 × ATR(14).
- Take-profit: the value of the 20-period SMA on the signal bar.
- Reward check: if the distance to the SMA is less than 0.8 × the stop distance, the signal is skipped because the target is too close to justify the risk.
An optional exit closes the trade early when RSI crosses back through 50 against it. Position size comes from the stop distance and your risk percentage, using the symbol's tick value and tick size.
How to use it
The idea works best in ranges or in steady trends with orderly pullbacks. On H1 and H4 the signals are less frequent and less affected by spread. Read the RSI lesson if you are new to the indicator, and check your lot sizes with the Position Size Calculator.
The Experts log explains every skipped signal: outside trading hours, spread too wide, trend filter against the trade, or a target too close.
Settings
| Input | Default | What it changes |
|---|---|---|
| RSI period | 14 | Sensitivity of the RSI |
| Oversold / Overbought level | 30 / 70 | Extremes that must be left to trigger a trade |
| Trend filter / Trend EMA period | true / 200 | Restricts trades to the trend side |
| Mean (SMA) period | 20 | Take-profit level |
| Stop-loss distance (x ATR) | 1.5 | Stop size |
| Skip if distance to the mean < this x stop | 0.8 | Minimum reward relative to risk |
| Close when RSI crosses 50 | false | Optional early exit |
| Risk per trade / Fixed lots | 1.0% / 0 | Position sizing |
| Max spread (points) | 30 | Spread filter |
| Trading start / end hour | 7 / 20 | Server-time window for new trades |
| Break-even / Trailing | on / off | Stop management after the trade moves in profit |
Limitations
In a strong trend RSI can leave an extreme and return to it quickly, so the stop is hit before the mean is reached. The trend filter reduces this but cannot remove it. Because the target moves with the average, a fixed take-profit set at entry may be slightly away from the live average later. Results depend heavily on spread and on the timeframe chosen.
Before you run it live
Test it in the MT5 Strategy Tester on several years of data and more than one symbol, then run it on a demo account for a few weeks. Make sure the trading hours match your broker's server time, set a spread limit that suits the symbol, and keep the risk per trade small. Read basic risk management before going live. Past behavior does not guarantee future results.

