How to force my EA to only trade once a day

 

How to force my EA to only trade once a day

Assume the EA open a position for the day, how do I set it to only trade once a day for that currency pair its attached to.

 
Check open orders and order history for a trade with the chart symbol and order open time after midnight. If such a trade exists, do not open any more.