Clossing all opened trades automatically

 
hello guys
can someone please send me a mq5 code where all current opened trades close when daily total target profit has been reached(as an input) ,then the Ea opens new trades the next day !
thanks . 
 

https://www.mql5.com/en/search#!keyword=close%20all%20mql5

go to website search for this

 
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trade Operation Types - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: