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
Views:
2937
Rating:
(19)
Published:
2012.01.18 13:45
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 CWPROnArray class is intended for calculation of Williams' Percent Range (%R) 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 aDataClose[] is the buffer with the Close data for the indicator calculation;
  • double aWPR[] is the buffer with calculated value of WPR.

Additional methods:

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

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

Williams’ Percent Range Technical Indicator (%R) is a dynamic technical indicator, which determines whether the market is overbought/oversold. Williams’ %R is very similar to the Stochastic Oscillator. The only difference is that %R has an upside down scale and the Stochastic Oscillator has internal smoothing.

An example of using the CWPROnArray class

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

IncBullsBearsOnArray IncBullsBearsOnArray

CBullsBearsOnArray class is designed for calculation of Bulls Power and Bears Power values on indicator buffers. The example of use of the class is provided.

Fine_Fractals_MTF Fine_Fractals_MTF

The indicator creates fractals from another larger timeframe on a current chart based on Fine_Fractals indicator data.

IncForceOnArray IncForceOnArray

The CForceOnArray class is intended for calculation of Force Index on indicator buffers.

IncVidyaOnArray IncVidyaOnArray

The CVidyaOnArray class is intended for calculation of VIDYA (Variable Index Dynamic Average) on an indicator buffer.