Dukascopy
 
 
Wiki JStore Search Login

Filter.WEEKENDS exception with some Instruments
 Post subject: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Thu 22 Aug, 2013, 13:58 

User rating: 2
Joined: Wed 05 Jun, 2013, 12:27
Posts: 9
Hello,

I am trying to get the bars and indicators from 2003 to 2013 for some Instruments. Everything works well without indicators, but when I filter by weekends I got some crashes depending on the Instrument.

For example, when I try to get the cci info it works with EURUSD:
            double[] cciEURUSD = indicators.cci(Instrument.EURUSD, period, OfferSide.BID, 2, from, to);
            double[] cciFilterEURUSD = indicators.cci(Instrument.EURUSD, period, OfferSide.BID, 2, Filter.WEEKENDS, from, to);
but crashes with AUDJPY:
            double[] cciAUDJPY = indicators.cci(Instrument.AUDJPY, period, OfferSide.BID, 2, from, to); //Works fine without filter
            double[] cciFilterAUDPJY = indicators.cci(Instrument.AUDJPY, period, OfferSide.BID, 2, Filter.WEEKENDS, from, to); //Crashes with filter
The same happen when I use history.readBars with Filter.WEEKENDS.

Just guessing, but I have noticed that the behaviour repeats depending on the existence of ticks info in the Instrument. For that date, there is ticks info for EURUSD but not for AUDJPY.

I have attached my Strategies in case it helps.

I will be really pleased if this bug is fixed soon.

Thank you,

María M.


Attachments:
TestIndicatorsFilter.java [2.72 KiB]
Downloaded 593 times
TestReadBarsFilter.java [6.72 KiB]
Downloaded 553 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: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Fri 20 Sep, 2013, 12:06 

User rating: 2
Joined: Wed 05 Jun, 2013, 12:27
Posts: 9
Hello Support,

The post has been moved to Fixed Bugs, but I have just tested it and it crashes in the same way than before, so the problem is not solved.
Please, fix it.

Thank you,

María M.


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Fri 20 Sep, 2013, 12:18 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
mmunoz wrote:
it crashes in the same way than before
What messages do you get?


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Mon 23 Sep, 2013, 08:49 

User rating: 2
Joined: Wed 05 Jun, 2013, 12:27
Posts: 9
The same that are described in the code.

TestReadBarsFilter works ok with Instrument.EURUSD but with Instrument.AUDJPY(and others) it throws the following exception:
Quote:
Requested time interval from [2003-11-30 21:01:00:000] to [2003-12-02 06:20:00:000] GMT is not valid
The period is 1 minute and it works in the other Instrument with the same interval, so that should not be the problem.

TestIndicatorsFilter behaves in the same way. It works ok with Instrument.EURUSD but with Instrument.AUDJPY(and others) gives:
Quote:
com.dukascopy.api.JFException: Requested time interval from [2003-11-30 21:01:00:000] to [2003-12-01 00:20:00:000] GMT is not valid

Thank you,

María M.


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Mon 23 Sep, 2013, 12:41 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
What JForex-API version are you using? What instruments do you have opened when you launch the strategy? Does the behaviour repeat when you open the instruments that you are using in your strategy?


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Tue 24 Sep, 2013, 08:26 

User rating: 2
Joined: Wed 05 Jun, 2013, 12:27
Posts: 9
I have updated my JForex-API to the latest version and open the Instruments before launching the strategy.

It works ok but only if the period is ONE_MIN or less so the date interval starts in 2003 or after. If I try to get the data for Period.DAILY, it throws the following exception:
Quote:
com.dukascopy.api.JFException: Requested time interval for instrument [EUR/USD] period [Ticks], from [1973-03-02 00:00:00:000] to [1978-08-22 00:00:00:000] GMT is not valid
The message is also incorrect because my period is DAILY and not Ticks.

This only happens with TestReadBarsFilter. The TestIndicatorsFilter script works perfectly now. I attached the strategy, although is the same with the period changed to DAILY.

In addition, I do not understand what do you mean by "open the instruments that you are using in your strategy".

Thank you,

María M.


Attachments:
TestReadBarsFilter.java [6.64 KiB]
Downloaded 296 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: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Tue 24 Sep, 2013, 09:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Are the instruments subscribed? You do it from API in the following way:
https://www.dukascopy.com/wiki/#Subscribe_to_an_instrument
From platform side it means that the instruments are open in the instrument panel.


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Tue 24 Sep, 2013, 09:39 

User rating: 2
Joined: Wed 05 Jun, 2013, 12:27
Posts: 9
Yes, both Instruments EURUSD and AUDJPY are subscribed.


 
 Post subject: Re: Filter.WEEKENDS exception with some Instruments Post rating: 0   New post Posted: Tue 07 Jan, 2014, 08:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has been fixed with JForex-API 2.9.5.2.


 

Jump to:  

cron
  © 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