////////////////////////////////////////////////////////////////
long volu(int CC)
{
long volumes[];
CopyTickVolume(Symbol(),0,CC,1,volumes);
return(volumes[0]);
}
Hi,
is there an equivalent for Open[], High[], .. Volume[] of MQL4 in MQL5?
...Forum on trading, automated trading systems and testing trading strategies
How to get the OHLC of the last 1 min bar?
Alain Verleyen, 2016.11.09 23:04
With CopyXXX() functions. CopyRates() will give you OHLC.if(CopyRates(Symbol(),PERIOD_M1,0,1,rates)!=1) { /*error processing */ };
/* USAGE: rates[0].open ; rates[0].high ; rates[0].low ; rates[0].close */
So this means there are no array of values which I directly can access like Volume[i].
I have to have a dynamic array which will be resized and I have to loop though this dynamic array - correct?
So this means there are no array of values which I directly can access like Volume[i].
I have to have a dynamic array which will be resized and I have to loop though this dynamic array - correct?
Yes and no.
It doesn't have to be a dynamic array, but yes there no "direct access" like in mql4.
You don't have to loop to find a minimum, maximum, you can use ArrayMinimum(), ArrayMaximum() functions. (By the way these functions exist also in mql4).
Yes and no.
It doesn't have to be a dynamic array, but yes there no "direct access" like in mql4.
You don't have to loop to find a minimum, maximum, you can use ArrayMinimum(), ArrayMaximum() functions. (By the way these functions exist also in mql4).
Thanks to all of you - even though it is not totally what I was looking for.
ok - but either me in one loop or ArrayMinimum() and ArrayMaximum() in two separate loops have to do that.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
is there an equivalent for Open[], High[], .. Volume[] of MQL4 in MQL5?
Actually I am using Volume[i] in OnInit for a volume-indicator in a separate chart-window to set the max. and min.
...
while(b-->0) {
lMin = fmin(lMin,Volume[b]);
lMax = fmax(lMax,Volume[b]);
}
IndicatorSetDouble(INDICATOR_MINIMUM,lMin*0.9);
IndicatorSetDouble(INDICATOR_MAXIMUM,lMax*1.0);
...
}