Sometimes (perhaps once a day, on average), "IEngine.submitOrder(...)" throws "JFException: Not subscribed to the instrument [EUR/USD]" even though the platform is subscribed to EURUSD.
A contiguous snippet from the console, in reverse chronological order:
11:00:10 TRACE: Currently subscribed to [EUR/USD]
11:00:10 ERROR: JfOrderManager: Thrown in trySubmitOrder, com.dukascopy.api.JFException: Not subscribed to the instrument [EUR/USD]
11:00:07 TRACE: MessageType : INSTRUMENT_STATUS Instument : EUR/USD Tradable : true
Code fragment that produced the above snippet:
try {
order = engine.submitOrder(
labelPrefix + orderIndex++,
instrument,
orderCommand,
orderManager.getAmount(),
orderManager.getEntry(),
orderManager.getAllowedSlip(),
orderManager.getSl(),
orderManager.getTp(),
orderManager.getGoodTillTime(),
comment);
} catch (JFException ex) {
Debug.error("JfOrderManager: Thrown in trySubmitOrder, " + ex);
Debug.trace("Currently subscribed to " + context.getSubscribedInstruments()); // for debugging
}
(I can provide implementations of Debug.error and Debug.trace, orderManager.getAmount etc on request.)
FURTHER INFORMATION:
When this issue occurs, it is consistent: Even if the order is submitted repeatedly, this exception is thrown repeatedly. When this happens, I have noticed in the past that opening a new EURUSD chart makes the problem go away.
UPDATE: I have confirmed what the above paragraph says many times and further noticed that subscribing the platform to a new instrument also makes the problem go away.