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:
3161
Rating:
(22)
Published:
2012.01.18 14:23
Updated:
2017.09.06 10:12
\MQL5\Include\IncOnArray\ \MQL5\Indicators\
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

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

Usage:

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

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 aDataPrice[] is the buffer with price data for the indicator calculation;
  • double aDataVolume[] is the buffer with volume data for the indicator calculation;
  • double aForce[] is the buffer with calculated values of Force.
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_ForceOnArray.mq5 file is an indicator demonstrating how to use the CForceOnArray class. The IncForceOnArray file must be located in the MQL5\Include\IncOnArray directory of the terminal data folder (the IncOnArray folder must be created).

The CMAOnArray class for the IncMAOnArray file is required for this class for work.

Force Index Technical Indicator was developed by Alexander Elder. This index measures the Bulls Power at each increase, and the Bears Power at each decrease. It connects the basic elements of market information: price trend, its drops, and volumes of transactions. This index can be used as it is, but it is better to approximate it with the help of Moving Average. Approximation with the help a short moving average (the author proposes to use 2 intervals) contributes to finding the best opportunity to open and close positions. If the approximations is made with long moving average (period 13), the index shows the trends and their changes.


An example of using the CForceOnArray class


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

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.

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.

IncVidyaOnArray IncVidyaOnArray

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

3D_Oscillator_HTF_Signal 3D_Oscillator_HTF_Signal

3D_Oscillator_Signal shows a trend direction or a signal for performing a deal generated by 3D_Oscillator as text messages with a trend color indication or deal direction and gives alerts or audio signals.