OrderHistoryTotal() for current Day?

 

Is there any standard function to get total closed orders for current day?

eg:

must count only closed orders count day by day!

if there is no standard function available please give me a suggetion to get daily orders count?

 
sheriffonline:

Is there any standard function to get total closed orders for current day?

eg:

must count only closed orders count day by day!

if there is no standard function available please give me a suggetion to get daily orders count?

try this..ty
int TodaysOrders()
   {
   for(int TotalOrdersCNT=OrdersTotal()-1; TotalOrdersCNT>=0; TotalOrdersCNT--)
      {
      if(OrderSelect(TotalOrdersCNT,SELECT_BY_POS,MODE_TRADES))
         {
         if(TimeDayOfYear(OrderOpenTime())==TimeDayOfYear(TimeCurrent()))
            {
            TotalOrders+=1;
            }         
         }
      }
   for(TotalOrdersCNT=OrdersHistoryTotal()-1; TotalOrdersCNT>=0; TotalOrdersCNT--)
      {
      if(OrderSelect(TotalOrdersCNT,SELECT_BY_POS,MODE_HISTORY))
         {
         if(TimeDayOfYear(OrderOpenTime())==TimeDayOfYear(TimeCurrent()))
            {
            TotalOrders+=1;
            }         
         }
      }
   return(TotalOrders);
   }
 
you must set account history to all history also
 
   int closed_orders=0;
   datetime today_midnight=TimeCurrent()-(TimeCurrent()%(PERIOD_D1*60));
   for(int x=OrdersHistoryTotal()-1; x>=0; x--)
      {
      if(OrderSelect(x,SELECT_BY_POS,MODE_HISTORY) && OrderCloseTime()>=today_midnight)
            closed_orders++;
      }
should do the trick
 
GumRai:
should do the trick
Got it. Thanks to Subgenius n GumRaj
Reason: