Hello Support team
Here is a problem I am having with getBar().
You should be able to reproduce it easily by starting a new instance/connection, and running the following code:
Instrument instrument = Instrument.EURUSD;
Period period = Period.FOUR_HOURS;
IBar latestBar1 = history.getBar(instrument, period, OfferSide.BID, 1);
IBar latestBar2 = history.getBar(instrument, period, OfferSide.BID, 1);
log.info("price close 1 : {} {}", latestBar1.getClose(), new DateTime(latestBar1.getTime()));
log.info("price close 2 : {} {}", latestBar2.getClose(), new DateTime(latestBar2.getTime()));
assertEquals(latestBar1, latestBar2);
Here is what I get right now (Saturday 09:50am UTC):
2015-09-19 09:50:54,333| INFO | statsTest:127 | price close 1 : 1.12821 2015-09-18T16:00:00.000Z
2015-09-19 09:50:54,366| INFO | statsTest:128 | price close 2 : 1.12974 2015-09-19T04:00:00.000Z
Running that test on Daily returns:
2015-09-19 10:40:27,943| INFO | statsTest:127 | price close 1 : 1.14022 2015-09-17T00:00:00.000Z
2015-09-19 10:40:27,944| INFO | statsTest:128 | price close 2 : 1.12974 2015-09-18T00:00:00.000Z
Here it's pretty clear that the 2nd value is the correct one and there is a big difference obviously.
Other examples:
If you start a new connection/instance and call indicators.ema() before history.getBar(), history.getBar() returns the correct value.
But if you do it the other way around: calling history.getBar() before indicators.ema(), history.getBar() returns the wrong value.
This is with DDS2-jClient-JForex 2.43.2