How to get Account History for current day? need suggetions?

 

I need to show the following details in chart, which is current day history!

Total Orders Count,Gross Profit,Gross Loss, Net P/L

the above details i must get every day and next day the all values must be reset?

need suggetion?

when i tried it shows total orders history value, wherever i use OrdersHistoryTotal()

Your help is appreciated!

 
Simple, only use orders opened/closed today in the calculations
 
GumRai:
Simple, only use orders opened/closed today in the calculations

Yes Gumraj! , you are right! i stuck in begin the code. i need the exact logic to start my code?

 
   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++;
     }
This counts closed orders. You can build on it to calculate the other values
 
GumRai:
This counts closed orders. You can build on it to calculate the other values
Thanks GumRaj. got it. You are awesome for helping people.
Reason: