Download MetaTrader 5
To add comments, please log in or register
Track all payments in your profile. It is easy!
Paul
632
Paul 2015.06.03 22:04 
I have two versions of the same EA where the only difference is the indicator being called. EAs A and B were both working until I edited the indicator that B calls. Now B gives unmatched errors and doesn't trade but A still runs on the same time period and data. How can the problem be with the data it just makes no sense. If the data is wrong then both EAs should stop working and have the same problem. Also the strange thing is that the change I made to the indicator is minor and hasn't changed the timing it has only selected fewer trades to execute. I have tried to back track the changes to get back to working code but it is as if the interpreter has gone down a one way street and can't generate code to give the same result even though I have put things back the way they were I think. Because the same code gives different results on EA version B you might think it is the data that has changed but EA A still gives the same results with no unmatched errors over the same time period and time frame.
Paul
632
Paul 2015.06.04 12:12  

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);
Paul
632
Paul 2015.06.04 12:20  

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.

Alain Verleyen
Moderator
28551
Alain Verleyen 2015.06.04 16:41  
Which "unmatched error" are you talking about ?
whroeder1
13610
whroeder1 2015.06.04 16:52  
Ruptor: I must be doing something stupid ...

so how can

  1. Yes, expecting mind readers here.
  2. We can not see all your indicator code.
Paul
632
Paul 2015.06.08 00:13  

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

Keith Watford
Moderator
7906
Keith Watford 2015.06.08 01:14  
       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

Paul
632
Paul 2015.06.08 11:22  
Thanks GumRai I had a bit of a brain fade when I first edited the file and the Unmatched errors occurred. The first tests traded after the unmatched errors but after a second edit it no longer traded and that is what confused me making me think it was the second edit that had caused the thing to stop trading and yet I couldn't see any reason for it. On the first edit I put i-1 instead of i+1 so it shouldn't have traded because it couldn't predict the future but it did. That is where the quirk is in the compiler since if the first edit didn't allow a signal on i=0 then it shouldn't have traded. It is as if the compiler didn't do a new compilation on the first compile even though it says it did or it didn't update the ex4 file because it wouldn't have traded. Something similar happens with indicators on the charts where after a compile you have to switch time frames to get the indicator to sort out the new arrow positions. Anyway none of this answers the question of why the unmatched errors suddenly occurred after the initial edit of the file and didn't occur on an identical EA using a different indicator over the same time period using the every tick setting.
Paul
632
Paul 2015.06.08 22:06  

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?

/
To add comments, please log in or register