Skip to content
All library documents

Implementing Flexible Technical Indicators with MQL5 Vectors

Article MQL5 articles

Summary

This article shows how to calculate technical indicators directly from input vectors in MQL5, giving developers control over the data series supplied to each calculation. It contrasts this approach with built-in indicator handles, which use predefined price inputs and smoothing options. The examples cover simple and exponential moving averages and Bollinger Bands, with further trend indicators and oscillators listed as part of the broader collection. Results are returned as vectors or, for multi-band indicators, a structure containing several vectors.

A small numeric example demonstrates the moving average output, and the article explains that vector calculations can help collect indicator values for analysis and machine-learning work. The method’s flexibility comes with implementation responsibility: the examples include parameter checks, but the article does not provide trading rules or evidence that custom indicators improve performance. It also notes that some smoothing methods are not implemented, and the supplied text cuts off during the Bollinger Bands implementation.

Key ideas

  • MQL5 vector functions can calculate indicators from custom input series rather than fixed price constants.
  • The simple moving average averages each rolling window and leaves earlier values undefined.
  • The exponential moving average seeds its calculation with a simple moving average and then weights newer observations more heavily.
  • Bollinger Bands can return upper, middle, and lower series in a single result structure.
  • The approach is presented mainly for flexible data collection and analysis, not as a tested trading strategy.

Tags

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