A strange difference between the live and historical test?

IBar liveBar = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 0);
IBar previousBar = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 1);
result = previousBar .getClose() - liveBar .getOpen();

On live, result was 4 pips but on historical test, result was 0 pips.(correct one)

How can this be possible? Is Dukascopy fixing bar closing price later? Because there was 4 pips difference just 30 seconds before the bar closes.

UPDATE:
This links gives an idea.
https://www.dukascopy.com/wiki/en/development/strategy-api/historical-data/overview-historical-data
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IEngine.Type.html
https://www.definition.net/define/historical-data

Translate to English Show original

orto leave comments

Answers: 3

Best Answer

There are three types of JForex order execution engines: LIVE, DEMO and TEST.

https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IEngine.Type.html

Live accounts use LIVE engine, demo and contest accounts use DEMO engine, historical backtester uses TEST engine.

Because of differences in implementation of these engines and environment in which they operate, same strategy code run on each of the engines may give different results.

Having said that, if a strategy is good, it should produce similarly good results in all three environments.

Translate to English Show original
28 Apr. 2018 by

NonikNone avatar
NonikNone 29 Apr.

I didn't know that, in my case it was demo acc. Thank you very much.

al_dcdemo avatar

You're welcome.

orto leave comments

sorry i dont have an answer but i do find it odd, and i am interested in the explanation too

Translate to English Show original
27 Apr. 2018 by

orto leave comments

Hi chipombo, if this happen again, I will let you know. I have detailed my log file tick by tick with time info.

Translate to English Show original
27 Apr. 2018 by

orto leave comments
Please log in or register to post answer.