bbHandle = iBands(Symbol(),PERIOD_CURRENT,20,2,0,PRICE_CLOSE);
Check your parameters.
Alain Verleyen:
Thank you Alain, that is embarrasing on my skills as a trader... not a new developer lol
Check your parameters.
Alain Verleyen:
Check your parameters.
I have encountered another issue with this today, I have tried for hours to get it right but I just cannot seem to diagnose the issue, nor find any help online and it's so frustrating!
double Open[]; double iOpen(string symbol(),ENUM_TIMEFRAMES timeframe, int index) { double open=0; ArraySetAsSeries(Open,true); int copied=CopyOpen(symbol(),timeframe,0,Bars(symbol(),timeframe),Open); if(copied>0 && index<copied) open=Open[index]; return(open); } double previous_open = iOpen(Symbol(),PERIOD_CURRENT,1);
The following error messages are being displayed:
Thank you in advance and apologies for being so dense
double _Open[]; double iOpen(string symbol,ENUM_TIMEFRAMES timeframe, int index) { double open=0; ArraySetAsSeries(_Open,true); int copied=CopyOpen(symbol,timeframe,0,Bars(symbol,timeframe),_Open); if(copied>0 && index<copied) open=_Open[index]; return(open); }
Good day,
I hope someone could please advise me.
In MQL5 I initialize my Boilinger bands with the iBands call:
fastBoilinger_handle = iBands(_Symbol, _Period, 20, 0, 0, PRICE_CLOSE);
I then try to get the upper, middle and lower band values for the past 3 time frames as follows:
double BM[], BU[], BL[];
ArraySetAsSeries(BM, true);
ArraySetAsSeries(BU, true);
ArraySetAsSeries(BL, true);
int Data = CopyBuffer(fastBoilinger_handle, 0, 0, 3, BM);
int Data2 = CopyBuffer(fastBoilinger_handle, 1, 0, 3, BU);
int Data3 = CopyBuffer(fastBoilinger_handle, 2, 0, 3, BL);
As per the documentation for iBands:
Note
The buffer numbers are the following: 0 - BASE_LINE, 1 - UPPER_BAND, 2 - LOWER_BAND
But when I do a simple test by just printing the values out, all of the buffers contain the exact same value.
Any help in the matter would be much appreciated.
Adam Woodcock:
Why do you have a iOpen() function? It's been built in since
New MetaTrader 5 Platform build 1860: MQL5 functions for operations with bars and Strategy Tester improvements - MQL5 programming forum 2018.06.14
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I have lurked on a lot of posts but this is my first actual post so hi!
I'm learning to code MQL5 and I have tried to use buffers to copy the last values of the Bollinger bands to arrays, from which the values are then commented. For some reason the comment displays the same data 3 times:
I can't get my head around it, it's not important I'm doing it purely for the purposes of learning but it is driving me nuts! I have checked the documentation on iBands and Buffers but for someone inexperienced like myself this often leaves me more confused than I was before.
Thank you in advance,
Adam