Keenbase Trading » Blog » Setting the GMT Offset

How to set correct GMT Offset in Expert Advisor (EA)

Setting the correct GMT offset is a crucial step to ensure the proper working of an Expert Advisor. First, we have to understand what exactly is the GMT offset and why it is important.

Suppose you are using an expert advisor which open a long position at the start of European session and exit the position at the end of the European session.

The European session starts at 7 a.m. GMT and ends at 4 p.m. GMT. To execute the above logic, the expert advisor has to fetch the correct GMT timings in Metatrader.

The problem is, Metatrader can calculate the correct GMT using the server time but the server time differs from broker to broker. That's why you need to set the correct GMT offset according to your broker server time. 

Follow these steps:

Check your broker time using the Market Watch window in Metatrader.

How to set correct GMT Offset in Expert Advisor

Now check the current GMT below:



Example 1:
Broker Time: 15:00
GMT: 13:00
GMT Offset: 15:00 - 13:00 = 2

Example 2:
Broker Time 07:00
GMT: 09:00
GMT Offset: 07:00 - 09:00 = -2

Intelligently crafted products right out of the box
Get Premium Subscription
keenbase premium subscription logo
Read More
Spread the word