open on signal and close on reversal signal

 
hello again, i trying to use the goldminer 1 and 2 indicators, as EA, WELL i got the EA running just fine but the problem is that when i get the signal from the GM1 AND GM2 to buy or sell it does it on the next bar not on the bar that the signal was trigger, and stay open unitl the EA closed it.... what i want if u can help me, is to open the order when the signal is trigger and to close the current order when the reverse signal is trigger and open the reversal signal order as well . here is the code thanks!!!!!!
 
keep of that indicator its a scam. i tested it before after it gives a wrong signal it will wait for some time then move its arrow to give an impression it got it right. if you want to confirm this wait for an arrow to appear then mark the position using a vertical line then check back later ull see what i mean.
 
thanks for ue reply!!! i will do that!!