Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,114 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: MT4/5 - wrong M1 time [Re: Grat] #480374
06/03/20 06:53
06/03/20 06:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Normally not. The screenshot looks ok, so I am not sure about the problem. But if there are really wrong timestamps with Grat's broker for some reason, the support will find out.

It happens that a MT4 server has temporarily wrong data. I have not yet heard of wrong timestamps, but theoretically it's possible.

Re: MT4/5 - wrong M1 time [Re: Grat] #480376
06/03/20 07:04
06/03/20 07:04
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I work on the detail report, where is problem, but in short:

a) in the real time.... zorro and MT4 is correct timezone
b) if zorro downloaded historic data from MT4 - don't correct shift to UTC -> this is a basic problem. I'm a 99% sure about this.

Re: MT4/5 - wrong M1 time [Re: Grat] #480377
06/03/20 07:12
06/03/20 07:12
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Historical data is time zone adjusted with the same offset as live data. Wrong timestamps are possible when the live and historical data come from different time zones. But I have not yet heard of such a case.

Re: MT4/5 - wrong M1 time [Re: Grat] #480378
06/03/20 08:06
06/03/20 08:06
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
How to find this offset? In the DLL?

Re: MT4/5 - wrong M1 time [Re: Grat] #480379
06/03/20 08:11
06/03/20 08:11
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, it's an internal variable in the DLL. It cannot be accessed externally at the moment, but we can change this dependent on what the support finds out.

Re: MT4/5 - wrong M1 time [Re: Grat] #480380
06/03/20 08:20
06/03/20 08:20
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
In this case, check, how find this offset during SA/SO - mayby this is a wrong.
Now I busy with other project, but evening I return back and prepare detail survey. I read both data ( MT4 .hst and ZORRO .t6) with python and compare.

Re: MT4/5 - wrong M1 time [Re: Grat] #480398
06/04/20 11:56
06/04/20 11:56
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I promise python compare:

how to read in python hst file from MT4:
Code
import numpy as np
import pandas as pd

def read_hst(filepath):
    with open(filepath, 'rb') as f:
        ver = np.frombuffer(f.read(148)[:4], 'i4')
        dtype = [('time', 'u8'), ('open', 'f8'), ('high', 'f8'), ('low', 'f8'),
                     ('close', 'f8'), ('volume', 'i8'), ('s', 'i4'), ('r', 'i8')]
        df = pd.DataFrame(np.frombuffer(f.read(), dtype=dtype).astype(dtype))
        df['time'] = pd.to_datetime(df['time'], unit='s')
    return df

dMT4=read_hst("EURUSD15.hst")
dMT4.head()


output is:
Code
time	open	high	low	close	volume	s	r
0	2019-06-27 16:00:00	1.13665	1.13678	1.13618	1.13666	1489	0	0
1	2019-06-27 16:15:00	1.13665	1.13672	1.13638	1.13644	989	        0      0
2	2019-06-27 16:30:00	1.13640	1.13671	1.13608	1.13627	1557	0	0
3	2019-06-27 16:45:00	1.13626	1.13628	1.13564	1.13585	1274	0	0
4	2019-06-27 17:00:00	1.13587	1.13707	1.13574	1.13699	1592	0	0



how to read in python history file from ZORRO:

Code
def read_t6(filepath):
    with open(filepath, 'rb') as f:
        dtype = [('time', 'f8'), ('high', 'f4'), ('low', 'f4'), ('open', 'f4'),
                     ('close', 'f4'), ('val', 'f4'), ('vol', 'f4')]
        df = pd.DataFrame(np.frombuffer(f.read(), dtype=dtype).astype(dtype))
        df['time'] = pd.to_datetime(df['time'],unit='D', origin=pd.Timestamp('1899-12-30'))
        df=df.set_index("time")
        ohlc_dict = {'open':'first', 'high':'max', 'low':'min', 'close': 'last'}
        
    return df.resample('15Min').agg(ohlc_dict)
dT6=read_t6("EURUSD_2020.t6")
dT6.head()


Now I work on the compare this dataset - datetime

come later....

Re: MT4/5 - wrong M1 time [Re: Grat] #480408
06/05/20 07:56
06/05/20 07:56
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
compare datetime

[Linked Image]

Attached Files Snímek obrazovky 2020-06-05 v 12.39.25.png
Last edited by Grat; 06/05/20 07:56.
Re: MT4/5 - wrong M1 time [Re: Grat] #480409
06/05/20 08:28
06/05/20 08:28
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Data, which Zorro get from MT4 is in different TZ

[Linked Image]

Attached Files Snímek obrazovky 2020-06-05 v 13.22.16.png
Last edited by Grat; 06/05/20 08:28.
Re: MT4/5 - wrong M1 time [Re: Grat] #480410
06/05/20 08:34
06/05/20 08:34
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I thinking, is a problem with DST. Because now is server +3 hour's, but in the 2020/01/01 to change DST only +2hour's. For system used short period ( Timeframe < 240 ) don't depend. But for system working with H4 and D1 must have a different results.

that's all folk...

P.S: if anybody want, I send jupyter script for playing on sand laugh

Page 3 of 3 1 2 3

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1