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
Freelance service: the safe way to order a trading robot. Try it!
carero
15
carero 2015.11.29 17:43 
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
18550
Vasyl Nosal 2015.11.29 18:08  
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 2015.11.30 17:09  
Vasyl Nosal:
Ty sir never thought will get answer so quickly :)
To add comments, please log in or register