Skip to content
All library documents

Combining Daily Candle Constraints, RSI, and Trend Following in an Expert Advisor

Article MQL5 articles

Summary

This article develops an MQL5 Expert Advisor that uses the current daily candle to constrain trade direction and a lower-timeframe RSI to time entries. A bullish daily candle permits long setups when RSI is oversold; a bearish candle permits short setups when RSI is overbought. The example also closes positions when the daily direction reverses, applies stop-loss, take-profit, and trailing-stop rules, and introduces magic numbers to distinguish strategies.

The article surveys several well-known strategy families but implements only a trend-following component, using moving averages to identify market direction. It includes a correction to an integer type warning and shows tester material for the system, including a Boom 500 index example. The evidence is not a controlled performance study: the text gives limited detail about test assumptions, and it does not establish robustness across markets or periods. The other discussed strategies remain prospective additions rather than tested parts of this Expert Advisor.

Key ideas

  • The daily candle’s direction acts as a higher-timeframe constraint on lower-timeframe entries.
  • RSI oversold and overbought readings are used to time entries aligned with the daily direction.
  • The Expert Advisor includes position exits on trend changes and trailing-stop management.
  • Moving averages are introduced as a trend-following component, while other surveyed strategies are not implemented.
  • The tester example is not enough to establish that the approach generalizes across markets or time periods.

Tags

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