MQL5

 
Why I can't  get total order history data with code HistoryOrdersTotal() and HistoryDealsTotal() in mql5 ?
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
ATI Trading:
Why I can't  get total order history data with code HistoryOrdersTotal() and HistoryDealsTotal() in mql5 ?
void OnTick() {
   
        int totalOrdersInHistory = HistoryOrdersTotal();
        printf("history %d", totalOrdersInHistory);
}
That is the code I use
 
ATI Trading #:
That is the code I use

Are you sure you are looking for orders? This code will return 0 unless you actually have orders in the system.

You say "history" so I suspect it may not be just orders but "deals" that you want too

Look at the help - in particular at this function 

https://www.mql5.com/en/docs/trading/historyselect

Documentation on MQL5: Trade Functions / HistorySelect
Documentation on MQL5: Trade Functions / HistorySelect
  • www.mql5.com
HistorySelect - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
R4tna C #:

Are you sure you are looking for orders? This code will return 0 unless you actually have orders in the system.

You say "history" so I suspect it may not be just orders but "deals" that you want too

Look at the help - in particular at this function 

https://www.mql5.com/en/docs/trading/historyselect

Okay, thank you