hi,
im adding the pairs, but only one pair is into the backtest,
@Override 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();
this.account = context.getAccount();
Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(Instrument.AUDUSD);
instruments.add(Instrument.AUDJPY);
instruments.add(Instrument.USDJPY);
instruments.add(Instrument.USDCHF);
instruments.add(Instrument.EURJPY);
instruments.add(Instrument.GBPUSD);
instruments.add(Instrument.GBPJPY);
instruments.add(Instrument.EURUSD);
context.setSubscribedInstruments(instruments,true);
}
@Override public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
// only one position open
if((engine.getOrders().isEmpty())){
// loop for pairs
for(int i=0;i<pairs.length;i++){
if(pairs[i]!=instrument || period != selectedPeriod)return;
.......
SMIindicator(pairs[i]);
}
}
}
I have read something about SystemListener, but i have no idea about that. can anyone help me?
Thank you