Need Help with EA - Problem with EMA Cross

 

Hi there,


I have already written some EAs and I never had any problems, but now I want to test a simple strategy and I have a big problem with the ema cross. I have written it exactly as I did it everytime before, but nothing works.

There are different conditions which have to be complied to open a position. For example, condition 1 is the cross of the 5-EMA and the 15-EMA, condition 2 is the cross of the 15-EMA and the 65-EMA.

Everytime a condition is complied a message will be printed.

If I test the EA with the Tester, I get no trades, no messages, nothing.. but I'm relative sure my code is okay.


So please, could anyone help me? It would be really nice if anyone would answer quick, cause thats my last day before holidays. Tommorrow I'm sitting in the airplane! =)


And.. sorry for my bad english! =)

Files:
5-15-65.mq5  6 kb
 
faraway:

Hi there,


I have already written some EAs and I never had any problems, but now I want to test a simple strategy and I have a big problem with the ema cross. I have written it exactly as I did it everytime before, but nothing works.

There are different conditions which have to be complied to open a position. For example, condition 1 is the cross of the 5-EMA and the 15-EMA, condition 2 is the cross of the 15-EMA and the 65-EMA.

Everytime a condition is complied a message will be printed.

If I test the EA with the Tester, I get no trades, no messages, nothing.. but I'm relative sure my code is okay.


So please, could anyone help me? It would be really nice if anyone would answer quick, cause thats my last day before holidays. Tommorrow I'm sitting in the airplane! =)


And.. sorry for my bad english! =)

 

Your code does look okay, but it's diffiult to tell without some extra error checking.

I suggest you start by checking if the iMA handles are > 0 in OnInit(), and also checking that CopyBuffer is returning 4 in RefreshMAs()

Paul 

Reason: