Looking for code to stop ea trading

 
I am looking for some code on how to stop an EA from trading based on a set pip increase on the previous day based on a monthly collective total e.g daily target 20pips once the target is hit stop trading for the day.
day12 total 320 plus 20pips total 340 daily target.
Reason: