Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Libraries

IncPriceChannelOnArray - library for MetaTrader 5

Views:
3118
Rating:
(28)
Published:
2012.01.19 13:44
Updated:
2016.11.22 07:32
\MQL5\Include\IncOnArray\ \MQL5\Indicators\
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The CPriceChannelOnArray class is intended for calculation of the price channel on indicator buffers.

Usage:

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

  • int aPeriod is indicator period.

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

  • const int aRatesTotal is the rates_total variable from the OnCalculate() function parameters;
  • const int aPrevCalc is the prev_calculated variable from the OnCalculate() function parameters;
  • double aDataHigh[] is the buffer with the High data for the indicator calculation;
  • double aDataLow[] is the buffer with the Low data for the indicator calculation;
  • double & aUpper[] is a calculated value of the upper line of the indicator;
  • double & aLower[] is a calculated value of the lower line of the indicator;
  • double & aMiddle[] is a calculated value of the central line of the indicator.

Additional methods:

  • int BarsRequired() returns the minimum number of bars required for the indicator calculation;
  • string Name() returns a string with the indicator name.

The Test_PriceChannelOnArray.mq5 file is an indicator demonstrating how to use the CPriceChannelOnArray class. The IncPriceChannelOnArray file must be located in the MQL5\Include\IncOnArray directory of the terminal data folder (the IncOnArray folder must be created).

The market is often accelerates and decelerates its movements, so it's not easy to draw the straight lines of support and resistance levels. The Price Channel Indicator draws the price channel, its upper and lower boundaries are determined by maximal and minimal prices for a certain period.

An example of using the CPriceChannelOnArray indicator

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/637

IncEnvelopesOnArray IncEnvelopesOnArray

The CEnvelopesOnArray class is intended for calculation of Envelopes on an indicator buffer.

IncVHFOnArray IncVHFOnArray

CVHFOnArray class is designed for calculation of Vertical Horizontal Filter (VHF) values on indicator buffers.

IncTrixOnArray IncTrixOnArray

The CTrixOnArray class is intended for calculation of Triple Exponential Average (TRIX) on an indicator buffer.

IncFractalsOnArray IncFractalsOnArray

The CFractalsOnArray class is intended for calculation of Fractals on indicator buffers.