MQL4 Custom Indicators: Buffers, Display Properties, and Basic Construction
Summary
This beginner tutorial explains how MQL4 custom indicators represent and display calculated values. It contrasts chart-window indicators such as moving averages with subwindow indicators such as Williams’ Percent Range, then covers display ranges, colors, line styles, histograms, symbols, and indicators that plot several series. It describes data buffers as arrays aligned to chart bars, including buffers used for intermediate calculations, and notes the platform’s limit on displayed buffers.
The article walks through creating an indicator with MetaEditor’s wizard, setting user-configurable inputs and display properties, and understanding generated declarations. It then demonstrates simple indicator examples, including arrow signals, and introduces indicator functions such as iCustom. The emphasis is on programming mechanics and readable code practices, not on developing or validating a profitable signal. The sample indicators are explicitly presented as instructional exercises, so readers should not treat their outputs as evidence of trading value.
Key ideas
- Indicator buffers store values aligned with individual chart bars and can also support intermediate calculations.
- An indicator can appear over the price chart or in a separate window depending on its value scale and purpose.
- MQL4 indicators support line, histogram, and symbol-style displays with configurable properties.
- The MetaEditor wizard generates a starting structure with user inputs, buffer declarations, and display settings.
- The examples teach indicator construction and coding style rather than establish trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.