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.

tester uses wrong date for start stop
 Post subject: tester uses wrong date for start stop Post rating: 0   New post Posted: Mon 26 Jul, 2010, 10:58 

User rating: 0
Joined: Tue 10 Nov, 2009, 16:58
Posts: 65
using the JForex API example (singlejartest), consider the following code added:

        Calendar start = Calendar.getInstance();
        start.set(2009, 1, 1);
        Calendar stop = (Calendar) start.clone();
        stop.add(Calendar.MONTH,1);
       
        client.setDataInterval(Period.TICK, OfferSide.ASK, null, start.getTimeInMillis(), stop.getTimeInMillis());


the tester appears to use a start and end date that is off by one month, see log output below. Also, since we are using TICKS why do we get a message about time not being valid ? there are no bars start with ticks...

2010-07-26 11:51:33.027 INFO  TesterMain - Starting strategy
2010-07-26 11:51:33.043 INFO  TesterMain - Strategy started: 1
2010-07-26 11:51:33.054 INFO  TesterMain - Getting prices before start time
2010-07-26 11:51:33.060 ERROR r - Time is not valid candle start time for period requested
com.dukascopy.charts.data.datacache.DataCacheException: Time is not valid candle start time for period requested
                                                        at com.dukascopy.charts.data.datacache.p.<init>(Unknown Source)
                                                        at com.dukascopy.charts.data.datacache.b.b(Unknown Source)
                                                        at com.dukascopy.charts.data.datacache.b.a(Unknown Source)
                                                        at com.dukascopy.dds2.greed.agent.strategy.tester.r.run(Unknown Source)
                                                        at java.lang.Thread.run(Thread.java:637)
2010-07-26 11:51:33.062 INFO  TesterMain - Creating data loading threads
2010-07-26 11:51:33.484 INFO  TesterMain - Getting prices before start time
2010-07-26 11:51:33.534 INFO  TesterMain - Filling in-progress candles
2010-07-26 11:51:33.562 INFO  TesterMain - Executing onStart
Started

2010-07-26 11:51:33.564 INFO  TesterMain - Running
2010-07-26 11:51:33.578 INFO  TesterMain - Running, 2009.02.01 11:00 Eq: 100000 UoL: 0%
2010-07-26 11:51:33.613 INFO  TesterMain - Running, 2009.02.01 11:30 Eq: 100000 UoL: 0%
2010-07-26 11:51:33.628 INFO  TesterMain - Running, 2009.02.01 12:00 Eq: 100000 UoL: 0%
2010-07-26 11:51:33.641 INFO  TesterMain - Running, 2009.02.01 12:30 Eq: 100000 UoL: 0%

....


 
 Post subject: solved ! Re: tester uses wrong date for start stop Post rating: 0   New post Posted: Mon 16 Aug, 2010, 20:58 

User rating: 0
Joined: Tue 10 Nov, 2009, 16:58
Posts: 65
Calendar months are numbered starting at 0....

---------------------------------------------------
so, is this a known bug ? is it worked on ?


 
 Post subject: Re: tester uses wrong date for start stop Post rating: 0   New post Posted: Fri 20 Aug, 2010, 14:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
"Month value is 0-based. e.g., 0 for January". This is not a bug.
In regard to "Time is not valid candle start time for period requested" message, please have a look at the following post: https://www.swissfxmarketplace.com/swiss ... f60e#p8813


 

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