Gamestudio Links
Zorro Links
Newest Posts
How was this Game Rendered?
by 3run. 08/06/20 20:01
problem with adding new history
by daan. 08/06/20 19:53
wrong Entry
by daan. 08/06/20 19:52
New Zorro version 2.30
by Zheka. 08/06/20 17:40
Lookback period - no signs of live
by jcl. 08/06/20 16:23
How to plot stop TradeStopLimit
by AdamWu. 08/06/20 15:03
Chat Room for Zorro Programmers
by AdamWu. 08/06/20 14:20
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
10 registered members (AdamWu, Dooley, daan, Zheka, jenGs, painkiller, AndrewAMD, Aweys, 3run, 1 invisible), 477 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
bigimpactsound, tzw101, Al82, Alibert, jsch
18489 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
MT4/5 - wrong M1 time #480286
05/30/20 06:34
05/30/20 06:34
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
Hi,

Zorro FX data is in UTC
Quote
All downloaded prices are usually aligned to UTC time...


but in the script "Zorro.mq4" - command CMD_HISTORY return time candle with this code:

Code
int time = (int)iTime(Asset,timeframe,shift);
arr[4] = time + 60*timeframe; // assume tick start time


but i missing shift from servertime to UTC time.
For this I thinking data download from MT4 is wrong. Many server is +2GMT but I see also +1GMT nad +3GMT.

Is a true?

If yes, I know, how to make correct in the Zorro.mq4.

Milan

Re: MT4/5 - wrong M1 time [Re: Grat] #480290
05/30/20 09:23
05/30/20 09:23
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
I had compare data with come with Zorro and data downloaded from MT4

at first - data which is downloaded from MT4 - TimeZone is OK


[Linked Image]

but if use data from Zorro - have a different Timezene

[Linked Image]

Attached Files
zdate1.jpg (120 downloads)
zdate2.jpg (101 downloads)
Last edited by Grat; 05/30/20 09:27.
Re: MT4/5 - wrong M1 time [Re: Grat] #480291
05/30/20 09:58
05/30/20 09:58
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
how to repare:

in the file zorro.mq4

row (353-354):

int start = (int)arr[1]+(timeframe*timeZone);
int end = (int)arr[2]+(timeframe*timeZone);

and row 77 ( not important )
extern int timeZone = -2; // if server is +2GMT

is only temporary - becouse must be add the DST

MT4 servers are GMT +2 or GMT +3 depending on New York DST (Daylight Savings Time)

( not tested !! )

Last edited by Grat; 05/30/20 18:36.
Re: MT4/5 - wrong M1 time [Re: Grat] #480299
05/30/20 19:14
05/30/20 19:14
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
maybe this is a better:

BrokerZone = UTC+2;

Re: MT4/5 - wrong M1 time [Re: Grat] #480307
05/31/20 09:39
05/31/20 09:39
Joined: Apr 2008
Posts: 312
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 312
Austria
As far as I know the MT4 bridge corrects the time so that it is UTC when it is received from Zorro.

Re: MT4/5 - wrong M1 time [Re: Grat] #480313
05/31/20 10:13
05/31/20 10:13
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
I testeted - look picture above.
First have data dowloaded from MT4
SEC - use data comming with Zorro.

Is a different.

Re: MT4/5 - wrong M1 time [Re: Grat] #480315
05/31/20 10:31
05/31/20 10:31
Joined: Apr 2008
Posts: 312
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 312
Austria
Hm, Zorro entered a trade at a bar of 16:15 and in your screenshot it looks as if the same bar is in the MT4 chart at 18:15. Is 16:15 UTC not the same as 18:15 local time? Or do I not understand something?

Re: MT4/5 - wrong M1 time [Re: Grat] #480327
06/01/20 08:47
06/01/20 08:47
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
with year 2019 ( zorro data ) -> zorro open trade in 16:15 - on the MT4 is real 18:15 - this is a correct. MT4 have a 2 hour shift from UTC.

But with data downloaded from MT4 - zorro stored with date comming from MT4, not the shift to UTC. In this case Zorro open trade on the same time like see in the MT4 chart.
This is correct, becouse Zorro don't know how many is shifted MT4 server. Now is standard +2/3 depend the DTS. But any obscure brokers have different timezone.

In the MT4 can be calculace this shitmend but only if is market time. During weekend send the wrong.

In the MT4I have:

Code
        extern int nAddH=2;  
        int nDow=TimeDayOfWeek(TimeLocal());
        if(nDow==0 || nDow==6){
            nGMT=-60*60*nAddH;
            Print("Week: ",nGMT);
        }else{
            nGMT=(int)(TimeGMTOffset()-TimeCurrent()+TimeLocal());
            Print("WORK: ",nGMT," DW: ",nDow);
        }

Last edited by Grat; 06/01/20 08:52.
Re: MT4/5 - wrong M1 time [Re: Grat] #480334
06/01/20 12:34
06/01/20 12:34
Joined: Jul 2000
Posts: 27,307
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,307
Frankfurt
Your screenshots above all look ok to me, so I can't see the problem. Can you show a screenshot with no time shift?

Re: MT4/5 - wrong M1 time [Re: Grat] #480339
06/01/20 17:05
06/01/20 17:05
Joined: May 2015
Posts: 279
Czech Republic
G
Grat Offline OP
Member
Grat  Offline OP
Member
G

Joined: May 2015
Posts: 279
Czech Republic
If see on first jpg - Zorro open in 11:00 the same like in MT4 - 11:00 ... this data is download from MT4 - data 100% not in UTC but in MT4 server zone

Page 1 of 3 1 2 3

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1