Skip to content
All library documents

Calculating Triple Exponential Moving Averages with a Ring Buffer

Article MQL5 code base

Summary

This document describes an MQL5 class for calculating the Triple Exponential Moving Average (TEMA) with a ring buffer. It outlines initialization options such as the period, smoothing method, buffer size, and series orientation, then describes methods for processing a full array or individual values. The ring buffer exposes the calculated TEMA values and also provides access to associated moving-average and double-exponential-moving-average results.

The examples show how an indicator can update calculations during an OnCalculate call and copy values from the buffer into chart indicator buffers. The document notes that ring-buffer indexing follows time-series order and refers to example indicators for array-based and value-based use. This is a programming reference for implementing and drawing an indicator, not a trading rule or evidence that TEMA signals are profitable. Its practical use also depends on the surrounding MQL5 classes and compatible setup described in the source.

Key ideas

  • The class calculates TEMA incrementally using a ring buffer.
  • Initialization sets the period, smoothing method, buffer capacity, and series orientation.
  • Calculations can process an array or a single value, and the buffer provides TEMA, MA, and DEMA data.
  • The examples demonstrate copying ring-buffer results into chart indicator buffers with time-series indexing.
  • The document explains implementation mechanics but gives no evidence of trading performance.

Tags

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