Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

I've got a little snippet of code that works fine on my home PC at multiple brokers but fails on my forex.com VPS. External variables are defined as follows:

 

extern int GMT_StartHH = 11; // GMT Hour to start trading

extern int GMT_StartMM = 00; // GMT Minute to start trading

extern int GMT_EndHH = 02; // GMT Hour to stop trading

extern int GMT_EndMM = 00; // GMT Minute to stop trading

 

Code in the function:

 

datetime GMT_Time, TimeStart, TimeEnd;

 

GMT_Time = Time[0] - (GMT_Offset * 3600);

TimeStart = StrToTime(TimeToStr(GMT_Time, TIME_DATE) + " 00:00") + (GMT_StartHH * 3600) + (GMT_StartMM * 60);

TimeEnd = StrToTime(TimeToStr(GMT_Time, TIME_DATE) + " 00:00") + (GMT_EndHH * 3600) + (GMT_EndMM * 60);

 

The GMT_Time is calculated correctly, yet the VPS adds five hours to TimeStart and TimeEnd (Print statements show start as 16 and end as 7). Before I start pulling hair out over this, does anyone see a problem with the code or know of something on the VPS that would cause the problem? Using Build 225 of MT4 on VPS, works fine on 225 and 226 on home PC.

 

Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...