How can codes be written to stop trading if there is 2 consecutive loss trades ?

 
I have a ea that i want to add a feature in there where it would stop trading for the session if there is 2 consecutive loss trades. Anyone can provide the codes for it ? thanks
Reason: