Using MetaTrader 5 Indicator Tabs and OnCalculate Overloads
Summary
The article explains the standard configuration tabs available to MetaTrader 5 indicators and how compiler properties can customize the first tab with an icon, description, version, copyright, and link. It argues that developers should learn what the built-in interface already provides before adding extra input parameters, while noting that custom inputs may still be needed when the defaults do not fit the application.
It then introduces the indicator’s calculation event and its two overloaded OnCalculate signatures: one receives a single price array, while the other receives time, OHLC, volume, and spread arrays. The chosen signature affects which default tab is shown and what data the indicator can use. The article also discusses using rates_total and prev_calculated to limit recalculation to new or changed bars, reducing work on later calls. It is an introductory programming explanation rather than a trading strategy, and the excerpt does not provide quantitative performance tests or evidence that one signature is universally preferable.
Key ideas
- Compiler properties can customize the indicator’s standard information tab.
- MetaTrader 5 indicators use OnCalculate to handle calculation events.
- The two OnCalculate overloads provide different input data and affect which default tab appears.
- Using the previous and current bar counts can limit repeated calculations.
- Calculation events follow price changes, so inefficient code can consume resources during active markets.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.