dlewisfl Posted May 10, 2010 Report Share Posted May 10, 2010 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.