Try this code:
int handle; double lower_band[]; ArraySetAsSeries(lower_band,true); handle=iBands(NULL,0,20,0,2.0,PRICE_CLOSE); CopyBuffer(handle,2,0,2,lower_band); Print(lower_band[0]);
- mqlmagazine.com
Thanks, it works !
But the Help file is not well written and it should be corrected. Here is a copy of the iBands Help file :
int iBands( string symbol, // symbol name ENUM_TIMEFRAMES period, // period int bands_period, // period for average line calculation double deviation, // number of standard deviations int bands_shift, // horizontal shift of the indicator ENUM_APPLIED_PRICE applied_price // type of price or handle );Lines 5 and 6 are inverted, which misled me.
Thanks, it works !
But the Help file is not well written and it should be corrected. Here is a copy of the iBands Help file :
Lines 5 and 6 are inverted, which misled me.
Hello Mr Rosh,
I've just downloaded the Help File.
The order of the parameters have not been changed yet and inversion between lines 5 and 6 (Shift and Deviation) remains.
It's a bit strange because it was changed in the online version of Documentation- iBands:
The function returns the handle of the Bollinger Bands indicator.
int iBands( |
I've just downloaded and checked - it's OK. You should get the latest version from https://www.mql5.com/files/docs/mql5.chm (1.4 Mb)
Thank you for your answer.
I have downloaded the Help File as indicated (mine, dated 27Jan2010, was obviously not the latest one - but didn't update automatically ?)
However, when I doubleclick the File, only the left window works properly, the right one showing : "Navigation cancelled - try again the address"
Any clue to this problem ?
However, when I doubleclick the File, only the left window works properly, the right one showing : "Navigation cancelled - try again the address"
Any clue to this problem ?
- www.mql5.com
Sorry
I didn't know
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I want to retreive the value of the lower band of the Bollinger bands. I tried the following code :
The value I get for lower_band[1] is the central value (base_band[1]) of the indicator and not the higher or lower band value.
I tried other parameters with the same result.
Any idea ?