Download MetaTrader 5

Problem of Using HistoryDealsTotal()

To add comments, please log in or register
Do you want to learn MQL5? 300 articles will help you!
2469757
10
2469757 2016.09.20 05:40 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   datetime end = TimeCurrent();
   datetime start = end - 60*PeriodSeconds(PERIOD_D1);
    if( HistorySelect(0,end))
//--- create objects 
  {
 
  int   total=HistoryDealsTotal();
       Comment("deals total=",total,"please");
       }
       else Comment ("Not working");
       }
//+------------------------------------------------------------------+

I use this Script after testing my strategy and it always return 0, no matter how many deals executed.

what did I do wrong?I Please help me. Actually , I did try to write code to export history deals to csv file for many months. So I tried step by step and I've found out that HistoryDealsTotal() is not working. 

Thank you so much for anyone who help me
To add comments, please log in or register