
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
1. Because support does not always give correct information. You yourself pointed this out about the Alpari dealer. + it's expensive: to find out from each dealer the transition. Because then you can't create a good solution, I don't know who the end user is discussing with.
2. Well, sort of, yes, but if a dealer does not switch from winter to summer and back, then the calculations get a bit weird.
I tried to modify your library a bit, but apparently something went wrong. I thought that the code should lead to the fact that the Expert Advisor automatically detects GMT time and trades according to GMT, not according to the broker's server. I am not sure if the code is optimal, but the solution seems to work. However, in those dealers that do not change the time - there are some incorrect calculations.
1.
- I did not fixate on EURUSD, we take the pair wherever the EA is placed.
- I did not fix the time either, I just subtract 1 year from the current one.
And I pass the parameters to bool setBokerOffset(string symbol, int &USwinEUwin1, int &USsumEUsum1, int &USsumEUwin1) to get this block dynamically.
2. alpha forex. I can in lis give data from demo account so you can check without opening anything. The thing is that the dealer does not switch from winter to summer, and the difference with GMT still occurs.
3. a little unclear how and where the design is used.
3. Немного не понял, как и где использована конструкция.
In an indicator that is the top of the loop though all bars.
In general, I switched to Greenwich. I define the time of transition to winter time as the difference between the server time and Greenwich Mean Time. The only thing is that for each broker this difference has to be calculated by myself and entered into the constants of the Expert Advisor. Just when users have different shifts, brokers, exchanges, and the time of transition to winter time is not the same, Greenwich is the same for all.
How exactly did you do it? How are the constants calculated?
How exactly did you do this? How are the constants calculated?
Greenwich time minus timecarrent, with the transition to winter time it will change by an hour. I wrote once the time of the start and end of work, with the client the difference in hour +3 and +2, brokers +3, +2, -6 Greenwich time))))). And it was necessary to start work at a certain time, the same for all. Greenwich Mean Time is the same, but server and local time are different. I redid the code from Fedoseyev's textbook).
In general, the problem is that there is no standard function for the difference between server time and Greenwich time. But it is counted. There is also a problem that local time can also have a transition to winter time, and at a different time from the broker's transition.
Greenwich time minus timecarrent, with the transition to winter time it will change by an hour. I wrote once the time of the start and end of work, with the client the difference in hour +3 and +2, brokers +3, +2, -6 Greenwich time)))). And it was necessary to start work at a certain time, the same for all. Greenwich Mean Time is the same, but server and local time are different. The code from Fedoseyev's textbook has been reworked).
In general, the problem is that there is no standard function for the difference between server and Greenwich time. But it is counted. There is also a problem that local time can also have a transition to winter time, and at a different time from the broker's transition.
Thanks, yes, this solution is in my head, it is +- so implemented. But you pointed out the pain in the last paragraph)
Hi @Carl Schreiber Happy New Year.
I know this article has been up for a while, but I just found it. Thank you for sharing this work. It requires me to do some testing with it to really understand it. But, I have a simple question for now:
I can see that you have a different day of week calculation rather than relying on the MqlDateTime struct .day_of_week. Why are you using this other calculation method, is there an accuracy benefit? Or is it just to avoid the conversion to the struct?
This code calculates the DST automatically for European and US brokers:
https://www.mql5.com/en/code/27860
The above code was used in Forex Market Hours https://www.mql5.com/en/code/27771 to calculate the day-light saving time changes.
Similar functions can be constructed for different areas of the world.