Hello,
You can create custom period based on your TimeZone and subscribe to it's feed.
public void onStart(IContext context) throws JFException {
this.console = context.getConsole();
this.history = context.getHistory();
this.context = context;
Instrument instrument = Instrument.EURUSD;
OfferSide offerSide = OfferSide.BID;
Period myPeriod = Period.createCustomPeriod(Unit.Hour, 4, JFTimeZone.EET);
IFeedListener myFeedListener = new IFeedListener() {
@Override
public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
//your onBar logic
}
};
IFeedDescriptor feedDescriptor = new TimePeriodAggregationFeedDescriptor(instrument, myPeriod, offerSide, Filter.WEEKENDS);
context.subscribeToFeed(feedDescriptor, myFeedListener);
IBar myBar = history.getBar(instrument, myPeriod, offerSide, 0);
console.getOut().println(myBar);
}