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

Back to topics list To post a new topic, please log in or register
avatar
273
sheriffonline 2015.09.24 21:41
 

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!

avatar
Moderator
3418
GumRai 2015.09.25 00:32 #
 
Simple, only use orders opened/closed today in the calculations
avatar
273
sheriffonline 2015.09.25 06:41 #
 
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?


avatar
Moderator
3418
GumRai 2015.09.25 07:34 #
 
   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
avatar
273
sheriffonline 2015.09.25 08:14 #
 
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.
Back to topics list  

To add comments, please log in or register