Skip to content
All library documents

Building an MQL5 Trend EA with RSI and Moving Average Signals

Article MQL5 articles

Summary

This tutorial explains how to turn a candlestick trend indicator and a manually applied risk/reward tool into a standalone MetaTrader 5 Expert Advisor. It outlines the EA lifecycle, including initialization, tick processing, trade events, tester callbacks, and chart events, then describes how indicator and trade functions fit into that structure.

The entry logic combines the daily candle direction with lower-timeframe signals: RSI oversold and a fast moving average crossing above a slow one for a long setup; the reverse conditions support a short setup. The article says the EA placed orders in the Strategy Tester, but supplies no performance statistics. It also acknowledges that entry logic needs refinement and that the version discussed lacks a magic number, which caused it to affect other orders on a demo account. The result is a development walkthrough, not evidence of a profitable strategy.

Key ideas

  • The EA combines daily candle direction with lower-timeframe RSI and moving average signals.
  • OnInit prepares indicators and variables, while OnTick evaluates market conditions and trade logic.
  • Trade and tester callbacks provide places to manage orders and evaluate custom optimization criteria.
  • The article reports order execution in the Strategy Tester but provides no profitability measurements.
  • Without a magic number, the EA may affect trades that it did not open.

Tags

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