sheriffonline:
try this..tyIs 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?
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
should do the trick

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?