Make such a change and it will plough on. The definition of summer and winter has not been done, someone will do it.
Firstly, it's not 'minus 2' but 'plus 2'. Then for my case it fits.
Second, for a server that has a 4 hour offset from GMT, would you suggest putting 4 instead of 2? Then I don't need function, I just use initially known number and get correct answer. )))
First of all, it's not "minus 2", but "plus 2". Then for my case it fits.
Secondly, for a server which is offset 4 hours from GMT, would you advise to put 4 instead of 2? Then I don't need function, I just use initially known number and get correct answer. )))
You attributed a statement to me that I didn't make and then said it was wrong. You also tried to make a joke about it.
As the OrderSend() function comes across an error "market is closed" (there is some such thing), we stop all trading attempts and wait for the price to change, which will mean that the market has opened.
The idea could certainly help, I would like to know when the market is closed without unnecessary errors. We need to think about it.
Maxim Kuznetsov: We should not look for the last (23:59) minute on the EURUSD, but for the night on gold. Gold trades strictly amsterdam, currencies according to server time. From here find the GMT offset of the server
I'll tell you a terrible secret, not every day can end at 11:59 p.m. :-) And we may not know in advance what time it will end. For example, on pre-holiday days and Fridays.
Make such a change and it will plough on. Didn't do summer and winter definition, someone will do it.
It won't work, on systems where they don't fucking update the system as installed :-) For example there is still the time change from winter to summer in RF. I've encountered such systems...
There's no joke about the joke. In the code you submitted, 0 is changed to 2. Exactly as much as I get a discrepancy between the real time and the server's calculated time. That's why I was surprised at this approach: look at the needed discrepancy and put the needed offset instead of 0. There is nothing to laugh at here.
About the joke - no joke. In the code you submitted, 0 has been changed to 2. I got the difference between real and estimated server time. That's why I was surprised at this approach: look at the needed discrepancy and put the needed offset instead of 0. There's nothing to laugh about.
The check code
#property strict#define HOUR 3600#define DAY (24 * HOUR)
#define WEEK 7datetime GetBarTime( constdatetime time, constbool NextBar = false, string Symb = NULL, constENUM_TIMEFRAMES TimeFrame = PERIOD_M1 )
{
if (Symb == NULL)
Symb = _Symbol;
return(iTime(Symb, TimeFrame, iBarShift(Symb, TimeFrame, time) - (NextBar ? 1 : 0)));
}
datetime GetTimeDayOfWeek( constint Shift = 0, constENUM_DAY_OF_WEEK Day = SUNDAY )
{
constdatetime Res = TimeCurrent() / DAY * DAY;
return(Res - (((WEEK + (TimeDayOfWeek(Res) - Day)) % WEEK) + Shift * WEEK) * DAY);
}
// https://www.mql5.com/ru/forum/327616/page4#comment_14098877// Аналог по серверному времени - https://www.mql5.com/ru/docs/dateandtime/timegmtoffset// Работает для FOREX-символов, когда M1-история доступна за ближайшую неделюint TimeServerGMTOffset( constbool SummerTime = false )
{
constdatetime Sunday = GetTimeDayOfWeek();
return(((int)MathRound((double)MathMin(Sunday - DAY - GetBarTime(Sunday), Sunday + DAY - GetBarTime(Sunday, true)) / HOUR) - SummerTime - 2) * HOUR);
}
// Аналог по серверному времени - https://www.mql5.com/ru/docs/dateandtime/timegmt// Работает для FOREX-символов, когда M1-история доступна за ближайшую неделюdatetime TimeServerGMT( void )
{
return(TimeCurrent() + TimeServerGMTOffset());
}
#define PRINT(A) Print(#A + " = " + (string)(A))
// https://www.mql5.com/ru/forum/170953/page8#comment_6940794voidOnStart()
{
PRINT(TimeGMT());
PRINT(TimeServerGMT());
}
Result on a machine with the same GMT as at Alpari.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
How do you reproduce from a drawing?
I think the figure shows it very eloquently:
Make such a change and it will plough on. The definition of summer and winter has not been done, someone will do it.
Firstly, it's not 'minus 2' but 'plus 2'. Then for my case it fits.
Second, for a server that has a 4 hour offset from GMT, would you suggest putting 4 instead of 2? Then I don't need function, I just use initially known number and get correct answer. )))
What else do you need? Tell me, I will provide.
The code and name of the trading server that you can connect to by opening a demo through the terminal.
First of all, it's not "minus 2", but "plus 2". Then for my case it fits.
Secondly, for a server which is offset 4 hours from GMT, would you advise to put 4 instead of 2? Then I don't need function, I just use initially known number and get correct answer. )))
You attributed a statement to me that I didn't make and then said it was wrong. You also tried to make a joke about it.
As the OrderSend() function comes across an error "market is closed" (there is some such thing), we stop all trading attempts and wait for the price to change, which will mean that the market has opened.
The idea could certainly help, I would like to know when the market is closed without unnecessary errors. We need to think about it.
We should not look for the last (23:59) minute on the EURUSD, but for the night on gold. Gold trades strictly amsterdam, currencies according to server time. From here find the GMT offset of the server
I'll tell you a terrible secret, not every day can end at 11:59 p.m. :-) And we may not know in advance what time it will end. For example, on pre-holiday days and Fridays.
Make such a change and it will plough on. Didn't do summer and winter definition, someone will do it.
It won't work, on systems where they don't fucking update the system as installed :-) For example there is still the time change from winter to summer in RF. I've encountered such systems...
The code and name of the trading server to which you can connect by opening a demo via the terminal.
Code:https://www.mql5.com/ru/forum/327616/page3#comment_14093858
Login: 12752745
Server: yk2mkat
Server: Alpari-Demo
You attributed a statement to me which I did not make and then said it was wrong. And then you tried to make a joke about it.
Weren't you the one who wrote it?
There's no joke about the joke. In the code you submitted, 0 is changed to 2. Exactly as much as I get a discrepancy between the real time and the server's calculated time. That's why I was surprised at this approach: look at the needed discrepancy and put the needed offset instead of 0. There is nothing to laugh at here.
Code:https://www.mql5.com/ru/forum/327616/page3#comment_14093858
Login: 12752745
account: yk2mkat
Server: Alpari-Demo
Weren't you the one who wrote?
About the joke - no joke. In the code you submitted, 0 has been changed to 2. I got the difference between real and estimated server time. That's why I was surprised at this approach: look at the needed discrepancy and put the needed offset instead of 0. There's nothing to laugh about.
The check code
Result on a machine with the same GMT as at Alpari.
Checked
It is correct.