IBar bar = history.getBar(instrument, Period.createCustomPeriod(Unit.Hour, 12), offerSide, shift);
List<IBar> bars = history.getBars(instrument, Period.createCustomPeriod(Unit.Hour, 12), offerSide, Filter.ALL_FLATS, 10, history.getStartTimeOfCurrentBar(instrument, period), 0);
import com.dukascopy.api.listener.*; context.subscribeToBarsFeed( Instrument.EURUSD, Period.createCustomPeriod(Unit.Hour, 12), OfferSide.ASK, new IBarFeedListener() { public void onBar( Instrument instrument, Period period, OfferSide offerSide, IBar bar ) { } } );