Hey all.
I am currently struggling with a similar problem as well.
Over a year my EA worked just fine in real-time demo test mode with 4 different brokers, but only by a chance I decided to do some more back tests and during them I spotted a massive decrese of executed trades. In debugg mode I found a problem with the SymbolInfoSessionTrade() function, when it returns some funny values of the open times instead of the real ones (check the attached picture).
As I have mentioned eabove, the real-time trading by this EA went good till few days ago, when one of the brokers ceased trade executions although the other brokers remained tradable. I thought it happened because of my demo account expired, but after loggin to that brokers account I found there are waiting some documents to be sign. And this (and not only this) happened several times in the past yet, that this broker just ceased trading possibility, instead of sending a message, because he need from me to do some paperwork. Maybe is worth to mention a name of the MTFCKR broker, just for sake of some similarities: Admiral Brokers is the one who proly never see my real money again. And quess on which brokers data I did the back-tests?
Anyway, even my demo account didn't expired and the papers are signed, the trading with this broker wasn't restored, so with this new SymbolInfoSessionTrade() issue I don't know, what's the reason for that.
I'll do some more back-tests with another brokers data and try to do more research about it.
Otherwise I would be another grateful for any possible hint for a sollution.
Cheers too.
Hey all.
I am currently struggling with a similar problem as well.
Over a year my EA worked just fine in real-time demo test mode with 4 different brokers, but only by a chance I decided to do some more back tests and during them I spotted a massive decrese of executed trades. In debugg mode I found a problem with the SymbolInfoSessionTrade() function, when it returns some funny values of the open times instead of the real ones (check the attached picture).
As I have mentioned eabove, the real-time trading by this EA went good till few days ago, when one of the brokers ceased trade executions although the other brokers remained tradable. I thought it happened because of my demo account expired, but after loggin to that brokers account I found there are waiting some documents to be sign. And this (and not only this) happened several times in the past yet, that this broker just ceased trading possibility, instead of sending a message, because he need from me to do some paperwork. Maybe is worth to mention a name of the MTFCKR broker, just for sake of some similarities: Admiral Brokers is the one who proly never see my real money again. And quess on which brokers data I did the back-tests?
Anyway, even my demo account didn't expired and the papers are signed, the trading with this broker wasn't restored, so with this new SymbolInfoSessionTrade() issue I don't know, what's the reason for that.
I'll do some more back-tests with another brokers data and try to do more research about it.
Otherwise I would be another grateful for any possible hint for a sollution.
Cheers too.
It seems like SymbolInfoSessionTrade() has changed recently. In my EA I check for the end of the session time, calling from OnTimer() and send a message at the end of the session. This has been working fine for more than a year. Recently, I'm receiving those messages on the weekend, when the server time is midnight. So it seems like SymbolInfoSessionTrade is now returning true even when there is no trading hours for that day.
I wrote this simple EA to prove my point:
here is a screenshot of me debugging the code on real data. Notice that the code is currently on line 27, which means the if condition above must have returned true. Look at the MqlDateTimeStruct data. it's currently day of the week 0(Sunday) and the session_end/start_time are 00:00:00. Ive also attached the screenshot for the symbol showing that there is no trading session on the weekend.
I would expect the function to return false if the day of the weekend is zero. And I'm telling you, this used to work. I would never get push notifications from my EA on the weekend, now, without changing that part of the code I do. The only logical conclusion I can arrive is that the function has changed its behaviour.
The documentation says the following, which isn't super clear to me.
Return value
If data for the specified session, symbol and day of the week are received, returns true, otherwise returns false.
I checked the release notes(https://www.metatrader5.com/en/releasenotes) for changes to this function and found none.
I know how to deal with this but just curious if this is an undocumented change(or documented and I just didn't find it).
cheers
(ENUM_DAY_OF_WEEK)server_time.day_of_week
alright, new code, even simpler to demonstrate what I'm suggesting. I'm simply looping through all the days of the week and printing more info when SymbolInfoSessionTrade() returns true. BTW this is on MT5 build 4831.
int OnInit() { datetime session_start_time, session_end_time; for(int i = 0; i <= 6; i++) { if(SymbolInfoSessionTrade(_Symbol, (ENUM_DAY_OF_WEEK)i, 0, session_start_time, session_end_time)) { Print("Day: ", EnumToString((ENUM_DAY_OF_WEEK)i), " Starts at: ", session_start_time, " ends at: ", session_end_time); } } return(INIT_SUCCEEDED); }
Output upon loading it:
2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: SUNDAY Starts at: 1970.01.01 00:00:00 ends at: 1970.01.01 00:00:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: MONDAY Starts at: 1970.01.01 13:00:00 ends at: 1970.01.01 22:25:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: TUESDAY Starts at: 1970.01.01 13:00:00 ends at: 1970.01.01 22:25:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: WEDNESDAY Starts at: 1970.01.01 13:00:00 ends at: 1970.01.01 22:25:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: THURSDAY Starts at: 1970.01.01 13:00:00 ends at: 1970.01.01 22:25:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: FRIDAY Starts at: 1970.01.01 13:00:00 ends at: 1970.01.01 22:25:00 2025.03.25 10:41:40.855 testingtradinghours (Bra50Apr25,M5) Day: SATURDAY Starts at: 1970.01.01 00:00:00 ends at: 1970.01.01 00:00:00
I strongly believe that in the past we would not see SUNDAY and SATURDAY when running a code like the one above. I actually used to rely on that behavior to know which day of the week we have trading hours.
the symbol hours are attached.
alright, new code, even simpler to demonstrate what I'm suggesting. I'm simply looping through all the days of the week and printing more info when SymbolInfoSessionTrade() returns true. BTW this is on MT5 build 4831.
Output upon loading it:
I strongly believe that in the past we would not see SUNDAY and SATURDAY when running a code like the one above. I actually used to rely on that behavior to know which day of the week we have trading hours.
the symbol hours are attached.
alright, new code, even simpler to demonstrate what I'm suggesting. I'm simply looping through all the days of the week and printing more info when SymbolInfoSessionTrade() returns true. BTW this is on MT5 build 4831.
Output upon loading it:
I strongly believe that in the past we would not see SUNDAY and SATURDAY when running a code like the one above. I actually used to rely on that behavior to know which day of the week we have trading hours.
the symbol hours are attached.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
It seems like SymbolInfoSessionTrade() has changed recently. In my EA I check for the end of the session time, calling from OnTimer() and send a message at the end of the session. This has been working fine for more than a year. Recently, I'm receiving those messages on the weekend, when the server time is midnight. So it seems like SymbolInfoSessionTrade is now returning true even when there is no trading hours for that day.
I wrote this simple EA to prove my point:
here is a screenshot of me debugging the code on real data. Notice that the code is currently on line 27, which means the if condition above must have returned true. Look at the MqlDateTimeStruct data. it's currently day of the week 0(Sunday) and the session_end/start_time are 00:00:00. Ive also attached the screenshot for the symbol showing that there is no trading session on the weekend.
I would expect the function to return false if the day of the weekend is zero. And I'm telling you, this used to work. I would never get push notifications from my EA on the weekend, now, without changing that part of the code I do. The only logical conclusion I can arrive is that the function has changed its behaviour.
The documentation says the following, which isn't super clear to me.
I checked the release notes(https://www.metatrader5.com/en/releasenotes) for changes to this function and found none.
I know how to deal with this but just curious if this is an undocumented change(or documented and I just didn't find it).
cheers