Hi,
I'm preparing an expert advisor and I want to use BBands_stop indicator in my ea. However I couldnt call values in BBands_stop indicator. Can anyone help me how can I do it ?
Here is my code
bBand = iCustom(NULL,0,"BBands_Stop_v1",Length,Deviation,0);
I cannot take the true value by writing above.
I also include my BBands_Stop_v1 indicator into the attachment.
I would be so happy if anyone help me quick.
Thanks.
//---- input parameters extern int Length=20; // Bollinger Bands Period extern int Deviation=2; // Deviation was 2 extern double MoneyRisk=1.00; // Offset Factor extern int Signal=1; // Display signals mode: 1-Signals & Stops; 0-only Stops; 2-only Signals; extern int Line=1; // Display line mode: 0-no,1-yes extern int Nbars=1000; //---- indicator buffers .... extern bool SoundON=true;
You are using iCustom wrongly there are more extern input parameters inside your indicator and you have to choose what buffer you want the value from and what bar it is you get that value.... Read the topics about iCustom recently placed
Thanks for response,
should I use it like that ?
bBand = iCustom(NULL,0,"BBands_Stop_v1",Length,Deviation,MoneyRisk,Signal,Line,Nbars,0);
Thanks for response,
should I use it like that ?
bBand = iCustom(NULL,0,"BBands_Stop_v1",Length,Deviation,MoneyRisk,Signal,Line,Nbars,0);
No, still missing parameter " extern bool SoundON=true " and i don't see what buffer you do wanna have the value from and for what bar
you can't choose both with "0" so there is something missing
I want to get the uptrendstop and downtrendstop values of the BBands_stop. How can I get this values into my ea ?
Detailed explanation of iCustom - MQL4 forum
Very much appreciate any help and assistance.
No, still missing parameter " extern bool SoundON=true " and i don't see what buffer you do wanna have the value from and for what bar
you can't choose both with "0" so there is something missing
your are wrong in demanding a parameter for every declared external indicator parameter. you only need to specify the values different from the default values.
bBand = iCustom(NULL,0,"BBands_Stop_v1",Length,Deviation, ...)
this in fact is a valid parameter specification.
I want to get the uptrendstop and downtrendstop values of the BBands_stop. How can I get this values into my ea ?
As deVries correctly pointed out you need to specify which buffer the value belongs to you want to return.
double upTrendBuffer = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 0, 0); double downTrendBuffer = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 1, 0); double upTrendSignal = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 2, 0); double downTrendSignal = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 3, 0); double upTrendLine = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 4, 0); double downTrendLine = iCustom(NULL, 0, "BBands_Stop_v1", Length, Deviation, 5, 0);
above code gives you the indicator values for bar 0 (the last/current bar). be aware that every call to iCustom() might throw an ERR_HISTORY_WILL_UPDATED or ERR_INCORRECT_SERIESARRAY_USING error if called for another than the current timeframe. ERR_INCORRECT_SERIESARRAY_USING better should be named ERR_TIMEFRAME_NOT_AVAILABLE.
your are wrong in demanding a parameter for every declared external indicator parameter. you only need to specify the values different from the default values.
So would this if what you have written is correct . . .
bBand = iCustom(NULL,0,"BBands_Stop_v1", MoneyRisk, Line, ...)
. . . but I don't think it is as there would be no way for MT4 to know which value is for which extern parameter and which default values are to be used.
So would this if what you have written is correct . . .
. . . but I don't think it is as there would be no way for MT4 to know which value is for which extern parameter and which default values are to be used.

- 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,
I'm preparing an expert advisor and I want to use BBands_stop indicator in my ea. However I couldnt call values in BBands_stop indicator. Can anyone help me how can I do it ?
Here is my code
bBand = iCustom(NULL,0,"BBands_Stop_v1",Length,Deviation,0);
I cannot take the true value by writing above.
I also include my BBands_Stop_v1 indicator into the attachment.
I would be so happy if anyone help me quick.
Thanks.