Need help coding EA to make only one trade per signal

 
Not being a programmer...i've tried to figure out how to make the EA only do one trade per signal....but not having any progress. I want it to close a trade by either SL, TP, or TS. Then wait for the reverse signal. But it would close the trade and put the same side trade in if the singal was still good. I want to say thanks in advance for any help givin to me. Marty
Files: