How we can use iVolumes() indcator in Expert?

To add comments, please log in or register
jaffer wilson
769
jaffer wilson  
What is the usage of  iVolumes() in expert adviser? How we can utilize it? 
soubra2003
31844
soubra2003  
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
jaffer wilson
769
jaffer wilson  
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.

Aliou Ba
194
Aliou Ba  
You can  use two variables type double for  get the value of  the function ivoulme(,,,,shift) at bar1 and bar+1  
Aliou Ba
194
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 
Lakshan Perera
5725
Lakshan Perera  
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 )

jaffer wilson
769
jaffer wilson  
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.

Lakshan Perera
5725
Lakshan Perera  
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.
Marco vd Heijden
Moderator
8175
Marco vd Heijden  
Datatype for volumes should be long.
To add comments, please log in or register