Skip to content
All library documents

Automating Trading Rules with Moving Average, RSI, and HILO Signals

Article MQL5 articles

Summary

This article shows how to adapt an MQL5 automation class to several indicator-driven trading models. Its first example uses a 9-period exponential moving average: the EA checks for a new bar, reads current and earlier indicator values, and triggers a buy or sell when the average rises or falls. Changing the comparison shift adjusts sensitivity. The article also sketches an alternative entry that places a pending order at the signal bar’s high or low, rather than entering at market.

Further examples apply the class to RSI and a HILO indicator calculated internally, illustrating how the same automation framework can support different signal logic. The focus is on implementation and event sequencing, not measured profitability. The author warns that indicator read errors can cause signals, including exits, to be missed, and says an EA should not be left unsupervised. The series concludes that automated systems need proper testing, including demo-account use; the attached examples are educational and may cause losses if used live.

Key ideas

  • A 9-period EMA signal compares the latest indicator value with an earlier value to determine direction.
  • Increasing the comparison shift can reduce how readily the EMA rule triggers.
  • A signal can be implemented as a pending order at the triggering bar’s high or low.
  • The automation class can be adapted to RSI and internally calculated HILO signals.
  • Indicator read failures may cause missed signals, so supervision and careful testing matter.

Tags

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