Skip to content
All library documents

Combining a Moving Average, RSI, and Stochastic for Entries and Exits

Article MQL5 code base

Summary

This expert-advisor description combines a 150-period moving average with short-period RSI and Stochastic readings. Price relative to the moving average sets the permitted direction: above it, the system considers buys; below it, sells. A buy requires RSI below 20 and Stochastic below 30, while a sell requires RSI above 80 and Stochastic above 70. It allows only one open trade per direction.

Positions are exited when Stochastic reaches the opposite threshold, with handling dependent on whether the trade is profitable or losing. A trailing-stop option moves the stop on new candles after the opposite threshold is reached; a separate loss allowance can close a position after a specified adverse move. The description gives no market, timeframe, backtest, or performance evidence. Indicator and point settings may need adjustment for quote precision, and the translated rules leave some implementation details unclear, so the approach requires careful validation before use.

Key ideas

  • The moving average determines whether the system considers long or short entries.
  • Long and short entries require RSI and Stochastic to reach matching extreme levels.
  • The system permits at most one open trade on each side.
  • Opposite Stochastic levels trigger exit management, with options for trailing stops or loss limits.
  • The document provides trading rules but no performance evidence, and quote precision can affect parameters.

Tags

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