Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
history.getBar() returns incorrect values in some cases http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=85&t=56483 |
Page 1 of 1 |
Author: | NonikNone [ Fri 04 May, 2018, 12:48 ] |
Post subject: | history.getBar() returns incorrect values in some cases |
IBar previousBar = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 1); When the new bar is created, if the end of previous bar was volatile, previousBar.getClose() returns incorrect value. And keeps returning same value in the following ticks, but if I restart the strategy, it is starting to log the correct value (the same with the chart). You can reproduce the case by logging close and open prices for 1-2 days and compare logged close prices with historical data with following code. public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { |
Page 1 of 1 |