Download MetaTrader 5

Broker Server Time Changes & EA Settings

To add comments, please log in or register
James Parker
James Parker  


One thing I can't get my head around with MQL, is changes to broker server times (e.g. for daylight savings) and the impact on MQL functions and expert advisors. 

I have several EA's that only trade at certain times of the day. I limit the trade times using either TimeCurrent(), or Hour() and Minute() functions, checking against some external values that I write in as extern inputs.

It says in the documentation that these functions will be reading in the broker server time. I've also found a TimeGMTOffset() function, that I thought I should be using but that talks about local computer time, rather than broker server time.

So few questions:

1) What is the best way to manage trading time settings on EA's when changes occur to broker server time?... Do you all adjust your time inputs/settings manually when the clocks change? or is there an automated way to have the EA figure it out itself?

2) What happens if there is a change to local computer time (on my VPS) how does that affect an EA? 

Any advice much appreciated!


To add comments, please log in or register