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?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello,
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!
Thanks.