I need to get iCustom to work to import some values from an indicator. This should not be difficult.
I used the syntax straight from MQL4 documentaion:
Var_1 = iCustom (NULL, 0, "Indi_1", 2, 0);
I ensured that all my variables were correct; same pair, current time, indi name copied directly from the source file, no parameters, from buffer 2, and no shift.
Nothing worked. I commented the variable using doubletostr and got an EMPTY_VALUE, 2147483647.
I went to the indi, put 1.0 in buffer 2, and took that out to a comment on the screen. Yes, the buffer does contain 1.0, as it could not contain anything else at that point.
Go to the EA. Run it with iCustom, and comment the result to the screen. Result = 2147483647.
Ran a sanity check. Stuffed 1.0 in my variable in the EA. Comment 1.0 to the screen. Conclusion: iCustom does not work. Verify syntax and all setups for two days, going over and over trying to spot something. Change all the names of Ez and indicator. Same result. Continue sanity check. Download a new MT4 from the same source. Same result. Continue. Download another MT4 from another source. Here the comment function works with my indi, does not work with my EA. I can no longer verify if iCustom works in this MT4.
The code that I used is dead simple. I reviewed other EA - Indi combinations, and I did nothing different. I have tried on two MT4's without a success.
MT4 versions MT4 V4.00 build 670
code samples: EA double Var_1; Var_1 = iCustom (NULL, 0, "Indi_1", 2, 0);
Comment ("Buffer is ", DoubleToStr (Var_1, 1));
The Indi was simple. Increase the buffers, set the index, put a value in the array, check that it's there.
I get the impression that not all MT4's are created equal, regardless of their version ID. It's like I'm shooting at a moving target. No fair.
I need help.
Are you using the correct index for the buffer?
do you have buffer0, buffer1, buffer2 ?
or just buffer1, buffer2
if you just have 2 buffers, the indexes will be 0 and 1, so for buffer2, the line index in the iCustom call would be 1, not 2
To add comments, please log in or register