Skip to content
All library documents

Displaying Simple Moving Averages from Two Timeframes on One Chart

Article MQL5 code base

Summary

This brief indicator description explains how to display two simple moving averages on a single chart: one calculated for the chart’s current timeframe and another for a timeframe selected through an input. The user sets the moving-average period and the second timeframe. Examples refer to viewing a four-hour average on hourly, thirty-minute, and fifteen-minute charts.

The material explains the indicator’s inputs and display purpose, but gives no trading rules, entry or exit signals, or performance evidence. It does not specify how values from the higher timeframe are aligned or refreshed on lower-timeframe bars, nor does it discuss whether the averages are used for trend confirmation or another analytical purpose. It is therefore a narrow charting tool description rather than an evaluated strategy.

Key ideas

  • The indicator plots one simple moving average for the chart timeframe and another for a chosen timeframe.
  • Its inputs control the moving-average period and the timeframe of the second average.
  • The examples show a four-hour moving average displayed on shorter charts.
  • No trading rules or performance results are provided.

Tags

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