My broker used shows "Market is closed" error for a few seconds to minutes at 17:00 o´clock. The problem that EAs didn´t attempt to retry after get this error as showed below:
2020.04.23 17:00:00.587 '5863942': order buy stop 0.06 USDJPY opening at 108.942 sl: 0.000 tp: 0.000 failed [Market is closed]
2020.04.23 17:00:00.697 '5863942': modification of order #832579521 sell 0.07 EURUSD at 1.08219 sl: 1.08737 tp: 1.04809 -> sl: 1.08637 tp: 1.04809 failed [Market is closed]
2020.04.23 17:00:00.712 '5863942': modification of pending order #832707520 sell limit 0.12 EURJPY at 116.153 sl: 117.103 tp: 115.990 -> price: 116.205 sl: 0.000 tp: 0.000 failed [Market is closed]
2020.04.23 17:00:00.712 '5863942': delete pending order #832707520 sell limit 0.12 EURJPY at 116.153 sl: 117.103 tp: 115.990
2020.04.23 17:00:00.744 '5863942': order sell stop 0.24 USDCHF opening at 0.96715 sl: 0.00000 tp: 0.00000 failed [Market is closed]
2020.04.23 17:00:00.869 '5863942': deleting of pending order #832707520 sell limit 0.12 EURJPY at 116.153 sl: 117.103 tp: 115.990 failed [Market is closed]
2020.04.23 17:15:00.604 '5863942': delete pending order #832707097 buy limit 0.12 EURJPY at 115.535 sl: 114.585 tp: 115.698
2020.04.23 17:15:00.776 '5863942': pending order #832707097 was deleted
As showed, next order action happened only in 17:15 and the attempts to modification an order did not execute at 17:00 due "market is closed" error.
Attachment Market is closed.png added
B127
This issue is still waiting to be fixed
Status changed from New to Fixed
Attachment screen.png added
a few users have already reported this kind of a problem with their brokers.
The solution is to set up an Open bar delay in your EA parameters - see the attached screenshot.
It is in minutes, so you can try to set 1-5 minutes delay.
Backtest results for strategies using stop/limit orders should not differ by using a few minutes delay.
If it doesn't help, please let me know.
Best regards,
Tomas
The right thing is treat this error like "Market Busy error" and add it as a retryable error in the OrderReliable.mqh as follow:
case ERR_SERVER_BUSY:
case ERR_NO_CONNECTION:
case ERR_OFF_QUOTES:
case ERR_BROKER_BUSY:
case ERR_TRADE_CONTEXT_BUSY:
case ERR_TRADE_TIMEOUT:
case ERR_TRADE_DISABLED:
case ERR_PRICE_CHANGED:
case ERR_REQUOTE:
case ERR_MARKET_CLOSED:
cnt++; // a retryable error
break;
default:
// an apparently serious, unretryable error.
exit_loop = true;
break;
market closed bust be added to retries
Type changed from Bug to Feature
Status changed from Fixed to New