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.

Calendar.DAY_OF_WEEK doesn't work in back tester.
 Post subject: Calendar.DAY_OF_WEEK doesn't work in back tester. Post rating: 0   New post Posted: Thu 20 Oct, 2011, 14:24 

User rating: 0
Joined: Thu 19 May, 2011, 07:42
Posts: 7
Location: JP
Hi all.

I coded avoid monday early timer...

Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(history.getLastTick(instrument).getTime());

int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
int hour = cal.get(Calendar.HOUR_OF_DAY);

if(dayOfWeek == 2 && hour <= setHour) return;

But they can't work well in back tester.

Other timers worked OK, but only this...
Anybody help! :roll: :roll: :roll:


 
 Post subject: Re: Calendar.DAY_OF_WEEK doesn't work in back tester. Post rating: 0   New post Posted: Thu 20 Oct, 2011, 15:57 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/index.php ... ding_hours


 
 Post subject: Re: Calendar.DAY_OF_WEEK doesn't work in back tester. Post rating: 0   New post Posted: Fri 21 Oct, 2011, 11:48 

User rating: 0
Joined: Thu 19 May, 2011, 07:42
Posts: 7
Location: JP
Thank you support.
Your reply is very fast.

But I know that method already.

I'd like to know are...
@Why day of week data doesn't work well?
@Time data in historical data doesn't have "WEEK_OF_MONTH" or "DAY_OF_WEEK_IN_MONTH" data?
@DEMO streaming test has them?

Please support. :roll: :roll: :roll:


 
 Post subject: Re: Calendar.DAY_OF_WEEK doesn't work in back tester. Post rating: 0   New post Posted: Fri 21 Oct, 2011, 13:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
higebouzu wrote:
@Why day of week data doesn't work well?
Did you pay attention to the fact that week starts with SUNDAY=1? Please consider logging the values you work with to see what is actually going on:
https://www.dukascopy.com/wiki/index.php ... ing_values
higebouzu wrote:
@Time data in historical data doesn't have "WEEK_OF_MONTH" or "DAY_OF_WEEK_IN_MONTH" data?
@DEMO streaming test has them?
java.util.Calendar is java not JForex functionality.

If you are still facing some problems, please describe more in detail:
1) How do you test the strategy (Historical testing settings).
2) How the strategy behaves and what is the actually expected behavior.


 
 Post subject: Re: Calendar.DAY_OF_WEEK doesn't work in back tester. Post rating: 0   New post Posted: Fri 21 Oct, 2011, 15:52 

User rating: 0
Joined: Thu 19 May, 2011, 07:42
Posts: 7
Location: JP
Sorry support!

Problem was my easy sign of inequality mistake!

I thank your faster replying! :) :) :)

Sorry!


 

Jump to:  

  © 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