A minute and a half difference between local time and fresh tick time. What to do. - page 6
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
Look at the code carefully!
TimeTradeServer() is taken only to determine the day and that's it (this check is made "just in case")!
TimeTradeServer() may be omitted altogether!
I've looked at it. I agree, I've written it incorrectly, but the function, in my opinion, still does not solve the problem. To be honest, I'm not quite sure why it's needed. It seems that you:
1. Get the number of milliseconds from a tick;
2. You break the tick into its components;
3. Then you reassemble the tick again!? This is where it's not clear to me what this is for? You will always get the same value that was originally passed to the function. Or maybe I'm missing something?
And then you compare the time of the tick with the previous one;
We do need to know the server's time, don't we? Without server time, we cannot determine if the thread of one character is lagging behind the threads of other characters.
That is, your code does not bind to the server time and does not compare the server time to the thread time, which we need to do. To understand not the lag of the stack from the ticks of a single symbol (as I originally thought when getting into this discussion), but the delay of data transfer over a set of symbols from the server to the terminal.
The check seems to need to be done via TimeGMTOffset. I'll sketch an example later.
Just funny, you are an experienced person (not a beginner).
You don't need any time at all, except the time of incoming ticks!
Remember the time (at initialization) of the last tick, and then all comparisons go with this time!
I've had a look. I agree, I wrote somewhat incorrectly, but the function, in my opinion, still doesn't solve the task at hand. To be honest, I'm not quite sure why it's needed. It looks like you are:
3. Then reassemble the tick again!? This is where it's not clear to me what it's for? You will always get the same value that was originally passed to the function. Or am I missing something?
This code is "pulled" from my Expert Advisor, where I check if the tick is current and if it's within
trading sessions
Added by
"Breakdown" of the tick is needed to determine the exact (milliseconds) time (no date), since in the session settings of my EA
I only set the time
It's just ridiculous, you're an experienced person (not a novice).
You don't need any time at all, except for the time of incoming ticks!
Remember the time (at initialisation) of the last tick, and then all comparisons go with this time!
I'll write my example later, I'll get into the question in more detail. I don't exclude that maybe I'm wrong (as well as pivomoe) and you are right.
This code is 'pulled' from my EA where I check the relevance of the tick and the time that the tick is within
trading sessions
Added by
"Breakdown" of the tick is needed to determine the exact time (without date), since in the session settings of my EA
I only set the time
Exactly, my fault, missed it.
Exactly, my fault, I didn't see it that way.
It's just that TC wasn't initially clear on what he wanted to get (or maybe it was misunderstood).
Here, run it and check:
It's just that the TC wasn't sure what he wanted to get in the first place.
Here, run it and check it out:
Michael, there are no questions to the arrival of the new tick/check on the old tick. There are no questions to your code either. The question is different. You need to check this situation:
Michael, there are no questions to the arrival of the new tick/check on the old tick. Neither is there any question about your code. The question is different. I need to check the following situation:
I tweaked the code (see above) the (OLD_TICK) appeared.
And knowing that the new package may contain an "old" tick, the developer must use it at his discretion.
I tweaked the code (see above) and (OLD_TICK) appeared.
It doesn't matter... streams of DIFFERENT characters.
It doesn't matter... streams of DIFFERENT characters.
Then I don't understand WHAT I NEED???? at all
If the current time is the SERVER - you need to forget about it until they broadcast it!
or use what is TimeTradeServer()