![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There is no such information in mql5 neither. But there is Timer events which can be used with milliseconds precision, though I don't know if this feature will be available with the new mql4.
The current mql4 equivalent is something like below:
I've tested the GTC and it seems to jump by 16_milliseconds. Come to find out, its probably some kind of Computer_Science limitation on legacy systems. If anyone would like to explain why [ despite my ramblings ] I'll be glad. Hummm, wonder if mql5 have the same limitations? Alright one more test coming right up :)
It is always worth effort to find out, what Widows API function the MQL developers encapsulated.
In this case the answer is easy - they used GetTickCount It says:
The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.
I've googled it before and although I don't really understand, it seems GetTickCount() is a function directly from the windows OS. It's not meant to be accurate and shouldn't be used for things that need to be accurate to the millisecond level (even though it returns values in milliseconds).
I've done tests with sleep and with get tick count and there are always errors, it's hard to tell if they are caused by Sleep or GTC but my guess is both
It is always worth effort to find out, what Widows API function the MQL developers encapsulated.
In this case the answer is easy - they used GetTickCount It says:
The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.
The current mql4 equivalent is something like below:
I've tested the GTC and it seems to jump by 16_milliseconds. Come to find out, its probably some kind of Computer_Science limitation on legacy systems. If anyone would like to explain why [ despite my ramblings ] I'll be glad. Hummm, wonder if mql5 have the same limitations? Alright one more test coming right up :)16 milliseconds limitation comes from an hardware limitation, but there is other ways to get better precision timer.
mql5 have the same limitation for GetTickCount() but as I tried to explain above there are others features that can be used (timer events).
It is always worth effort to find out, what Widows API function the MQL developers encapsulated.
In this case the answer is easy - they used GetTickCount It says:
The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.
Yes that's what it says, but it's tough to know what that really means. If the resolution is 16 ms, I would expect to see values of 0,16,32,48.. etc.
I never see anything between 0 and 16 but I see every value about 16.
16 milliseconds limitation comes from an hardware limitation, but there is other ways to get better precision timer.
mql5 have the same limitation for GetTickCount() but as I tried to explain above there are others features that can be used (timer events).
Gotcha :)
Timers, Timer Resolution, and Development of Efficient Code
Windows Timer Resolution : Megawatts wastedVolume is a bad name for what is actually "Tick count" . . . it's nothing to do with traded volume/lots . . . the reason it can change by more than 1 is because you can miss ticks.
Thanks for the info. I wonder how didn't I notice this before. In this case, it seems quite a useless (or misleading) information.
I really have to look for real level2 volume data from some brokers. Fortunately my ECN broker offers level2 trading data with real volume.