Trying to create EMA Crossover that trades once.

 
Does anybody know how to code an EA where when two EMA's cross it enters a trade and when it either hits TP or SL it won't enter another trade until another crossover? What I am running into is that it will either enter on a crossover and only exit when there is another crossover( This is when I don't add a SL or TP). The other issue is that when I add a TP or a SL it will enter but enter around 5 or more times.
Files:
Capture.PNG  295 kb
Capture2.PNG  534 kb
 
blake: Does anybody know how to code an EA where when two EMA's cross it enters a trade and when it either hits TP or SL it won't enter another trade until another crossover? What I am running into is that it will either enter on a crossover and only exit when there is another crossover( This is when I don't add a SL or TP). The other issue is that when I add a TP or a SL it will enter but enter around 5 or more times.

Yes, there are many coders that know how to do that, but you have not shown your own code attempt in order for us to point out what you may be doing wrong.

If you need someone to code it completely for you, then use the Freelance section to place a job request.

If you require help in learning to do it yourself, then show your code so that we can guide you in fixing it.

Reason: