View Single Post
  #2 (permalink)  
Old 07-11-2007, 08:55 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 513
Michel is on a distinguished road
Quote:
Originally Posted by forextrend View Post
Has anyone got code i can use to control the number of trades and EA opens in a day.
Such as open just 3 trades per day and do not open anymore trades until the next trading day.
Call this function :

PHP Code:
int DailyCount()
{
      
int iDailyCount 0;   
      for(
OrdersTotal()-1>= 0--)
      {
            if(!
OrderSelect(iSELECT_BY_POSMODE_TRADES)) continue;
            if(
OrderSymbol() != Symbol()) continue;
            if(
OrderMagicNumber() != Magic) continue;
            if(
TimeDayOfYear(OrderOpenTime()) == DayOfYear()) DailyCount ++;
      }
      return(
DailyCount);

Reply With Quote