Hi,
An order must be created with unique label, you can add a counter to your "BUY" label. Or you can create your method which will returns the order label, for example:
private int counter = 0;
protected String getOrderLabel(Instrument instrument) {
String label = instrument.name();
label = label + (counter ++);
return label;
}
Then consider the following code, to submit the order:
engine.submitOrder (getOrderLabel(Instrument instrument), instrument, OrderCommand.BUY, amount, 0, 5, tick.getBid() - instrument.getPipValue() * 50, tick.getBid() + instrument.getPipValue() * 60);