IEngine.submitOrder method does not throw an exception if amount is less than minimum allowed as it is claimed in javadocs.
To prove this run the attached strategy.
package jforex;
import com.dukascopy.api.*;
public final class TestEngineException implements IStrategy {
public void onStart(IContext context) throws JFException {
try {
// amount is less than minimum allowed
context.getEngine().submitOrder("label", Instrument.EURUSD, IEngine.OrderCommand.BUY, 0.0);
context.getConsole().getWarn().println("Exception has not been caught");
} catch (JFException ex) {
context.getConsole().getNotif().println("Exception is caught: " + ex);
}
context.stop();
}
public void onTick(Instrument instrument, ITick tick) throws JFException {}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
public void onMessage(IMessage message) throws JFException {}
public void onAccount(IAccount account) throws JFException {}
public void onStop() throws JFException {}
}