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

IncBullsBearsOnArray - library for MetaTrader 5

Views:
3663
Rating:
(21)
Published:
2012.01.18 13:43
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

CBullsBearsOnArray class is designed for calculation of Bulls Power and Bears Power values on indicator buffers.

Usage:

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

  • int aPeriod - indicator period;
  • ENUM_MA_METHOD aMethod - smoothing method.

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 aDataClose[] - the buffer with the Close data for the indicator calculation;
  • double & aMA[] - intermediate buffer for MA calculation;
  • double & aBulls[] - Bulls Power calculated value;
  • double & aBears[] - Bears Power calculated value.

Additional methods:

  • int BarsRequired() - returns the minimum number of bars for the indicator calculation;
  • string BuName() - returns the line with Bulls Power indicator name;
  • string BeName() - returns the line with Bears Power indicator name;

Test_BullsBearsOnArray.mq5 is a sample indicator showing CBullsBearsOnArray class application. IncBullsBearsOnArray 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.

It is very important to be able to estimate the Bulls and Bears Power balance since changes in this balance initially signalize about possible trend reversal. This task can be solved using the Bulls Power and Bears Power oscillators developed by Alexander Elder and described in his book titled Trading for a Living.

Example of use of CBullsBearsOnArray class

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

Fine_Fractals_MTF Fine_Fractals_MTF

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

BrainTrend_HTF_Signal BrainTrend_HTF_Signal

BrainTrend_HTF_Signal displays trend directions from the last bars of the BrainTrend1 and BrainTrend2 as a sequence of graphical objects. The number of bars to be used is set in the input parameters.

IncWPROnArray IncWPROnArray

The CWPROnArray class is intended for calculation of Williams' Percent Range (%R) on indicator buffers. The example of use of the class is provided.

IncForceOnArray IncForceOnArray

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