We could not replicate this with the following strategy:
package jforex.requests;
import java.util.Arrays;
import java.util.HashSet;
import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IEngine;
import com.dukascopy.api.IEngine.OrderCommand;
import com.dukascopy.api.IHistory;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
public class BidOfferMessages implements IStrategy {
private IEngine engine;
private IHistory history;
private IConsole console;
private Instrument instrument = Instrument.EURUSD;
@Override
public void onStart(IContext context) throws JFException {
engine = context.getEngine();
history = context.getHistory();
console = context.getConsole();
context.setSubscribedInstruments(new HashSet<Instrument>(Arrays.asList(instrument)), true);
ITick tick = history.getLastTick(instrument);
engine.submitOrder("bid" + System.currentTimeMillis(), instrument, OrderCommand.PLACE_BID, 0.01, tick.getBid() - instrument.getPipValue());
engine.submitOrder("offer" + System.currentTimeMillis(), instrument, OrderCommand.PLACE_OFFER, 0.01 ,tick.getAsk() + instrument.getPipValue());
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {
}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
@Override
public void onMessage(IMessage message) throws JFException {
if (message.getOrder() == null || message.getType() == IMessage.Type.NOTIFICATION) {
return;
}
console.getInfo().println(message + " " + message.getReasons());
}
@Override
public void onAccount(IAccount account) throws JFException {
}
@Override
public void onStop() throws JFException {
}
}
The ORDER_FULLY_FILLED is there. Could you please provide a concrete case?