Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

GetTimeUnit doesn't work out
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=141&t=49461
Page 1 of 1

Author:  Tyson [ Mon 24 Jun, 2013, 03:01 ]
Post subject:  GetTimeUnit doesn't work out

Defined the trading time, but it always takes 8:00 am entrance. Did I do something wrong?


Image

Image

Attachments:
TradingTime.vfs [26.94 KiB]
Downloaded 347 times
TheRealEntrance.JPG [74.96 KiB]
Downloaded 598 times
TradingTime.JPG [104.04 KiB]
Downloaded 555 times

Author:  Bruno_Grunberg [ Tue 25 Jun, 2013, 08:23 ]
Post subject:  Re: GetTimeUnit doesn't work out

Hello

I have tested your strategy, and the position opens at 10: 00.

There is a 2 hours shift. This issue is known and we are working on it.

It is a problem in the historical tester. If you run your strategy in LIVE, the right time will be kept.

So, to visualise your strategy in the tester as it would work on LIVE, you will have to add 2 hours in the code (opening at 14: 00 instead of 12:00).

We are working hard to fix this historical tester problem ASAP.

Author:  jerryetc [ Sat 29 Jun, 2013, 04:18 ]
Post subject:  Re: GetTimeUnit doesn't work out

Bruno_Grunberg wrote:
Hello

I have tested your strategy, and the position opens at 10: 00.

There is a 2 hours shift. This issue is known and we are working on it.

It is a problem in the historical tester. If you run your strategy in LIVE, the right time will be kept.

So, to visualise your strategy in the tester as it would work on LIVE, you will have to add 2 hours in the code (opening at 14: 00 instead of 12:00).

We are working hard to fix this historical tester problem ASAP.


@Para, just added my findings to this problem. It is probably because the generated code for GetTimeUnit block is using traders' local time zone instead of GMT.

//Original generated code: Calendar calendar = GregorianCalendar.getInstance();
Calendar calendar = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT")); //My updated code

@Tyson, FYI.

Author:  Tyson [ Sat 29 Jun, 2013, 06:01 ]
Post subject:  Re: GetTimeUnit doesn't work out

jerryetc wrote:
Bruno_Grunberg wrote:
Hello

I have tested your strategy, and the position opens at 10: 00.

There is a 2 hours shift. This issue is known and we are working on it.

It is a problem in the historical tester. If you run your strategy in LIVE, the right time will be kept.

So, to visualise your strategy in the tester as it would work on LIVE, you will have to add 2 hours in the code (opening at 14: 00 instead of 12:00).

We are working hard to fix this historical tester problem ASAP.


@Para, just added my findings to this problem. It is probably because the generated code for GetTimeUnit block is using traders' local time zone instead of GMT.

//Original generated code: Calendar calendar = GregorianCalendar.getInstance();
Calendar calendar = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT")); //My updated code

@Tyson, FYI.


Well done! If you are right, DUKASCOPY should give you a tip :lol:

建议他们给你发红包,呵呵!

Author:  jerryetc [ Mon 01 Jul, 2013, 03:03 ]
Post subject:  Re: GetTimeUnit doesn't work out

But this problem may not have impact for live trading as typically traders run their strategies remotely, means that the GetTimeUnit block still uses the server's time zone although the problem appears during historical testing.

Suggest that VJF team to update GetTimeUnit block with an option to choose time zone, with GMT selected as default.

Author:  Bruno_Grunberg [ Mon 01 Jul, 2013, 07:46 ]
Post subject:  Re: GetTimeUnit doesn't work out

Quote:
But this problem may not have impact for live trading as typically traders run their strategies remotely, means that the GetTimeUnit block still uses the server's time zone although the problem appears during historical testing.
:idea:

You are totally right!

by the way, Para and Bruno_Grunberg are the same person, I just took a login more relevant.

Author:  jerryetc [ Mon 01 Jul, 2013, 16:37 ]
Post subject:  Re: GetTimeUnit doesn't work out

@Para, that also means we have to change our local time zone to GMT specifically for historical testing to get an accurate testing result... :(

Author:  Bruno_Grunberg [ Tue 02 Jul, 2013, 08:56 ]
Post subject:  Re: GetTimeUnit doesn't work out

I am speaking about this issue with the engineers twice a day.
We are working hard to fix this problem.
We are getting closer to the solution and this issue should be sorted out very soon.
We do apologise for the temporary inconvenience.

  Page 1 of 1