Use: stick it in experts\include folder. Use #include <LibGMT.h> in your EA/indi code.
And yes I wrote it with my own ten fingers. Copyrighted & GPL licensed, meaning that any EA/indi which uses it must also be publicly released under compatible conditions. Contact me for terms if you have a different requirement.
From the comments:
Code: Select all
UTILITY FUNCTIONS
datetime GMTseconds()
return the datetime (seconds since 1/1/1970) for GMT time zone.
void MakeDayHHMM(datetime dt, int& day_of_week, int& hhmm)
set day_of_week and hhmm from 'dt'.
USEFUL FUNCTIONS
void GetLocalDayHHMM(int& day_of_week, int& hhmm)
void GetGMTDayHHMM(int& day_of_week, int& hhmm)
void GetNewYorkDayHHMM(int& day_of_week, int& hhmm)
void GetLondonDayHHMM(int& day_of_week, int& hhmm)
void GetTokyoDayHHMM(int& day_of_week, int& hhmm)
These get the day of week & time with respect to the local (computer's local),
GMT, NYC, London and Tokyo. 'hhmm' means an integer of 100*hour + minute, making
comparisons easy.
Look what function is NOT present: the server time which controls all the charts.
Why? Because there is no automatic way to know the broker's time zone & daylight
saving adjustment.