Problem of Using HistoryDealsTotal()

 
//+------------------------------------------------------------------+
//| 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
 
I got the same issue 
 
Sacha Olivier Isabe Berthelon #:
I got the same issue 

Show your code if you want help