Then you need to subscribe to a custom feed, e.g.:
@Override
public void onStart(IContext context) throws JFException {
console = context.getConsole();
IFeedDescriptor feedDescriptor = new TimePeriodAggregationFeedDescriptor(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.ASK, Filter.WEEKENDS);
context.subscribeToFeed(feedDescriptor, this);
}
@Override
public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
console.getErr().println("IFeedListener.onFeedData: " + feedData);
// if you want to retrieve concrete prices you need to use cast e.g.: ((IBar)feedData).getClose()
}
Run the attached strategy in Historical Tester over the timespan that includes weekend to see that the
onFeedData does not receive the weekend bars. Read more on feeds here:
https://www.dukascopy.com/wiki/#Chart_feeds