I get ArrayIndexOutOfBoundsException when I call IIndicators.fibPivot(...) from strategy tester. JForex version: 2.8.1/2.6.21.
Code:
public class TestStrategy2 implements IStrategy {
private IIndicators indicators = null;
@Override
public void onStart(IContext context) throws JFException {
indicators = context.getIndicators();
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
indicators.fibPivot(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.ASK, 5, 0);
}
@Override
public void onMessage(IMessage message) throws JFException {}
@Override
public void onAccount(IAccount account) throws JFException {}
@Override
public void onStop() throws JFException {}
}
Exception:
2010-11-07 22:35:58.487 ERROR o - 1
java.lang.ArrayIndexOutOfBoundsException: 1
at com.dukascopy.api.impl.ac.a(Unknown Source)
at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Strategy tester: java.lang.ArrayIndexOutOfBoundsException: 1 @ jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
1: java.lang.ArrayIndexOutOfBoundsException: 1
at com.dukascopy.api.impl.ac.a(Unknown Source)
at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2010-11-07 22:35:58.492 ERROR TesterClientImpl$a - Exception thrown while running onBar method: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at com.dukascopy.api.impl.ac.a(Unknown Source)
at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Could you fix this bug ... or fix my code?