Download MetaTrader 5
To add comments, please log in or register
Documentation is available in CHM and PDF. Download it in any convenient form!
Brian Kester
794
Brian Kester 2014.04.17 16:37 

Hi i am a new programmer. Can someone please give me an answer to why I would use "Long" as integer type rather than "int" when creating ivolume variable?

I speculate the reason is because int type is 4 bytes and Long type is 8 bytes...... but that should not make a difference for Volume. So why?

int

The size of the int type is 4 bytes (32 bits). The minimal value is -2 147 483 648, the maximal one is 2 147 483 647.

long

The size of the long type is 8 bytes (64 bits). The minimum value is -9 223 372 036 854 775 808, the maximum value is 9 223 372 036 854 775 807.

long iVolume(
string symbol, // symbol
int timeframe, // timeframe
int shift // shift
);

Thanks!

whroeder1
13619
whroeder1 2014.04.17 17:01  
c3po:.. but that should not make a difference for Volume. So why?
Because mqlRates.real_volume is traded volume must be long. iVolume and Volume[] is tick count but could be either.
Brian Kester
794
Brian Kester 2014.04.17 17:12  

Thanks friend.

So, can use ivolume(EURUSD,0,0) and find the total volume so far for current candle?

/
To add comments, please log in or register