Features of the mql5 language, subtleties and tricks - page 67
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
A nuance of comparing integers on a real example
Are you going to measure exactly one second with Sleep(1000)?
And the fact that the timer in the processor has an error of 15 ms, don't you know it?
Are you going to slip Sleep(1000) to measure exactly one second?
Didn't you know that the timer in the processor has an error of 15 ms?
Hello, could you please tell me if there is a way to reset the timer buffer to eliminate the timer setting error?
Hello, could you please tell me if there is a way to reset the timer buffer to rule out a timer setup error?
The timer setup error occurs because the system message queue is full. There could be many reasons for this. Usually it's only temporary (if it's not temporary you won't be able to work on your computer)
Use OnTick to control the timer. If the timer is not set, set it in OnTick
Meanwhile we are working on making the timer settings independent from the state of message queue.
PS Allowing the system timer and setting the timer for an application are not related to each other
Are you going to use the Sleep(1000) slip to measure exactly one second?
No, I'm talking about these two lines of integer comparison.
Forum on trading, automated trading systems and strategy testing
Features of mql5 language, subtleties and tricks
fxsaber, 2018.01.24 21:48
The nuance of comparing integers on a real exampleAt first glance, both lines should give the same results. But this is not the case. The first one will sometimes give the wrong output.
The example with time is chosen only for clarity.And the fact that the timer in the processor has an error of 15 ms, is that unknown to you?
It's strange that you still use GetTickCount. It has been proven on the forum (I'm too lazy to search) that a microsecond timer doesn't slow down more than a millisecond timer. At the same time has a wild error.
No, we are talking about these two lines of comparison of integers.
At first glance, both strings should give the same results. But they don't. The first one will sometimes give you the wrong result.
The example with time is chosen only for clarity.It's strange that you are still using GetTickCount. It has been proven on the forum (I'm too lazy to search) that the microsecond timer doesn't slow down more than the millisecond timer. At the same time it does not have a wild error.
The timer error occurs because the system message queue is full. There can be many reasons for this. As a rule, queue overflow is temporary (if it is not, you won't be able to work on your computer)
Use OnTick to control the timer. If the timer is not set, set it in OnTick
Meanwhile we are working on making the setting of the timer independent from the state of the message queue.
PS Enabling the system timer and setting the timer for the application are not related at all
That's exactly what I do,
The timer error occurs after some time - not immediately. and exactly because of the overflow - when there is a lot of data, for example order history, or current orders of 50 or more.
If i have a good working knowledge, i should try to use it as a base.
I'm talking about Sleep(1000).
Yes, you're talking about comparing integers.
Yes, you're talking about comparing integers.
There is no problem comparing integers.
Show the same thing without the slip and without GetMicrosecondsCount
There is no problem comparing integers.
Show the same without slip and without GetMicrosecondsCount
Forum on trading, automated trading systems and trading strategies testing
Discussion of the article "Hedging position accounting system added to MetaTrader 5"
fxsaber, 2018.01.25 10:14
We are talking about the analysis of the history of even manual trade, we are not talking about writing the TS.
For example, we want to understand how a deal slipped through.