What have you tried ?
Why could you not use the server time ?
What have you tried ?
Why could you not use the server time ?
Hi Alain, thank you for your answer.
I didn't try anything. I just don't know how I can detect if EA is in this time period.
if(serverTime > 11:59 && serverTime < 00:02){ //things to do }
I need something like above code but every broker has its own timezone. So, may be, I need to get server time zone and convert it to GMT and check it after conversion. But this time, it will change on March because of Daylight Saving.
I want above code work correctly on every broker during whole year.
Or may be there is a command to check if the broker is in "daily trading break". Ticks come but broker does not accept orders in this time period.
Hi
u can try iTime() & collaborate with TimeCurrent() at each conditions before open transactions.
i have simillar problems with dailly trade like ur conditions before.
Thanks, hope this sollution can help u bro.
Why? During the break there should be no ticks. Your code shouldn't be running.
It seems that the EA still gets ticks during that time. My EA tried to close an order during that time. The order couldn't be closed and GetLastError() returned "0". (The code was in onTick)
Here is also an explanation by Global Prime:
Daily Trading Break
There is a daily 3 minute break in trading from 23:59-00:02 platform time. Clients are able to see the prices streaming during this break. No orders can be placed and pre-existing orders cannot be executed during this time. This is to safeguard from positions with a Stop Loss getting hit by the potential spread spike that can occur over rollover when Liquidity Providers reset their pricing for the new trading day at 00:00 platform time (which is 5pm New York City).
- www.globalprime.com.au
Hi
u can try iTime() & collaborate with TimeCurrent() at each conditions before open transactions.
i have simillar problems with dailly trade like ur conditions before.
Thanks, hope this sollution can help u bro.
Thank you Ricky. I think TimeGMT()
would be better to check but this time Market closes 22:00 GMT but will be
changed from 22:00 GMT to
21:00 GMT during summer
time. So, Do I have to take this into account and write a code according to whether it's summer or winter, or there is a better
way?
Hmm. TimeDaylightSavings() return
"0" if it is in winter time. Good to know.

Thank you Ricky. I think TimeGMT()
would be better to check but this time Market closes 22:00 GMT but will
be changed from 22:00 GMT to
21:00 GMT during summer
time. So, Do I have to take this into account and write a code according to whether it's summer or winter, or there is a
better way?
Hmm. TimeDaylightSavings() return
"0" if it is in winter time. Good to know.
it will good bro,
making EA will spend much time to role a plan and make it better.
using a few ideas in the code will make you find which one is suitable for your EA.
It even allows you to do some new ideas from it :)
using "TimeGMT()" will be more specific, but will make some possibilities decrease. I'm not saying it's good or bad, because every EA creation will be subjective on the idea of the maker.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I need to stop sending orders to the server for 3 minutes during the daily trading break (23:59-00:02)? (which depends on the broker)
Market opening time is different in winter and summer, so I can not use local system time while comparing.
I can not use server time as well. I guess each broker sets its own time zone on the server side. (Am I correct about this?)
So what is the optimal way to achieve this?
Thank you.