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
5 registered members (AndrewAMD, Nymphodora, Quad, TipmyPip, Imhotep), 852 guests, and 5 spiders.
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 4 of 4 1 2 3 4
Re: Zorro's Quality [Re: Zheka] #471313
02/27/18 19:22
02/27/18 19:22
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted By: Zheka
1) From what I could read, historical data requests in MT4 return UTC time. This is also confirmed by downloading data into MT4 itself.
You were likely testing this on a UTC server.

Script:
Code:
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   Print("Current bar: ",iTime(NULL,0,0),", ",  iOpen(NULL,0,0),", ",
         iHigh(NULL,0,0),", ",  iLow(NULL,0,0),", ",
         iClose(NULL,0,0),", ", iVolume(NULL,0,0));
   
  }
//+------------------------------------------------------------------+



I tested this code on an Oanda -5 GMT server.


Attached Files capture.gif
Re: Zorro's Quality [Re: Zheka] #471314
02/27/18 20:19
02/27/18 20:19
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted By: Zheka
2) MQL4 update introduced new data structs: MqlTick and MqlRates.
https://docs.mql4.com/constants/structures/mqlrates

Besides efficiency, MqlRates also provides historical Spreads.
This should allow Zorro to save all MT4 price data as Ask, be consistent and actually make historical MT4 data usable.
Historical spread values are only used in MT5 and not MT4. (Just tested it... they read zero.) The Mqlrates struct was implemented for MQL5/MQL4 forwards(!) compatibility only.

I believe MqlTick structs are not available on a historical basis but only on a live-stream basis.

Re: Zorro's Quality [Re: AndrewAMD] #471316
02/27/18 22:19
02/27/18 22:19
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Thank you!
Quote:
You were likely testing this on a UTC server.
I downloaded history into MT4's History Center on two servers - one in UTC (Alpari) and another in ET(Gain). Both had UTC timestamps.

Quote:
Historical spread values are only used in MT5 and not MT4
Yes, dug it out on MT's forum as well.

So, what's the solution?

Does Zorro save Asks or Bids when requesting historical data from MT5?
From experience, do spreads on MT5 demo accounts same as on live accounts?

Re: Zorro's Quality [Re: Zheka] #471317
02/27/18 22:36
02/27/18 22:36
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted By: Zheka
I downloaded history into MT4's History Center on two servers - one in UTC (Alpari) and another in ET(Gain). Both had UTC timestamps.
Your server hosts were kind enough to enforce UTC timestamping.

But to write a Zorro plugin that accounts for all servers (including the one in my screenshot, look closely...), it must enforce an offset based on time difference between reported server time and UTC.

MT4/MT5 is a sort of Plato's Cave, if you will. wink

Re: Zorro's Quality [Re: AndrewAMD] #471334
02/28/18 11:11
02/28/18 11:11
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783

Quote:
Your server hosts were kind enough to enforce UTC timestamping.
What will be the timestamps of data downloaded into Oanda's MT4 terminal database?

Quote:
it must enforce an offset based on time difference between reported server time and UTC.
It just requires a more sophisticated logic; roughly, compare the last knownreported MT4 server time on Friday to 21:00/22:00 UTC on Friday (rather than to UTC at request).

Quote:
MT4/MT5 is a sort of Plato's Cave
Seems so.
Will getting data via MT5 work?

Re: Zorro's Quality [Re: Zheka] #471335
02/28/18 12:03
02/28/18 12:03
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
In MQL, bar = historical.

In the example I show, Oanda MT4 is 14:19 at 19:19 UTC, so it is off by five hours. The script output is in the log at the bottom.

I can hop to a UTC enforced MT4 server and the numbers will match.

MT5: You’re asking if historical spread is available? Very likely implemented in MT5 and not difficult to implement in the MT5 plugin. Ask nicely, and they might implement it. laugh

Page 4 of 4 1 2 3 4

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1