I am not sure what's going on at all and could use help. I am building an EA based off a custom indicator. I know the indicator is getting called properly now because it's displaying on the chart. However, I am getting no values.
Here's the code I'm using:
I even tried this:
Still empty.
And this:
I noticed in the readme for the indicator, that it has 12 buffers, and I'm looking for # 10. Am I doing something wrong? Why am I not getting any values?
Thanks.
Hi !
- iCustom returns the handle of a specified custom indicator,please check : https://www.mql5.com/en/docs/indicators/icustom
To get the value from a buffer,you need to use CopyBuffer,please check : https://www.mql5.com/en/docs/series/copybuffer
you need to do something like that :
double Value[]; int indicator_handler = iCustom(NULL,0,"MyIndicator","",50,true,true,true,17,12,7,false,10,1); if(indicator_handler != INVALID_HANDLER) // CHECKING IF THE CASE OF FAILURE TO LOAD INDICATOR { CopyBuffer(indicator_handler,9,0,1,Value); // COPYING THE VALUE FROM THE BUFFER TO ARRAY if(Value[0] > 0) // CHECK IF THE LAST VALUE IS > 0,SO BUY { // buy } }

- www.mql5.com
I am not sure what's going on at all and could use help. I am building an EA based off a custom indicator. I know the indicator is getting called properly now because it's displaying on the chart. However, I am getting no values.
Here's the code I'm using:
I even tried this:
Still empty.
And this:
I noticed in the readme for the indicator, that it has 12 buffers, and I'm looking for # 10. Am I doing something wrong? Why am I not getting any values?
Thanks.
You're using the printf function wrong. If you want to print params they way your are passing them you need to use the Print function instead.
I am not sure what's going on at all and could use help. I am building an EA based off a custom indicator. I know the indicator is getting called properly now because it's displaying on the chart. However, I am getting no values.
Here's the code I'm using:
I even tried this:
Still empty.
And this:
I noticed in the readme for the indicator, that it has 12 buffers, and I'm looking for # 10. Am I doing something wrong? Why am I not getting any values?
Thanks.
-
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. double stuff = iCustom(NULL,0,"MyIndicator","",50,true,true,true,17,12,7,false,10,1);
If there are n items, their positions are [0 .. n-1]. You want the tenth buffer, but looking at the eleventh.- You should encapsulate your iCustom calls to make your code
self-documenting.
Detailed explanation of iCustom - MQL4 and MetaTrader 4 - MQL4 programming forum

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am not sure what's going on at all and could use help. I am building an EA based off a custom indicator. I know the indicator is getting called properly now because it's displaying on the chart. However, I am getting no values.
Here's the code I'm using:
I even tried this:
Still empty.
And this:
I noticed in the readme for the indicator, that it has 12 buffers, and I'm looking for # 10. Am I doing something wrong? Why am I not getting any values?
Thanks.