Daily Account profit

 
Greetings,
Does any one know if the AccountProfit() report the daily account profit, the open order account profit, or the total history of the account profit?

My goal is to add a code to a MT4 expert to stop trading when the DAILY account profit (not the open order) reaches 20-30 pips of profit.

Would this work?
Example:
profit=AccountProfit();
if(profit>=30) return(0);


Thank you in advance.
 
I suppose : the total history of the account profit , however if you keep the value every day and compare to the new one (substract) it should be easy to have the code to calcul the daily....
 
AccountProfit() returns the current gain/loss of all currently open trades.