Skip to content
All library documents

Building a Triple Screen Trading Framework with Moving Averages

Article MQL5 articles

Summary

This MQL5 tutorial adapts an existing expert advisor into a framework for a Triple Screen system. It uses moving averages on three configurable timeframes, with example defaults of weekly, daily, and four-hour screens. Each screen can be disabled by setting its indicator period to zero, allowing the framework to run with one, two, or three timeframes. The article describes separate indicator handles and buffers, plus logic to identify the shortest active timeframe for checking new bars and retrieving data.

The code changes focus on reusing existing trading functions while replacing the signal inputs and conditions. The tutorial then describes parameter optimization in the Strategy Tester and presents optimization charts and test graphs, but the supplied text gives no numerical performance results. It is therefore a software framework and testing walkthrough, not evidence that the Triple Screen strategy is profitable. The example uses moving averages for illustration and notes that other indicators could be substituted with code changes.

Key ideas

  • The framework evaluates moving-average signals across up to three independently configurable timeframes.
  • A screen can be omitted by setting its indicator period to zero.
  • The shortest active timeframe determines the new-bar check and data retrieval cadence.
  • Existing expert-advisor functions can be retained while changing indicators and signal logic.
  • The tutorial shows tester optimization outputs but provides no numerical evidence of strategy performance.

Tags

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