Hello,it is my first post here.I've an issue on read the open price of the newly formed daily candle. I'm working on XAUUSD.
Pratically, it always coincides with the closing price of the previous candle.It turns out to be correct then if I go to read, at the next candle, the price of the previous candle.
The image below explain better the issue.
Thank you if you can help me.

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException
{
try {
if (!instrument.equals(myInstrument) || !period.equals(cfgMyPeriod)) {
return; //quit
}
IBar dayCurr = history.getBar(instrument, period, OfferSide.BID, 0);
IBar dayPrev = history.getBar(instrument, period, OfferSide.BID, 1);
List barsNoWeekends = history.getBars(instrument, period, OfferSide.BID, Filter.WEEKENDS, dayPrev.getTime(), dayCurr.getTime());
for (IBar bar : barsNoWeekends) {
printMe("No-weekend bar: " + bar);
}
} catch (Exception ex) {
ex.printStackTrace();
}

a
Translate to English Show original