I found a bug with getBars() method.
Sample code:
package jforex;
import com.dukascopy.api.*;
import java.util.List;
import java.util.Date;
import java.io.PrintStream;
public class GetBarsTest2 implements IStrategy {
//@Configurable(value="Instrument")
public Instrument instrument = Instrument.EURUSD;
//@Configurable(value="Period")
public Period period = Period.DAILY;
//@Configurable(value="OfferSide")
public OfferSide offerside = OfferSide.BID;
//@Configurable(value="Filter")
public Filter filter = Filter.NO_FILTER;
//@Configurable(value="JFTimeZone1")
public JFTimeZone jft1 = JFTimeZone.UTC;
//@Configurable(value="JFTimeZone2")
public JFTimeZone jft2 = JFTimeZone.EET;
public void onStart(IContext context) throws JFException {
IConsole c = context.getConsole();
IHistory history = context.getHistory();
long twodaysago = history.getBarStart(period, new Date().getTime() - 48*60*60*1000);
JFTimeZone[] jfts = {jft1, jft2};
for(JFTimeZone jft: jfts){
c.getOut().println("GetBarsTest: " + jft.toString());
period = Period.createCustomPeriod(period.getUnit(), period.getNumOfUnits(), jft);
long from = history.getBarStart(period, twodaysago);
List<IBar> barlist = history.getBars(instrument, period, offerside, filter, 2,from,0);
try{
barlist = history.getBars(instrument, period, offerside, filter, 2,from,0);
} catch (Exception e) {
c.getNotif().println("Error with " + jft.toString());
e.printStackTrace(context.getConsole().getErr());
context.stop();
return;
}
c.getInfo().println("GetBarsTest: " + jft.toString());
}
}
public void onAccount(IAccount account) throws JFException {
}
public void onMessage(IMessage message) throws JFException {
}
public void onStop() throws JFException {
}
public void onTick(Instrument instrument, ITick tick) throws JFException {
}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
}
When I used this strategy as local run, I got an error message like this "com.dukascopy.charts.data.datacache.DataCacheException: Failed to load in-progress candle data in timeout period [EUR/USD, Daily, Bid] @ com.dukascopy.charts.data.datacache.bg.c(Unknown Source)".

But, this strategy can run without such error on the historical tester.

Regards,