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 Indicator | Channel design indicator

  • Application

The indicator can be utilized into any symbol or timeframe, there are no restrictions.

For the creation of the channel are required the definition of two inputs:

//--- input parameters  input int barsChannel = 200; // Channel creation length  input int barsMulti   = 5;   // Channel bars to peak/valley

The "barsChannel" input defines the length of the channel that will be created, or, in other words, the number of bars that composes the channel.

The "barsMulti" input represents the amount of bars that are taken into account for the evaluation of peaks and valleys. The total number of bars that are considered in this evaluation is equal to 'barsMulti*2 + 1' (e.g. if barsMulti = 2, the total number of bars considered is 5).

MetaTrader Experts, Indicators, Scripts and Libraries

Figure 1. Parameterization

Two indicator buffers are defined, one per trendline. The resistance buffer index is set as '0', while the support buffer index is set as '1'. Remember to consider this during the indicator reading process.

//--- indicator buffers mapping     SetIndexBuffer(0,resiBuffer,INDICATOR_DATA);     SetIndexBuffer(1,suppBuffer,INDICATOR_DATA);
23132