How we can use iVolumes() indcator in Expert?

 
What is the usage of  iVolumes() in expert adviser? How we can utilize it? 
 
jafferwilson:
What is the usage of  iVolumes() in expert adviser? How we can utilize it? 
It could help in some strategies!
Some EAs comparing previous volume count by the current or the previous two volume values which is greater then do an action
 
Mohammad Soubra:
It could help in some strategies!
Some EAs comparing previous volume count by the current or the previous two volume values which is greater then do an action

Thank you for your reply. Can you please let me know when exactly can it be helpful? As I am willing to use it but could not understand when to.

 
You can  use two variables type double for  get the value of  the function ivoulme(,,,,shift) at bar1 and bar+1  
 
Exemple:,
int  short=1;
double volume1;
double voulume2;
if( iVolume(Symbole(),0,shift)!=0  && iVolume(Symbole(),0,shift+1)!=0)
{
volume1= iVolume(Symbole(),0,shift);
volume2= iVolume(Symbole(),0,shift+1);
}
// after you can  compare the  two variable volume 
 
Aliou Ba:
You can  use two variables type double for  get the value of  the function ivoulme(,,,,shift) at bar1 and bar+1  

data type doesn't have to be double(but no harm in storing it in double, but you might get a warning), since it does not return any floating point values, it returns whole number, if you use "long" instead of "double" you will not get an warning...

jafferwilson:

Can you please let me know when exactly can it be helpful? As I am willing to use it but could not understand when to.

It could be useful when taking volumes of other symbols or different time frames to the current one..(but you might have to handle few errors, Historical data errors )

 
Aliou Ba:
Exemple:,
int  short=1;
double volume1;
double voulume2;
if( iVolume(Symbole(),0,shift)!=0  && iVolume(Symbole(),0,shift+1)!=0)
{
volume1= iVolume(Symbole(),0,shift);
volume2= iVolume(Symbole(),0,shift+1);
}
// after you can  compare the  two variable volume 

What is shift value? What short used for?I am using MQL5 MT5. Please do let me know.

 
jafferwilson:

What is shift value? What short used for?I am using MQL5 MT5. Please do let me know.

In mql5 iVolume() returns the handle of the volume indicator.
 
Datatype for volumes should be long.
Reason: