Hi Dukascopy-Support,
when I try to get the traded amount, in backtest I get the value of 1000, while when I start the Strategy,
a value of 0.001 is displayed. How can I change the display mode of that value from 0.001 to 1000?
Here is a simply strategy which shows that issue:
package jforex;
import java.util.*;
import com.dukascopy.api.*;
public class Strategy implements IStrategy {
private IEngine engine;
private IConsole console;
private IHistory history;
private IContext context;
private IIndicators indicators;
private IUserInterface userInterface;
private Instrument instrument ;
private double Amount;
public void onStart(IContext context) throws JFException {
this.engine = context.getEngine();
this.console = context.getConsole();
this.history = context.getHistory();
this.context = context;
this.indicators = context.getIndicators();
this.userInterface = context.getUserInterface();
IOrder order =engine.submitOrder("BUYORDER", instrument.EURUSD , IEngine.OrderCommand.BUY , 0.001);
}
public void onAccount(IAccount account) throws JFException {}
public void onMessage(IMessage message) throws JFException {
double Amount = message.getOrder().getOriginalAmount();
console.getOut().println("Amount =" + Amount);
return;
}
public void onStop() throws JFException {
engine.getOrder("BUYORDER").close();
}
public void onTick(Instrument instrument, ITick tick) throws JFException {
}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
}
Thank you
Jimmy Knoppers