My crossover EA automatically opens another trade after hitting TP. How do I make it wait til the next crossover?

 

I'm new to MQL and programming and running into an issue I can't figure out. My EA opens the trade but when it hits take profit it will automatically open another trade. it doesn't wait until the next crossover. How can I make it open trade ONLY on crossovers?

Here's some of my code:

***

I appreciate any help and if there's anything else you need to see just lmk

 
Darrian Billing:

I'm new to MQL and programming and running into an issue I can't figure out. My EA opens the trade but when it hits take profit it will automatically open another trade. it doesn't wait until the next crossover. How can I make it open trade ONLY on crossovers?

Here's some of my code:

***

I appreciate any help and if there's anything else you need to see just lmk

Please insert the code correctly: when editing a message, press the button   Codeand paste your code into the pop-up window. (The first time I corrected your message)
 
Darrian Billing: How can I make it open trade ONLY on crossovers?

You are looking at a signal. Act on a change of signal.
          MQL4 (in Strategy Tester) - double testing of entry conditions - MQL5 programming forum #1 2017.12.12

 
Delete Open Signal either any time before EA performs signal analysis or delete open signal after opening new position
Reason: