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.

"In progress bar is not loaded, could not load history further"
 Post subject: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 05:21 
User avatar

User rating: 0
Joined: Tue 04 Sep, 2012, 06:35
Posts: 11
Location: Hungary,
Dear Support;

I've been recently getting loads of the following error message while backtesting:

"Strategy tester: java.lang.IllegalArgumentException: In progress bar is not loaded, could not load history further @ com.dukascopy.charts.data.datacache.k.a.c.a(Unknown Source)"

The exception is thrown from an IRenkoBarFeedListener's onBar method, as seen below:

28.11.2013 04:37:47.914   SEVERE servicesources.StrategyTesterAction ] Exception thrown while running onBar method: In progress bar is not loaded, could not load history further
java.lang.IllegalArgumentException: In progress bar is not loaded, could not load history further
   at com.dukascopy.charts.data.datacache.k.a.c.a(Unknown Source)
   at com.dukascopy.charts.data.datacache.k.a.c.b(Unknown Source)
   at com.dukascopy.api.impl.bh.run(Unknown Source)
   at com.dukascopy.api.impl.bh.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.dukascopy.api.impl.m.b(Unknown Source)
   at com.dukascopy.api.impl.m.getRenkoBars(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.ba.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.ba.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.ba.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.b(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.v.run(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.CA(Unknown Source)
   at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.BV(Unknown Source)
   at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

On some pairs I get the exception, on some I don't, and on the same pair at different times it sometimes gets thrown, but sometimes it doesn't, with seemingly no pattern.

I'm not quite sure if this is some bug or is there something I could do about it, so any help would be appreciated.

Thank you for your help!


 
 Post subject: Re: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 08:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide an example strategy which replicates the case. Please provide a screenshot of Historical Tester settings that you use.


 
 Post subject: Re: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 09:55 
User avatar

User rating: 0
Joined: Tue 04 Sep, 2012, 06:35
Posts: 11
Location: Hungary,
This piece of code creates the same error, although not consistently (niether does the actual strategy).

package RockNRoll;

import static com.dukascopy.api.OfferSide.ASK;
import com.dukascopy.api.*;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IRenkoBar;
import com.dukascopy.api.feed.IRenkoBarFeedListener;
import com.dukascopy.api.feed.util.RenkoFeedDescriptor;
import java.util.UUID;
import static com.dukascopy.api.IEngine.OrderCommand.BUY;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ErrorReplicator implements IStrategy {

    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    @Configurable("pair?")
    public Instrument pair = Instrument.GBPAUD;
    @Configurable("resolution?")
    public int range = 5;
    IFeedDescriptor feed =
            new RenkoFeedDescriptor(
            pair,
            PriceRange.valueOf(range),
            ASK);
//a single class which subscribes IRenkoBarFeedListeners when conditions are met, in this case a single inner class instance is created @onStart
    private class Outer {

        private List<Inner> inners = new ArrayList<Inner>();

        public void launchInner() {
            Inner inner = new Inner();
            inner.setParam1(0);
            inner.setParam2(0);
            context.subscribeToRenkoBarFeed(feed.getInstrument(), feed.getOfferSide(), feed.getPriceRange(), inner);
            inners.add(inner);
        }
//IrenkoBarFeedListener containing some trade logic
        private class Inner implements IRenkoBarFeedListener {

            double param1;
            double param2;

            public void setParam1(double param1) {
                this.param1 = param1;
            }

            public void setParam2(double param2) {
                this.param2 = param2;
            }
            IOrder o;
            private List<IOrder> orders = new ArrayList<IOrder>();

            @Override
            public void onBar(Instrument instrument, OfferSide offerSide, PriceRange priceRange, IRenkoBar bar) {
                try {
                    //if conditioons are met, an order is placed
                    if (true) {
                        o = engine.submitOrder("Long" + UUID.randomUUID().toString().replace('-', '_'), pair, BUY, 0.001, 0, 5, 0, 0);
                        orders.add(o);
                    }
                    //and one might get closed
                    if (orders.size() > 2) {
                        orders.get(0).close();
                        orders.remove(0);

                    }
                } catch (JFException e) {
                    print(e.getMessage());
                }

            }
        }
    }

    @Override
    public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        Outer outer = new Outer();
        outer.launchInner();

    }

    @Override
    public void onAccount(IAccount account) throws JFException {
    }

    @Override
    public void onMessage(IMessage message) throws JFException {
    }

    @Override
    public void onStop() throws JFException {
    }

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }

    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }

    private void print(Object o) {
        console.getOut().println(o);
    }
}


The attached .png is a screen of historical tester settings.

Thank you very much!


Attachments:
historical_tester_settings.png [160.04 KiB]
Downloaded 314 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: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 12:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We could not replicate this, however there are a couple things that you should take into account:
  • You need to select all instruments in the Historical Tester that you are going to use. Otherwise their data will not be accessible. In your strategy you use GBPAUD, but in the Instruments dialog you have selected only EURUSD.
  • Consider using a more general approach when subscribing to the feed:
    https://www.dukascopy.com/wiki/#Chart_feeds/Subscribe_to_a_feed
    Note that you can add the feed descriptor as a parameter, so you don't need additional parameters for the instrument, the price range and the offer side.


 
 Post subject: Re: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 13:16 
User avatar

User rating: 0
Joined: Tue 04 Sep, 2012, 06:35
Posts: 11
Location: Hungary,
Thank you for your reply. I'm aware that a strategy wont backtest unless a proper instrument is selected, in this case I selected EURUSD manually, as the instrument was a configurable parameter, sorry for the unnecessary confusion. I don't think that the problem is the feed subscription, but I'll definitely give it a try.

You weren't able to reproduce the issue. Sometimes the issue is present on the same pair for a given period, sometimes it isn't. My strategy seemingly doesn't contain any element that didn't work in other classes I coded. The problem has been only existing since 3 days.

Although I'm far not as competent as I would like to be, the parahraph above tells me that it's not necessarily the strategy that is faulty. Could it be that somehow the local cache is "corrupted"? What does the error message mean anyway? As I understand, tick data is loaded from dukascopy servers to my local computer, and after that the historical tester uses them and calculates candles according to feed parameters. What is the problem in this case? One bar doesn't get loaded, which restricts history to load any further bars? Is there some info on what the whole workflow looks like? Im just guessing, but if it isn't the strategy that is faulty, then what can it be? Are there some more general steps that I could take (like clearing the cache, which I did already)?

Thank you for your time!


 
 Post subject: Re: "In progress bar is not loaded, could not load history further" Post rating: 0   New post Posted: Thu 28 Nov, 2013, 13:28 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
rauschie wrote:
Could it be that somehow the local cache is "corrupted"? What does the error message mean anyway?
It might be that the data in your local cache for some reason is faulty or incomplete, in that case you need to clear the data feed cache (Tools -> Preferences -> Advanced -> Delete saved cache files) and retry the test.
rauschie wrote:
As I understand, tick data is loaded from dukascopy servers to my local computer, and after that the historical tester uses them and calculates candles according to feed parameters. What is the problem in this case? One bar doesn't get loaded, which restricts history to load any further bars?
It appears to be the case - that some candle is corrupt or missing, which prevents loading of the next candles.
rauschie wrote:
Is there some info on what the whole workflow looks like? Im just guessing, but if it isn't the strategy that is faulty, then what can it be? Are there some more general steps that I could take (like clearing the cache, which I did already)?
Could you try if selecting in Visual Mode Settings the same chart as your feed is, solves the problem?


 

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