This script performs only one simple action – it determines your broker’s current GMT. As you know, the Meta Trader 4 terminal can only display the actual time of the broker and does not take into account its shift relative to the average time of GREEN (Greenwich Mean Time), and after all, this data is of great importance for your automated systems.
Why know GMT if you are engaged in algotrading? For example, you have purchased a trading advisor who opens trades at a certain time. His set files were optimized by the authors on quotes from GMT.1. Let’s say your broker Alpari or IC Markets,you accordingly need to know his GMT shift to synchronize the trading that was when tested and will take place on your real account. We know that these GMT brokers have an equal amount of 2 DST, so you will need to change the EA trading time ahead by 1 hour in winter and 2 hours in the summer if the author of the code did not use Daylight Saving Time.
When creating our advisors and set files to them, we always use the most popular time GMT 2 with the transition to daylight saving time in New York.
How do you know your own GMT broker:
- The information can be found on the official website of the broker, if he did not forget to publish it and monitors the relevance.
- Write to support on the broker’s website and ask the current GMT value.
- You can use the search engine and find third-party articles about the shift in time, but not the fact that they are relevant today.
- Knowing the current time and GMT in your city by using a simple calculation to determine the broker’s manual time shift.
- Just take advantage of our script.
The analogues we know online work on a simple principle: compares the time and GMT shift installed on your computer over the broker’s time, using the calculation determined by the broker’s GMT. For example, the current time is in the region of 19:00 and GMT. Broker time is now 18:00. So 19-4 q 15, it’s time for GMT 0 and 18-15 q 3, it’s the GMT shift of your broker.
The downside of the method of importing time from the computer is that not all users set it up, namely forget to specify the correct GMT, or allow the system to calculate it automatically, which will immediately lead to false indicators.
Our script connects online to three online sources showing the time of UTC (Universal Time Coordinated), which is just x equal to GMT. Three data sites are needed to ensure that the information is always received correctly, if suddenly one or two other sources stop working.
An example of how the script works:
Before you start working, you need to turn on the DLL loading in the terminal(Click Service > – Settings – > Advisers – Allow the > import of DLL),because the script needs to connect to a remote Internet source to get the time data of GMT.
The script has no settings, it just sets on the chart and gives 2 lines:
The first is reported which server of the three gave us the time, the second directly denotes us GMT shift.
Unfortunately, the script can not find out if the company transitionD DST to summer and winter time, this information can be found only from the broker.
It should also be clarified that the script can not determine GMT during the weekend, this is due to the fact that the time in the terminal is no longer taken into account until Monday.