EAs don´t retry orders actions in Market Closed Error

Hello,



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.



Attachments
No attachments
  • Votes +5
  • Project StrategyQuant X
  • Type Feature
  • Status Fixed
  • Priority Normal

History

FB
#1

lumbrjack

25.04.2020 17:14

Task created

h
#2

hankeys

25.04.2020 21:07
Voted for this task.
IH
#3

clonex / Ivan Hudec

27.04.2020 09:27
Voted for this task.
TD
#4

Tomas.D

27.04.2020 10:45
Voted for this task.
TD
#5

Tomas.D

27.04.2020 10:48

Attachment Market is closed.png added

B127

This issue is still waiting to be fixed

m
#6

Martin

27.04.2020 19:46
Voted for this task.
l
#7

ludvick

30.04.2020 13:10
Voted for this task.
TB
#8

Tomas Brynda

23.05.2020 17:56

Status changed from New to Fixed

Attachment screen.png added

Hi Tomas D,

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

FB
#9

lumbrjack

25.05.2020 23:59
Set open bar delay is not the right solution. Every order will be open with delay due a rare error.


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;

h
#10

hankeys

26.05.2020 06:57
i agree, delay is not a solution, delay can be used if the broker has no trading minutes in the start of the candle, but cant be used, if the no trading sesstion is for example 23:00-23:15


market closed bust be added to retries

TB
#11

Tomas Brynda

26.05.2020 09:35

Type changed from Bug to Feature

Status changed from Fixed to New

Ok, we will add this handling into next build
TB
#12

Tomas Brynda

30.11.2020 07:27

Status changed from New to Fixed

It is fixed for MT4

Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please