Skip to content
All library documents

Three Simple Moving Averages for Tick-by-Tick Trade Signals

Article MQL5 code base

Summary

This document describes an expert advisor built around three simple moving averages, evaluated on every market tick. It opens a buy when the first average is above the second and the second is above the third by a specified spread threshold. It opens a sell under the reverse ordering, using values from the current bar. The strategy therefore uses a stacked moving-average arrangement to define directional conditions.

The advisor ignores a new signal in a direction if it already has a position in that direction. It closes buys when the first and second averages converge past a threshold, and closes sells when they diverge in the opposite direction. The description provides no moving-average periods, asset or timeframe context, stop rules, backtest results, or performance evidence. Since signals use the current bar and are checked tick by tick, behavior may depend on intrabar price changes; the document does not discuss execution costs or risk controls.

Key ideas

  • The advisor uses three simple moving averages and checks their values on each tick.
  • A buy requires the three averages to be ordered from highest to lowest with specified spacing.
  • A sell requires the reverse ordering, also with specified spacing.
  • It prevents opening another position in a direction when one already exists in that direction.
  • Exit conditions compare the first and second averages, but the document gives no performance evidence or risk framework.

Tags

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