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.

getOfflineTimeDomain() - diffrent results on local and remote run
 Post subject: getOfflineTimeDomain() - diffrent results on local and remote run Post rating: 0   New post Posted: Sat 20 Sep, 2014, 09:56 
User avatar

User rating: 0
Joined: Thu 21 Aug, 2014, 08:37
Posts: 17
Location: PolandPoland
Hello,

I would like to ask about the IDataService.getOfflineTimeDomain(int shift) method.

I have used it to get the last two offline time domains (current and previous one - indexed 0 and -1). I found that the results are slightly different on local and remote strategy run.

On remote:

Quote:
TimeDomain -1: 1410555600000 (Fri Sep 12 21:00:00 UTC 2014) - 1410728400000 (Sun Sep 14 21:00:00 UTC 2014)
TimeDomain 0: 1411160400000 (Fri Sep 19 21:00:00 UTC 2014) - 1411333200000 (Sun Sep 21 21:00:00 UTC 2014)

On local:

Quote:
TimeDomain -1: 1410555599871 (Fri Sep 12 20:59:59 UTC 2014) - 1410728411110 (Sun Sep 14 21:00:11 UTC 2014)
TimeDomain 0: 1411160397735 (Fri Sep 19 20:59:57 UTC 2014) - 1411333200000 (Sun Sep 21 21:00:00 UTC 2014)

Could someone please explain what causes this differences? And do I have the guarantee that results on remote run will always be "rounded" to exact hour?

Code sample used to generate those resuls:

for (int i = 0; i > -2; i--) {
  ITimeDomain timeDomain = dataService.getOfflineTimeDomain(i);
  long start = timeDomain.getStart();
  long end = timeDomain.getEnd();
  context.getConsole().getOut().println("TimeDomain " + i + ": " + start + " (" + new Date(start) + ") - " + end + " (" + new Date(end) + ")");
}

Regards.


 
 Post subject: Re: getOfflineTimeDomain() - diffrent results on local and remote run Post rating: 0   New post Posted: Mon 22 Sep, 2014, 09:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is a bug on remote, we have registered this issue and are going to fix it as soon as possible.

Local run behavior is the correct one. Method ITimeDomain.getStart() returns the time of the last tick of trading week and ITimeDomain.getEnd() returns the time of the first tick of trading week in case of two last passed weekends. In all other cases (earlier than two last passed weekends or upcoming weekend) it should return Friday 21:00:00 UTC and Sun 21:00:00 UTC respectively (with corresponding dates).


 
 Post subject: Re: getOfflineTimeDomain() - diffrent results on local and remote run Post rating: 0   New post Posted: Mon 22 Sep, 2014, 11:56 
User avatar

User rating: 0
Joined: Thu 21 Aug, 2014, 08:37
Posts: 17
Location: PolandPoland
Thank you for your answer.

Is IDataService.isOfflineTime() method based on the same values (real time in case of two last weekends and 21:00 UTC in other cases)?


 
 Post subject: Re: getOfflineTimeDomain() - diffrent results on local and remote run Post rating: 0   New post Posted: Mon 22 Sep, 2014, 12:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, it's logic should be the same.


 

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