context.getHistory().getOrdersHistory is not returning any results for my permanent demo account. account.isGlobal() is returning false and so this account is not global. Note: I can see the orders in Portfolio -> Portfolio Statement.
My code works perfectly fine if I run it against my LIVE account. Why does it not work for my permanent demo account?
try {
List<IOrder> orders = context.getHistory().getOrdersHistory(Instrument.EURUSD, new DateTime().minusYears(5).getMillis(), new DateTime().getMillis());
for (IOrder order : orders) {
System.out.println(order.getId());
}
} catch (JFException e) {
e.printStackTrace();
}