Only one trade per day

 
Hi. How to do only one trade per day ?
 
What do you mean by "per day"  ?   per calendar day ?  per 24 hours ? per calendar day based on some specified timezone ?   basically you have to check the open and closed trades to see if there has already been a trade placed,  OrderOpenTime(),  during the current "day",  if there has don't place a new trade.
 
For me, I want to send only one trade per day. This means that if the EA send an order today and my trade is closed today (in a same day), the EA send no more order.
 
Davidafx:
For me, I want to send only one trade per day. This means that if the EA send an order today and my trade is closed today (in a same day), the EA send no more order.

What do you mean by  "per day"  ?  didn't I already ask that question ?  OK so you mean the same calendar day based on your Brokers timezone ?

"basically you have to check the open and closed trades to see if there has already been a trade placed,  OrderOpenTime(),  during the current "day",  if there has don't place a new trade.

 
One remark, the EA can send 3 successive trades but don't send any more after close. Can you help me ?
 
The day is based on my Broker server time.
 
Davidafx:
One remark, the EA can send 3 successive trades but don't send any more after close. Can you help me ?

OK,  I'm not going to write your code for you,  if you need someone to do that then wait for someone here to do that . . .  it's probably not going to happen,  it might though . . .  you never know,  or go here:  MT4 coding   

This is one way I might tackle what you want:

if(TradePlacedToday() == false) ticket = OrderSend();

 TradePlacedToday is a bool function which returns true if there was already a trade placed today and false if a trade has not been placed today.  

What it does is loop through all the open orders and checks their OrderOpenTime() to see if matches today's date,  then it loops through all the orders in the history and checks their OrderOpenTime() to see if it matches today's date.  If there was an Order of type OP_BUY or OP_SELL in the open or closed orders that was placed today the function returns true,  otherwise it returns false.  

Do you need more help than this ? 

 
Duplicate thread removed.
 
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
  1. Find today
    datetime now   = Time[0],
             today = DateOfDay(now);
    #define HR2400 86400       // 24 * 3600
    int      TimeOfDay(datetime when){  return( when % HR2400            );    }
    datetime DateOfDay(datetime when){  return( when - TimeOfDay(when)   );    }
    
  2. Find your Closed orders perhaps using Order History sort by closing date - MQL4 forum
  3. Count how many have closed today.
Reason: