Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Vues:
3721
Note:
(22)
Publié:
2012.01.20 08:29
Mise à jour:
2016.11.22 07:32
\MQL5\Include\IncOnArray\ \MQL5\Indicators\
Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

The COBVOnArray class is intended for calculation of OBV (On Balance Volume) on indicator buffers.

Usage:

The Init() method with an optional parameter is called in the OnInit() function:

  • int aPeriod is indicator period. If the value is set to 0 (default), the indicator will work like the one included in the client terminal - it will be calculated for all bars of the chart. Any other positive value sets the number bars of used for calculation of value for each bar (moving average principle).

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 aDataClose[] is the buffer with the Close data for the indicator calculation;
  • double aDataVolume[] is the buffer with the Volume data for the indicator calculation;
  • double & aOBV[] is the buffer with calculated value.

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_OBVOnArray.mq5 file is an indicator demonstrating how to use the COBVOnArray class. The IncOBVOnArray file must be located in the MQL5\Include\IncOnArray directory of the terminal data folder (the IncOnArray folder must be created).

On Balance Volume Technical Indicator (OBV) is a momentum technical indicator that relates volume to price change. The indicator, which Joseph Granville came up with, is pretty simple. If the close price of the current bar is higher than that of the previous bar, the volume of the current bar is added to the previous OBV. If the current bar close price is lower than of the previous one, the current volume is subtracted from the previous OBV.

An example of using the CObvOnArray class

Traduit du russe par MetaQuotes Ltd.
Code original : https://www.mql5.com/ru/code/672

IncCHVOnArray IncCHVOnArray

The CCHOOnArray class is intended for calculation of the Chaikin Volatility indicator (CHV) on indicator buffers.

IncFractalsOnArray IncFractalsOnArray

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

IncFramaOnArray IncFramaOnArray

The CFramaOnArray class is intended for calulcation of Fractal Adaptive Moving Average (FRAMA) on indicator buffers.

Heiken_Ashi_Smoothed_HTF_Signal Heiken_Ashi_Smoothed_HTF_Signal

Heiken_Ashi_Smoothed_HTF_Signal displays trend direction as a sequence of graphical objects, the trend is determined by Heiken_Ashi_Smoothed indicator.