I am using the MT4 platform for Forex, using the 5 minute chart and have a clock issue.
At the very start of a new 5 Minute candle, this happens seemingly not at fixed times and is more random… the start of a new 5 min candle is always different compared to the clock on my PC… I don’t just mean that the candle starts at the wrong time in relation to my PC clock, I mean each time is different where the candle starts either 3/4 or 5 seconds at different times in relation to my clock.
I am building an EA and want to sync my PC clock to the start of a new candle and not have that relation change… as it is… each candle start time is different each time (3/4/5/6 seconds different each time).
Why is this happening…? Can MT4 sync to my PCs clock … ? or the other way round…?
Or what can be done to make the relation between my PC clock and the MT4 Clock/candle start time more stable…?
Thanks in advance.
I don’t know if this applies to you or if it even applies to MT4 (I don’t use it):
Some broker’s charts will only tick over to the next bar if there is a new trade or new tick.
Thanks Dale @dpaterso … I was going to tag you in to the question but glad to see you first to reply. I’m not sure what you mean ‘only if there is a new trade’ … on MT4 there will ‘always’ be a new candle for each 5 minutes… it may be small or large depending on volatility (large hopefully, I’m still building my Robot to trade the news events
) … Its just that it starts at varying times (4/5 seconds either way, each time) in relation to my PC clock… and I don’t know why… or how I can stabilize that ? 
Hi.
I’ll check on a MT4 demo for you and see what happens.
By “new trade” I mean a tick or change in price. In other words: let’s just say that for an entire five minute period there was not a single change in price. Then only at the END of that five minute period would a new bar be drawn (forced) and it would be totally flat i.e. O=H=L=C. Then just let’s assume that you’ve come to the end of your current five minute bar. The platform will wait for a change in price. Let’s say that occurs only two minutes into the next five minutes. The new bar will then only be painted two minutes into the next five minute period. Dunno if that makes sense. But as I say: I’m not entirely sure that this applies to MT4.
The above may sound odd but there’s a very good reason for it. Conversely some brokers will automatically tick over to a new bar exactly at the end of the period. At these brokers: you will never see an opening gap (on the daily charts for example) for the simple reason that they have now forced the new bar to be painted and with an open that is exactly equal to the close of the previous bar. So if there is a gap it APPEARS as though price shot up from the open of the bar to where in fact the price opened the next day which is pretty useless.
I guess it could be something basic like a slow Internet connection maybe??? Slow PC maybe??? Antivirus software that’s checking the incoming data and only then allowing it to go through to update the bar. Not sure.
Again not sure about MT4 but you’d also need to check whether the time being displayed by MT4 is linked to your PC time or to the broker’s server i.e. that could also make a difference. Your PC clock may be out of synch. with theirs. But if that were the case then the bars would all be late by the exact same number of seconds each time I guess. But this should be easy enough to check i.e. what happens if you open MT4 then change the time to a wrong time on your PC??? If the MT4 clock changes also then it’s linked to your PC’s time. if not then it’s linked to the broker’s time.
SOMEWHERE on the Internet I saw the other day some piece of software or EA for MT4 that displays a countdown timer for the current bar. Maybe look for something like that to use as a test or something???
Actually you can ignore some of what I’ve posted above. MT4 doesn’t have a clock at all. It doesn’t matter what you do to your PC’s time it doesn’t affect the bars. Just tried it. And actually feel like an idiot for even suggesting it i.e. the bars will always be in synch. with the broker and data feed and definitely never be dependent on your PC’s time and date. Sorry. Late night last night!!! LOL!!!
More I think about this the more I’m sure I’m right.
I seem to remember from way back when that a broker has an option with MT4 whether or not to show gaps. If they elect to show gaps then this will apply to all charts. In which case the new bar on any chart will only begin to be drawn when there is a movement in price. If they have elected to NOT show gaps then the bars will simply tick over immediately at the end of whatever period you’re looking at. The latter being what you’re looking for but I think you’re out of luck.
Point really is: MT4 (and price bars on any other trading platform for that matter) will never be tied to your PC’s clock so therefore trying to synch. MT4 to your PC’s clock is an exercise in futility.
For what it’s worth I use the below to ensure that all my PCs are synched. to the correct time (Windows does a shit job of this I’m afraid). Not going to solve your problem though.
http://www.timesynctool.com/
@dpaterso - MT4 does have a clock … if you have the market watch view open you can see it… the clock is fixed by the broker and as I have discovered not connected to a local PCs clock… nor can it be synced.
My broker has made a suggestion… it may well just be down to a lag from the platform, as if you watch it’s clock, you can see that it pauses and stops and then jumps forward quite a lot… and I thought I had a good internet connection… 50mb Optical cable … but I am running 3 Pcs of the same router so maybe this is the issue.
My broker suggestions using a VPS so as to have a more stable internet feed and connection to the brokers server… but having tried a VPS, they are no good for me as they are soooooooo slow !!! maybe they run MT4 quickly… but my robot uses various other windows programs… I am considering a dedicated server which are mush faster… but I need 3 of them to run 3 MT4s and at £70 each per month that’s not really a viable solution currently.
I guess I’ll just have to stick with the problem… unfortunately it looks like there’s no fix for this one 
1 Like
Oh. OK. About the clock. I’ve learned something about MT4 then. Never too old!!! LOL!!!
Very nice of you to update the thread though.
Sorry I couldn’t be of more help.
Although just one thing:
I would hardly call my Internet connection speedy. It is nowhere NEAR your speed. I’m lucky if I get 10Mbps (it is SUPPOSED to be “up to” 50Mbps but yeh right). And during any given trading day I have TradeStation and my broker’s platform open as well as usually a page to here as well as have Bloomberg streaming on my iPad. And I don’t have any issues. And believe me: TradeStation probably uses more bandwidth that ten MT4 installations (depending on how many different options you have running at once of course). So I don’t know i.e. with your setup I’d find it quite a stretch that it’s your line speed or even your router. Oddly enough I’ve just applied for a 100 up and down line which is uncapped and unshaped (this for TradeStation) (and turns out it’s actually cheaper than this wireless abortion that I currently have).
I’ve never used a VPS so cannot comment.
What about your PCs themselves??? Or operating system (I’m still on Windows 7 Pro 64 and I ain’t changing not for love nor money). Maybe also try disabling some system services i.e. Windows runs so much superfluous crap in the background that it’s just not funny. I know this because I’m a musician and have done this exercise with my DAW to all but eliminate latency. Dunno. Just trying to think out of the box here for you. MT4 itself is probably one of the LEAST resource hungry pieces of software or trading platforms that’s why this is all a bit odd.
Anyway. Keep us updated on whatever happens.
Hi guys best advise I could give you is if you have a question about mt4 just email them direct or your broker they are all very helpful cheers…