The code makes use of the function TimeGMT() that was introduced in Empty4-buid 600+, and as such does not rely on the broker time (so you don't need to worry about your broker switching On/Off DST).
Eg. if you want to open a few trades within the first five minutes of London Open, you would use this code:
UPDATE: This code has now been updated. TimeGMT() is actually the local PC time +/- the GMT Offset. The time on the CNS VPS server is 6 minutes ahead of the official time, so we can't use TimeGMT(). I updated LibTime (please re-download) to include the function TimeCurrentGMT() which gives the br0kers time in GMT. The code in the EA will now look like:
Code: Select all
#include <LibTime.mqh>
if ( ( TimeHour( TimeCurrentGMT() ) == LondonOpenHourGMT() ) && ( TimeMinute( TimeCurrentGMT() ) < 5 ) ) {
tradeEUR();
}
R.