Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2863 IContext.subscribeToBarsFeed(...) freezes
 Post subject: JFOREX-2863 IContext.subscribeToBarsFeed(...) freezes Post rating: 0   New post Posted: Sun 13 Mar, 2011, 22:02 
User avatar

User rating: 0
Joined: Wed 10 Nov, 2010, 23:03
Posts: 6
Location: Slovakia
Hello,

I found out that HistoricalTester can not work with strategies which are using custom periods (via IContext.subscribeToBarsFeed(...) method)
Take a look at the example strategy bellow - the strategy has practically no application logic, it is just sample of "empty" strategy which is using custom Period.
When you will run the strategy in HistoricalTester, the progress bar shows you "Running" but the test is not really running - all the historical tester is frozen.

Here is source code of the example strategy, using method IContext.subscribeToBarsFeed(...). When you will run the strategy in HistoricalTester you will see it will freez.
import com.dukascopy.api.*;
import com.dukascopy.api.listener.IBarFeedListener;

public class LS_S_Test implements IStrategy, IBarFeedListener {

    public void onStart(IContext context) throws JFException {
        Period selectedPeriod = Period.createCustomPeriod(Unit.Minute, 3);
        context.subscribeToBarsFeed(Instrument.EURUSD, selectedPeriod, OfferSide.BID, this);
    }

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

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

    public void onMessage(IMessage message) throws JFException {
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onBar(Instrument instrument, Period period, OfferSide offerSide, IBar bar) {
    }

}


I tested it on LastMoth historical data, EURUSD Ticks


 
 Post subject: Re: JFOREX-2863 IContext.subscribeToBarsFeed(...) freezes Post rating: 0   New post Posted: Tue 29 Mar, 2011, 15:08 

User rating: -
LorencSoftware wrote:
Hello,

I found out that HistoricalTester can not work with strategies which are using custom periods (via IContext.subscribeToBarsFeed(...) method)
Take a look at the example strategy bellow - the strategy has practically no application logic, it is just sample of "empty" strategy which is using custom Period.
When you will run the strategy in HistoricalTester, the progress bar shows you "Running" but the test is not really running - all the historical tester is frozen.

Here is source code of the example strategy, using method IContext.subscribeToBarsFeed(...). When you will run the strategy in HistoricalTester you will see it will freez.
import com.dukascopy.api.*;
import com.dukascopy.api.listener.IBarFeedListener;

public class LS_S_Test implements IStrategy, IBarFeedListener {

    public void onStart(IContext context) throws JFException {
        Period selectedPeriod = Period.createCustomPeriod(Unit.Minute, 3);
        context.subscribeToBarsFeed(Instrument.EURUSD, selectedPeriod, OfferSide.BID, this);
    }

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

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

    public void onMessage(IMessage message) throws JFException {
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onBar(Instrument instrument, Period period, OfferSide offerSide, IBar bar) {
    }

}


I tested it on LastMoth historical data, EURUSD Ticks



I confirm also the above problem. Does the support has any solution to this?


 
 Post subject: Hist. Tester freezes when using custom period Post rating: 0   New post Posted: Tue 11 Oct, 2011, 14:21 

User rating: 0
Joined: Thu 06 Oct, 2011, 06:08
Posts: 5
Location: DE
Hi,

When using a custom period within a strategy, the historical tester freezes as soon as the strategy starts. I believe that this topic deals with the same problem:
viewtopic.php?f=17&t=29870&p=39792&hilit=Historical+tester+freezes+custom+period#p39792

Thanks


 
 Post subject: Re: Hist. Tester freezes when using custom period Post rating: 0   New post Posted: Wed 12 Oct, 2011, 07:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has already been fixed and will be available in JForex client with the next release.
It is already available for Standalone API.


 
 Post subject: Re: Hist. Tester freezes when using custom period Post rating: 0   New post Posted: Wed 12 Oct, 2011, 07:51 

User rating: 0
Joined: Thu 06 Oct, 2011, 06:08
Posts: 5
Location: DE
Thanks for the quick reply.

That topic is from march... more than half a year ago. When will the new JForex client be released, and what is a standalone API?

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