Hi folks,
I have following problem which I will describe chronologically:
1. My System labels orders e.g. long-orders are labeled "long" and short-orders "short". For example: engine.submitOrder("long", ...)
2. Now a long position is opened, with the label "long".
3. When I count my filled long-positions filtered with order.getLabel(), my system recognizes the long-position and returns "1":
//This code returns "1" before JForex restart and "0" after restart.
protected int longPositions(Instrument instrument) throws JFException {
int counter = 0;
for (IOrder order : engine.getOrders(instrument)) {
if (order.getState() == IOrder.State.FILLED && order.getLabel() == "long") {
counter++;
}
}
return counter;
}
4. Now I close the Jforex-Platform (the long position is still open) and restart the platform.
5. When I count the long-positions again, it returns "0" for long-positions. But the order and its label is still there.
Why is the label after JForex restart not recognized anymore? Does anyone know how to solve this problem?
Thx
- Fuzzy