The following code gives result Friday 1 hour before midnight (i.e. "2018-12-
14 23:00:00:000"). I think that the correct result should be Sunday 1 hour before midnight (i.e. "2018-12-
16 23:00:00:000").
package jforex;
import com.dukascopy.api.*;
import com.dukascopy.api.util.DateUtils;
import java.text.ParseException;
@RequiresFullAccess
public class test6 implements IStrategy {
public void onStart(IContext context) throws JFException {
try {
context.getConsole().getOut().println(DateUtils.format(context.getHistory().getTimeForNBarsForward(Period.ONE_HOUR, DateUtils.parse("2018-12-14 00:00:00:000"), 24)));
} catch (ParseException e) {
e.printStackTrace();
}
context.stop();
}
public void onAccount(IAccount account) throws JFException {}
public void onMessage(IMessage message) throws JFException {}
public void onStop() throws JFException {}
public void onTick(Instrument instrument, final ITick tick) throws JFException {}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
}
Regards,
FXer