- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- MT5 EA validation giving "there are no trading operations"
- Elite indicators :)
Something really quirky going on. I tried a different custom indicator in my EA and it compiled OK but when I ran it a global initialization error came up in the journal. After a lot of poking around and looking I moved a global variable that was only now being used by one routine so it was local. The code still compiled and now it runs without the global error but still has the unmatched errors however it does trade when the errors are over.
My original indicator still doesn't trade and gives unmatched errors even though I have checked that it gives a trade signal because I printed the trade signal on the visual chart. Maybe it is not passing the value to the EA.
Having asked the question I just answered it in visual mode by displaying the returned value that the EA gets from this call.
trdseq=iCustom(Symbol(),0,"iCandy",GaPips,2,0);
I must be doing something stupid because arrows are put on the chart and the value of buffer 2 that I pass to the EA is being set and yet the EA only gets zero.
My buffers are defined like this
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1); SetIndexArrow(0,233); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1); SetIndexArrow(1,234); SetIndexBuffer(0,upbuf); SetIndexBuffer(1,downbuf); SetIndexStyle(2,DRAW_NONE); SetIndexBuffer(2,out);
and my code sets buffer 2 like this
if(bon){ nextrd=-1; downbuf[i]=Close[i]; out[i]=-1; Comment("out[i]= ",out[i]); } if(son){ nextrd=1; upbuf[i]=Close[i]; out[i]=1; Comment("out[i]= ",out[i]); }
so how can the value be set in the indicator and not received by the EA? It amazes me how a small change to my indicator can take it from working to not working and yet I can't reverse it.
Ruptor: I must be doing something stupid ...
so how can |
|
A whole list of these errors is one problem
2015.06.08 00:54:18.480 TestGenerator: unmatched data error (volume limit 1530 at 2015.05.24 17:00 exceeded)
The other problem is the indicator works and sets out buffer 2 but the EA gets zero from the iCustom call. I posted the important bits of the indicator code to define the problem. If the out buffer has the right value as given by the comments why doesn't the EA get it passed across. I have never seen this before always the EA gets what is in the buffer that's why I am asking for pointers to where the problem might be. The unmatched errors and the indicator buffer not being passed to the EA started at the same time so seem to be linked
out[i]=-1;
Your indicator assigns a value to buffer index i
does i ever equal 0?
trdseq=iCustom(Symbol(),0,"iCandy",GaPips,2,0);
your iCustom call uses index 0
Here is some more nonsensical information about the unmatched error. If it was a data problem then it should happen at a fixed starting point. The first run starts at 1/5/2015 and the errors are at the start of the run so I moved the start date forward to 15/5/2015 and I still get the errors at the start of the run and again starting at 25/5/2015. Clearly it has nothing to do with corrupted data from the broker because it doesn't matter where I start the run in the data.
There isn't any point in displaying this error it just leads to confusion. When tick data is selected the EA is using 1 minute data on a 1 hour chart so the fact that there is a volume problem is irrelevant and if you use 1 hour candles the fact that the 1 minute volume doesn't match the hourly is irrelevant as well so what is the point of the error. I suppose you could give a single line warning that the volumes don't match in case someone is particularly worried about such detail but if an EA is that sensitive it doesn't stand a chance trading live. It is just the flakey way these errors popped up on my EA when I was editing an indicator and doing changes that couldn't possibly have caused the data problem that is irritating. Could the EA or indicator have corrupted the data file?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use