Join our fan page
- Views:
- 3333
- Rating:
- Published:
- 2012.01.18 14:23
- Updated:
- 2017.09.06 10:12
-
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:
- int aPeriod is indicator period;
- ENUM_MA_METHOD aMethod is a method of smoothing.
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.
- 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.
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/651
![IncWPROnArray](https://c.mql5.com/i/code/library.png)
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](https://c.mql5.com/i/code/library.png)
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](https://c.mql5.com/i/code/library.png)
The CVidyaOnArray class is intended for calculation of VIDYA (Variable Index Dynamic Average) on an indicator buffer.
![3D_Oscillator_HTF_Signal](https://c.mql5.com/i/code/indicator.png)
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.