OrdersHistoryTotal() / OrdersTotal() Returning Zeroes

 

I am trying to write an EA that uses OrdersHistoryTotal and OrdersTotal...problem is, both of these keep returning 0 even though I am running these on the live mini-lot account I have been using for over 5 months. I can see the order history in the Account History tab, but I get nothing in the EA.

I have inserted this code in several working EAs to see if they will return anything but 0, but no luck yet. Does anyone have any ideas what I am doing wrong?

Print (OrdersHistoryTotal());
Print (OrdersTotal());
OrderSelect (1, SELECT_BY_POS, MODE_HISTORY );
Print (OrderSymbol());

 
You do something wrong. And this line
OrderSelect (1, SELECT_BY_POS, MODE_HISTORY );
is not safely and correct.
Reason: