1 (edited by lisaforex 2025-01-31 12:46:25)

Topic: 90% of trades opening at 0:00

This is similar to error described at this post here https://forexsb.com/forum/topic/9887/is … ed-errors/, but I believe it isn't a setting based solution as mentioned in the previous post.

I generated a basic random strategy on the H1 timeframe for the USDJPY. Equity chart looks good. No issues there. However, I find alot of the times, I cannot replicate EA Studio Backtest report in MT5. Backtesting on MT4 works fine, but in MT5, I get a bunch of 'Market Closed' errors. Upon further investigation into the individual trades within EA studio itself, 51/53 trades are entering at 0:00 which is causing the error. Really? That is highly unlikely considering I'm looking at a multi year strategy where the entry logic is simple: "Enter when the bar opens below after opening above it".

This is not the first time I have seen this error. I get it many times on many different currency pairs.

Post's attachments

trades.png 164.38 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: 90% of trades opening at 0:00

Ah, seems like changing the session times did fix the issue. EAs are now being generated with varying open times, not just 0:00 anymore.

Re: 90% of trades opening at 0:00

It is nice you have found the reason for the issue!

4 (edited by geektrader 2025-02-01 14:42:23)

Re: 90% of trades opening at 0:00

lisaforex wrote:

This is similar to error described at this post here https://forexsb.com/forum/topic/9887/is … ed-errors/, but I believe it isn't a setting based solution as mentioned in the previous post.

I generated a basic random strategy on the H1 timeframe for the USDJPY. Equity chart looks good. No issues there. However, I find alot of the times, I cannot replicate EA Studio Backtest report in MT5. Backtesting on MT4 works fine, but in MT5, I get a bunch of 'Market Closed' errors. Upon further investigation into the individual trades within EA studio itself, 51/53 trades are entering at 0:00 which is causing the error. Really? That is highly unlikely considering I'm looking at a multi year strategy where the entry logic is simple: "Enter when the bar opens below after opening above it".

This is not the first time I have seen this error. I get it many times on many different currency pairs.

Hey,

Lots of traders get confused about trading right at midnight server time (00:00). It's super important to understand this, especially when you're developing your trading strategies. This is especially true if you use EA Studio (which uses "fake", fixed spreads) or MT5 (which uses real, changing spreads).

The "Market Closed" errors you see in MT5 at 00:00 are because of how the "spread" (the difference between the buy and sell price) acts when the Asian market opens.

Here's the main point: EA Studio, when it uses fixed spreads that stay the same, doesn't show you what really happens to the spread at 00:00. In real trading, the spread always gets much bigger exactly at midnight server time. This is because the big banks in America stop trading for the day, and the banks in Asia take over. The spread can jump up to be way bigger than normal – sometimes even 30 times bigger!

Because EA Studio uses fixed spreads, it only sees the price movement. At 00:00, it looks like there are good trading chances when the price jumps up or down quickly. EA Studio might create trading strategies that try to use these spikes at 00:00, thinking it can trade with the normal spread and monetize them.

But in real trading (and in MT5 if it's set up right), it's not like that. At 00:00, the spread is actually HUGE. It's not a good time to trade. When MT5 tries to do these trades based on real market conditions with real spreads, it correctly says "Market Closed" because the spread is too big. Brokers stop trades from happening then to protect you from bad trades during these crazy spread times, usually just for a few minutes (you can verify this if right clicking on any symbol in MT5 and check the trading session times).

So, if you create trading strategies in EA Studio based on these "nice spikes" at 00:00 (using fixed spreads), they look like awesome tradable opportunities on paper, but they will fail in real trading. They are trying to use something that isn't really there in the way EA Studio shows it. This is just a problem with testing using fixed spreads.

An easy way to fix this and get better realistic results is to just ignore the midnight server time hour in your trading settings in EA Studio. The spread goes back to normal about an hour after the Asian market opens, around 1:00 server time. Just set your trading session times to "01:00 - 23:59" and it will solve this problem.

Re: 90% of trades opening at 0:00

Geektrader,

Your post is misleading.

EA Studio uses real spreads for backtesting.

You may see that on the Indicator Chart:

https://image-holder.forexsb.com/store/eas-real-spread-thumb.png

The only case in which EA Studio uses fixed spread is if you import your own data without real spread information.

6 (edited by geektrader 2025-02-03 21:17:42)

Re: 90% of trades opening at 0:00

Absolutely, but in the above case of LisaForex, I am 100% sure rather custom data has been used or dynamic spread has been disabled. With dynamic spread enabled, these kind of strategies wouldn´t appear in the first place.

Re: 90% of trades opening at 0:00

Thanks Geektrader. I've adjusted the session times to skip trading in the first hour "01:00 - 23:59", which works great for 1H and 4H timeframes. However, I can't seem to get it working on D1 timeframes. Seems like the logic is only checked at the opening of the bar. So if trading is disabled for the first hour, D1 EAs never trade.

Re: 90% of trades opening at 0:00

Great to hear it helped. Yes, that will obviously not work on D1 as all the logic is only always checked on bar open.