Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Libraries | CDonchian class

Uses the idea of ​​the classical Donchian channel.

The class is optimized by speed, i. e. instead of 2 for loops, 1 while loop is executed.

The class sample requires the following: 

  • Fill in the arrays: double in_masH[], double in_masL[];
  • Set variable values: int in_period (number of bars in the period), int in_size (size of arrays);
  • Perform the procedure ini() to initialize the arrays;
  • Perform the procedure void main(), which forms 2 arrays (channels): double out_massH[],double out_massL[],

An example of class use is available in the indicator Donchian.mq5

MetaTrader Experts, Indicators, Scripts and Libraries

2271

Best MetaTrader Indicators + Profitable Expert Advisors