MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Update to MetaTrader 4 build 722 and Test the VPS for Free
To post a new code, please log in or register

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2012.01.23 11:18

IncDeMarkerOnArray - library for MetaTrader 5

| English Russian Chinese Spanish Portuguese

votes: 10


CDeMarkerOnArray class is designed for calculation of DeMarker values on indicator buffers.


Init() method with the following parameters is called in the OnInit() function:

Solve() method with the following parameters is called in the OnCalculate() function:

  • const int aRatesTotal is a rates_total variable from the OnCalculate() function parameters;
  • const int aPrevCalc - prev_calculated variable from the OnCalculate() function;
  • double aDataHigh[] - the buffer with the High data for the indicator calculation;
  • double aDataLow[] - the buffer with the Low data for the indicator calculation;
  • double aP[] - intermediate buffer for a positive component;
  • double aM[] - intermediate buffer for a negative component;
  • double aPS[] - intermediate buffer for a smoothed positive component;
  • double aMS[] - intermediate buffer for a smoothed negative component;
  • double aDeMarker[] - the buffer with the indicator calculated value.
Additional methods:
  • int BarsRequired() - returns the minimum number of bars for the indicator calculation;
  • string Name() - returns the line with the indicator name;

Test_DeMarkerOnArray.mq5 is a sample indicator showing CDeMarkerOnArray class application. IncDeMarkerOnArray file must be placed to MQL5\Include\IncOnArray of the terminal data folder (IncOnArray folder must be created). CMAOnArray class from the IncMAOnArray file is needed for the proper work. It can be found here.

Demarker Technical Indicator (DeM) is based on the comparison of the current period maximum with the previous period maximum.



Translated from Russian by MetaQuotes Software Corp.
Original code: