There is a situation very specific for BM&F Bovespa (Brazilian market). During US daylight savings, market hours change +1 hour (I will not
get into the reason). My EA must end profitable positions during the last 10 minutes of market run (in fact, before closing auction starts).
Now it is hard coded:
if (TimeSession(16,45,16,54,TimeCurrent()))
I am trying to make this more reliable and soft coded. Even when I run a back-test, this hard code will not be last 10 minutes if US daylight is
going on. Can lead to wrong conclusions.
Using SymbolInfoSessionTrade() is always returning 1970.01.01 00:00, which I believe is because of trade session hours for symbol:
I was thinking of getting the closing time of previous day, but this will lead to wrong time on 2 days per year.
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.
There is a situation very specific for BM&F Bovespa (Brazilian market). During US daylight savings, market hours change +1 hour (I will not get into the reason). My EA must end profitable positions during the last 10 minutes of market run (in fact, before closing auction starts). Now it is hard coded:
I am trying to make this more reliable and soft coded. Even when I run a back-test, this hard code will not be last 10 minutes if US daylight is going on. Can lead to wrong conclusions.
Using SymbolInfoSessionTrade() is always returning 1970.01.01 00:00, which I believe is because of trade session hours for symbol:
I was thinking of getting the closing time of previous day, but this will lead to wrong time on 2 days per year.
Any idea?
Thanks in advance.