Hello,
The algorithm used to calculate the broker's GMT offset and daylight savings in the script "TimeSummer.mq5" is totally wrong.
https://www.mql5.com/en/book/common/timing/timing_daylight_saving
The correct algorithm can be found here: https://www.mql5.com/en/code/48650

- www.mql5.com
It's possible to sort structs by more than 1 field, if create a slightly modified version of SORT_STRUCT macro. For example, for sorting by 2 fields it can be:
//+------------------------------------------------------------------+ //| Convenient macro to sort 'A'rray of 'T'ype by two 'F'ields | //+------------------------------------------------------------------+ #define SORT_STRUCT_2(T,A,F1,F2) \ { \ class InternalSort : public QuickSortStructT<T> \ { \ virtual bool Compare(const T &a, const T &b) override \ { \ return (a.##F1 > b.##F1) \ || (a.##F1 == b.##F1 && a.##F2 > b.##F2); \ } \ } sort; \ sort.QuickSort(A); \ }

- www.mql5.com
The algorithm used to calculate the broker's GMT offset and daylight savings in the script "TimeSummer.mq5" is totally wrong.
Feel free to write details to me via PM. Your script does similar actions in more complicated way and is bound to a pre-existed table of rules, which I deliberately did not use, because the whole idea was to detect DST from pure statistics of quotes. Server's setup can be in practice inaccurate and won't fit the standards. This is why your scripts sometimes failed to detect actual timezone of the user's servers, according to their feedback.
An updated version of my server's daylight saving time detector was recently published.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
MQL5 Programming for Traders – Source Codes from the Book. Part 4:
In the fourth part of the book, we will focus on mastering built-in functions (MQL5 API) and will gradually delve into specialized subsystems. Any MQL5 program can utilize a plethora of technologies and functionalities. Therefore, it makes sense to begin with the most simple and useful functions that can be utilized in most programs.
Author: MetaQuotes