Dukascopy
 
 
Wiki JStore Search Login

Lots of DataCacheExceptions + IllegalStateException
 Post subject: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Thu 04 Dec, 2014, 13:58 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
With the current version (2.42.3/2.12.2) I´m having trouble with longer running backtests, I get a lot of DataCacheExceptions, like:

04.12.2014 13:39:08.929   SEVERE                        datacache.bi ] Last candle time is bigger than new candle time, ignoring candle update
com.dukascopy.charts.data.datacache.DataCacheException: Last candle time is bigger than new candle time, ignoring candle update
   at com.dukascopy.charts.data.datacache.bi.a(Unknown Source)
   at com.dukascopy.charts.data.datacache.bi.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.bf.c(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)
04.12.2014 13:39:08.929   SEVERE                        datacache.bi ] Last candle time is bigger than new candle time, ignoring candle update
com.dukascopy.charts.data.datacache.DataCacheException: Last candle time is bigger than new candle time, ignoring candle update
   at com.dukascopy.charts.data.datacache.bi.a(Unknown Source)
   at com.dukascopy.charts.data.datacache.bi.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.bf.c(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)
04.12.2014 13:39:08.929   SEVERE                           tester.bh ] [14400000] Received candle has older time than pervious candle, ignoring
java.lang.Exception: [14400000] Received candle has older time than pervious candle, ignoring
   at com.dukascopy.dds2.greed.agent.strategy.tester.bh.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)
04.12.2014 13:39:08.929   SEVERE                           tester.bh ] [14400000] Received candle has older time than pervious candle, ignoring
java.lang.Exception: [14400000] Received candle has older time than pervious candle, ignoring
   at com.dukascopy.dds2.greed.agent.strategy.tester.bh.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)


The following exception occurs after 3-4 months of running.
First test 2013-01-01 til 2014-01-01, EURAUD, 1 minute Cubic Spline: Exception occurs on April 16th,
Second test 2013-04-01 til 2014-01-01, EURAUD, 1 minute Cubic Spline: Exception occurs on August 19th
So it seems not to be dependent on a certain bar, but from the time running ?! btw. same behaviour when using other currencies.

04.12.2014 13:39:10.044   SEVERE                           actions.c ] Problem with bar <{T:1376928000000(2013-08-19 16:00:00.000+0000) E:false O:1.46176 C:1.46334 L:1.46131 H:1.4653 V:17502.28}> for the offer side <Ask>, existing data pair EUR/AUD, TIME_PERIOD_AGGREGATION FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=EUR/AUD, offerSide=Ask, period=4 Hours, ] {T:1376928000000(2013-08-19 16:00:00.000+0000) E:false O:1.46176 C:1.46334 L:1.46131 H:1.4653 V:17502.28}, null
java.lang.IllegalStateException: Problem with bar <{T:1376928000000(2013-08-19 16:00:00.000+0000) E:false O:1.46176 C:1.46334 L:1.46131 H:1.4653 V:17502.28}> for the offer side <Ask>, existing data pair EUR/AUD, TIME_PERIOD_AGGREGATION FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=EUR/AUD, offerSide=Ask, period=4 Hours, ] {T:1376928000000(2013-08-19 16:00:00.000+0000) E:false O:1.46176 C:1.46334 L:1.46131 H:1.4653 V:17502.28}, null
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.aX(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.IN(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.GK(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)


Deleting cache didn´t help. I am using a lot of subscriptions to different FeedListeners, so my first thought was, that the problem is related to the API changes done in this area. Are there any differences in using/subscribung to a feed?

But all of my FeedListeners are subscribed to OfferSide.BID and the IllegalStateException refers to an OfferSide.ASK-bar. So maybe the fault is not on my side of the code?

Unfortunately I am not able to provide a simple test-strategie, which reproduces the error. So I need some guidance where the problem might be, so that I can provide a test strategie.

It would be a good start if you could explain to me, what those two Exceptions mean and what may cause them. Especially the IllegalStateException is not really meaningful to me.


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Thu 04 Dec, 2014, 14:18 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
OK now I´m getting it directly after starting the test during the first bar, a little bit unpredictable.

04.12.2014 14:15:52.118   SEVERE                           actions.c ] Problem with bar <{T:1356998400000(2013-01-01 00:00:00.000+0000) E:false O:1.26971 C:1.26971 L:1.26971 H:1.26971 V:0.0}> for the offer side <Bid>, existing data pair EUR/AUD, TIME_PERIOD_AGGREGATION FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=EUR/AUD, offerSide=Bid, period=4 Hours, ] null, {T:1356998400000(2013-01-01 00:00:00.000+0000) E:false O:1.26971 C:1.26971 L:1.26971 H:1.26971 V:0.0}
java.lang.IllegalStateException: Problem with bar <{T:1356998400000(2013-01-01 00:00:00.000+0000) E:false O:1.26971 C:1.26971 L:1.26971 H:1.26971 V:0.0}> for the offer side <Bid>, existing data pair EUR/AUD, TIME_PERIOD_AGGREGATION FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=EUR/AUD, offerSide=Bid, period=4 Hours, ] null, {T:1356998400000(2013-01-01 00:00:00.000+0000) E:false O:1.26971 C:1.26971 L:1.26971 H:1.26971 V:0.0}
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.aX(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.t.IO(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.GK(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Eu(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.DN(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Thu 04 Dec, 2014, 17:51 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Ok I found something. The IllegalStateException seems to occur when you subscribe to a new feed after the strategy has started.
You can reproduce the error with any currency (the example is for EURUSD) on any date (please not that the test has to run more than one week (>6 days)).

I hope this helps you to provide a quick bugfix.

package jforex;

import java.util.*;

import com.dukascopy.api.*;
import com.dukascopy.api.feed.util.TicksFeedDescriptor;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;
import com.dukascopy.api.feed.util.TimePeriodAggregationFeedDescriptor;

public class TestStrategy implements IStrategy,IFeedListener {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
   
    private IFeedDescriptor fd = new TimePeriodAggregationFeedDescriptor(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, Filter.WEEKENDS);
    private int counter;
   
    public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();
    }
   
    public void onFeedData(IFeedDescriptor fd, ITimedData data) {
        console.getOut().println("bar completed: " + data + " of feed: " + fd);
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onMessage(IMessage message) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if (counter==6) {
             this.context.subscribeToFeed(this.fd,this);
        }
        if (period.equals(Period.DAILY)) {
            counter++;
        }
       
    }
}


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Wed 10 Dec, 2014, 09:31 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Error still exists in 2.42.4/2.12.3. Any news on this problem?


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Fri 12 Dec, 2014, 11:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi!
This issue is fixed and should be available in next Platform release.


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Mon 15 Dec, 2014, 09:19 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Any release date?


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Wed 17 Dec, 2014, 16:30 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Hello? Support?

Please don´t make me wait another 8 days for an answer. Til now you just said, that you've found the problem. You didn´t proove it yet. That, actually, does not help me at all.

Lower response times would be a great new year´s resolution for the support team.


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Wed 17 Dec, 2014, 16:54 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
We plan to release it this week.


 
 Post subject: Re: Lots of DataCacheExceptions + IllegalStateException Post rating: 0   New post Posted: Wed 17 Dec, 2014, 17:24 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Great, thank you for the quick reply!


 

Jump to:  

  © 1998-2024 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