Download MetaTrader 5

Is it possible to make EA that can count how many closing trade at that moment?

To add comments, please log in or register
carero
15
carero  
Hello i want to ask is it possible to make EA that can count closing trade in that pair in some spesiific range of time (ex: a day or a week)?

since as long i know EA can only count order trade only, and i try to find it in google but found nothing


please anyone who knows tell me anything you could share link, article ebook etc or just simple answer possible or not

so i know that my find is not in vain. thank you :)
Vasyl Nosal
19402
Vasyl Nosal  
int day_of_week_start=1;//monday
int day_of_week_stop=3//wednesday
int counter=0;

for (int i=OrdersHistoryTotal()-1; i>=0; i--)
 {
   if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
   {
   if(OrderMagicNumber()==Magic)
   { 
   if(OrderSymbol()==Symbol())
   { 
   if(TimeDayOfWeek(OrderOpenTime())>=day_of_week_start && TimeDayOfWeek(OrderOpenTime())<day_of_week_stop)
{
counter++;
}
   }
   }              
   }
 }
carero
15
carero  
Vasyl Nosal:
Ty sir never thought will get answer so quickly :)
To add comments, please log in or register