Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

history.getBar returns wrong bars
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=58373
Page 1 of 1

Author:  Makumba666 [ Tue 31 Jan, 2023, 14:55 ]
Post subject:  history.getBar returns wrong bars

Hi all,
I am trying to get bars close prices from history, like this:

IBar bar=history.getBar(instrument, Period.DAILY, OfferSide.BID, i);
double p=bar.getClose();
console.getOut().println(String.format("price=%.5f",p));

problem is this code gives absolutely wrong results - Daily candle close prices do not match ones getbar returns. It is not bid\ask problem - prices are really wrong - sometimes 10-15 pips away, sometimes absolutely in other dimension. What is wrong?

  Page 1 of 1