Executing two trades at the same time... How to fix it?

 
Hereby I have attached the code. when it is executed, two continuous trades are executed.. I don't know where the mistake occurs. How to fix the issue?
Files:
sample22.mq4  4 kb
 

I believe that the issue is with the SAR calculation? Do you want the value of the current or the previous bar. Try replacing 0 with 1 and see how you go.

dIsar = iSAR("EURUSD",NULL,0.02, 0.20, 1);