Skip to content
All library documents

Moving-Average Expert Advisor with Price Thresholds and Reversed Signals

Article MQL5 code base

Summary

This document describes an expert advisor that trades relative to a moving average and holds at most one market position. With reversed signals disabled, it opens a buy when the ask price is above the moving average on the current bar by a configurable distance, or opens a sell when the bid is below the average by that distance. The distance is called MA delta, and the advisor includes a setting to reverse signals.

The description says closing signals also depend on the reversal setting, but the actual closing rules are absent from the supplied text. It gives no details about position sizing, stop losses, execution assumptions, or how the moving average is configured. There are no backtest results or other performance evidence. As presented, this is an outline of price-versus-average entry logic rather than a complete, reproducible trading strategy; the missing exit rules make its position lifecycle unclear.

Key ideas

  • The advisor uses price relative to a moving average to generate entries.
  • A configurable MA delta sets the distance between price and the average for entry conditions.
  • With normal signals, ask above the average triggers a buy condition and bid below it triggers a sell condition.
  • The advisor supports reversing its signals and allows no more than one open position.
  • The provided description omits the actual closing rules and contains no performance evidence.

Tags

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