Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Tick data in real time different than on historical tester?
 Post subject: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Fri 11 Dec, 2015, 13:10 

User rating: 3
Joined: Thu 28 Jul, 2011, 19:40
Posts: 72
Location: PolandPoland
Hello Support,

I noticed disturbing thing. I tested my strategy (which logic bases on tick data), and I received different results on historical tester and in real time.

I checked this, and I see that sometimes tick data on historical tester (and on the platform in history charts) are different than tick data at the same time in real time.

I coded simple strategy which print always first tick form Ten seconds Bar.

I use such code (in attachment full strategy file):

SimpleDateFormat formatSSS = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:SSS");
    @Configurable("Instrument:") public Instrument instrumentThis = Instrument.EURUSD;
    @Configurable("Period:") public Period periodThis = Period.TEN_SECS;


IBar lastBar0 = null;
    public void onTick(Instrument instrument, ITick tick) throws JFException {
        if(instrument != instrumentThis) return;
        try{
            IBar bar0 = history.getBar(instrumentThis, periodThis, OfferSide.BID, 0);
            if(lastBar0!=null && bar0.getTime()!=lastBar0.getTime()){
                console.getOut().println(formatSSS.format(tick.getTime())+": new Bar, volume = "+bar0.getVolume()+",  tick Ask: "+tick.getAsk()+", Bid: "+tick.getBid()+", BidVolume: "+tick.getBidVolume()+", AskVolume: "+tick.getAskVolume());
            }
            lastBar0 = bar0;
           
        }catch (JFException jfe){
            jfe.printStackTrace(console.getErr()); 
        }catch (Exception e){
            e.printStackTrace(console.getErr());
        }
    }


I run this strategy in real time and then on the same period in historical tester. And I receive two different results. Files with results in attachment.
Here you can see compare of this two files:

Image

It happen not only on my platform because in my friend it happened the same.

Please check this and explain this.


Attachments:
coparedFiles.png [102.95 KiB]
Downloaded 469 times
realTime.txt [31.96 KiB]
Downloaded 106 times
tester.txt [31.97 KiB]
Downloaded 116 times
HistoricalTickDataTest.java [2.12 KiB]
Downloaded 90 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Wed 16 Dec, 2015, 10:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
What parameters are used to call historical tester?
Please make sure that interpolation is set to "ticks":
Image


Attachments:
interpolation.jpg [83.8 KiB]
Downloaded 560 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Wed 16 Dec, 2015, 16:24 

User rating: 3
Joined: Thu 28 Jul, 2011, 19:40
Posts: 72
Location: PolandPoland
Yes of course. I have used these settings.

So please tell me if on historical tester are the same tick data what we receive in strategy in real time?
If yes, then please check if you have a bug in this, because it looks that tick data are different.


 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Mon 04 Jan, 2016, 17:37 

User rating: 3
Joined: Thu 28 Jul, 2011, 19:40
Posts: 72
Location: PolandPoland
Hello,

I explored the subject more thoroughly. It looks that historical data are changed after about one hour.
I mean if I run above strategy in real time and next after few minutes on tester using Intraday data, then all is the same - there is no difference.
But next if I run the strategy after one hour (or later) then I received different data.

In attachment are two files from real time and from tester after more than one hour.

I noticed that in JForex there are new option regarding Price update queue processing mechanism.
I tested all with selected option: "Process all ticks to avoid missing price history"
Like on this screen:
Image

So there should not be the difference.
Please check this maybe somewhere around this new option is a bug?

Support please take care about this subject, because due to this bug credibility of Dukascopy is lost.


Attachments:
testerLater.txt [12.52 KiB]
Downloaded 111 times
realTime.txt [12.52 KiB]
Downloaded 108 times
ProcessAllTicks.png [53.56 KiB]
Downloaded 447 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Wed 06 Jan, 2016, 16:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See the attached strategy for collecting realtime data.
To collect historical data Historical Data Manager can be more useful (Tools > Historical Data Manager).


Attachments:
SaveRealtimeTicksStrat.java [3.23 KiB]
Downloaded 140 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Thu 07 Jan, 2016, 15:43 

User rating: 3
Joined: Thu 28 Jul, 2011, 19:40
Posts: 72
Location: PolandPoland
Hello,

Now I do not need collect historical data. Please read carefully what a wrote in last posts and answer on my questions.

BTW. I use your strategy SaveRealtimeTicksStrat.java first in real time and I obtain CSV file data_realtime.csv (in attachment)
Next, after more than one hour I run the same strategy on on the same period (Intraday) on Historical tester. I receive data_tester.csv file. (I removed from this file lines from out of interval I obtained in real time) So we have the same period interval in both files. You can see that tick data are completly different!

So it means that in real time strategy receive different data, than it is available in historical data. Am I right?

Please do the sam on your site if you do not trust my files.


Attachments:
data_tester.csv [275.47 KiB]
Downloaded 117 times
data_realtime.csv [202.88 KiB]
Downloaded 104 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Fri 08 Jan, 2016, 10:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is normal. Please see "Data in DEMO platform" for clarification
https://www.dukascopy.com/wiki/#Historical_Data


 
 Post subject: Re: Tick data in real time different than on historical tester? Post rating: 0   New post Posted: Mon 11 Jan, 2016, 14:42 

User rating: 3
Joined: Thu 28 Jul, 2011, 19:40
Posts: 72
Location: PolandPoland
OK now all i clear.

Thanks.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com