Skip to content
All library documents

EMA and RSI Rules for a Mean-Reversion Signal EA

Article MQL5 articles

Summary

The article describes an MQL5 expert advisor that flags potential mean-reversion setups using a 50-period exponential moving average and the Relative Strength Index. It signals a possible buy when price is below the EMA and RSI is at or below 30, and a possible sell when price is above the EMA and RSI is at or above 70. The EA draws arrows and displays a chart summary rather than automatically placing trades.

The design also includes an ATR-based approach to stop-loss and take-profit levels, placing the target near the EMA, plus a cooldown between signals to reduce repeated alerts. The article explains the indicator logic and code structure, but the supplied excerpt gives no quantitative performance results or detailed test methodology. These rules assume that large deviations from the EMA will reverse; persistent trends can instead keep price extended, so the signals and risk settings need independent testing before use.

Key ideas

  • The EA treats price deviations from a 50-period EMA as potential opportunities for reversion toward that average.
  • A buy alert requires price below the EMA and RSI at or below 30; a sell alert requires price above the EMA and RSI at or above 70.
  • ATR informs stop-loss and take-profit placement, with the target set near the EMA.
  • A cooldown limits repeated signals, while chart arrows and text provide visual alerts rather than automated execution.
  • The article provides no measured strategy performance, and sustained trends may invalidate the reversion assumption.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.