IVolume vs iTickVolume ve iRealVolume

 

Hi, I'm a little confused about what exactly these functions return.

If I understand correctly:

- iTickVolume returns the count of ticks used to build a bar. It is also passed by onCalculate with the "tick_volume" array. It's also shown in the data window as "Tick volume". Right?

- IRealVolume returns the sum of the "volume" fields of the ticks used to build the bar? Or does it return the sum of the "volume_real" fields of the ticks?
  This value is shown with the "Volume" label in the Data Window, it is passaded by onCalculate with the "volume" array, and can it also be obtained through CopyRealVolume, right?

- Latest, iVolume, seems a duplicate of iTickVolume or am I missing something?


Thanks

 

iVolume() and iTickVolume() are the same thing, and the reason is for backwards compatibility with MQL4 which used iVolume().

"Tick volume" is a count of ticks while "Real volume" is the real volume transacted on the exchange. Forex and CFDs don't have real volume (only tick volume), while for example, Futures and Stocks have both.

 
Fernando Carreiro #:

iVolume() and iTickVolume() are the same thing, and the reason is for backwards compatibility with MQL4 which used iVolume().

"Tick volume" is a count of ticks while "Real volume" is the real volume transacted on the exchange. Forex and CFDs don't have real volume (only tick volume), while for example, Futures and Stocks have both.

Thanks for iVolume explanation.

About IRealVolume. In ticks we have two fileds, "volume" and "volume_real". In bars we only have "volume". So my question is, bars "volume" is relative (i suppose a sum of) to ticks "volume" filed or to ticks "volume_real" filed? It's not explained in documentation.

 
antony23 #In ticks we have two fileds, "volume" and "volume_real". In bars we only have "volume".

No, please refer to the documentation ...

Tick data — MqlTick — Documentation on MQL5: Price Data Structure / Constants, Enumerations and Structures

ulong  volume;      // Volume for the current Last price
double volume_real; // Volume for the current Last price with greater accuracy

Bar data — MqlRates — Documentation on MQL5: History Data Structure / Constants, Enumerations and Structures

long tick_volume;  // Tick volume
long real_volume;  // Trade volume
 

You are right!

So, what is exact this "trade volume?" How it is calculated?

 
antony23 #So, what is exact this "trade volume?" How it is calculated?
That depends on the symbol and the type of exchange. For example, for Futures it could be the number of contracts.