How to trade only on the next bar (after TP/SL)

 
Please let me know how to program the EA to trade only on the next bar after TP/SL was hit.

Thank you