runtime errors codes && server return codes

 

this thread is devoted for deep discussions of these errors esepcially trading errors either for mt5 or mt4

i now have some experience with this errors, and how to handle most of them ..

please if you face any strange error post it here, 

to start thread with error 10006 . . MT5

i faced this error yesterday for the first time in my live: ORDER_REJECT . . 

my suggestion to internally make your code to disable OrderSend/Modify etc for 3 hours (for example)

The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • 2016.08.01
  • www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
SalmanAlOtaibi:

this thread is devoted for deep discussions of these errors esepcially trading errors either for mt5 or mt4

i now have some experience with this errors, and how to handle most of them ..

please if you face any strange error post it here, 

to start thread with error 10006 . . MT5

i faced this error yesterday for the first time in my live: ORDER_REJECT . . 

my suggestion to internally make your code to disable OrderSend/Modify etc for 3 hours (for example)

Why was it rejected ? Do you know it ?

If not the broker should answer about that.

 
Alain Verleyen #:

Why was it rejected ? Do you know it ?

If not the broker should answer about that.

Rejects are quite common. If i would have to get my broker to answer for each reject, the broker can stop being a broker and become 100% helpdesk instead.

It should not or rarely happen if at all with market order, but with limit orders and in case the broker uses limit orders for take profit as was the standard for mt4, it should not be any surprise. 

Above an example. Multiple rejects, but filled. It can happen the order is rejected completely. Therefor the logic should take this into account.

 
Enrique Dangeroux #:

Rejects are quite common. If i would have to get my broker to answer for each reject, the broker can stop being a broker and become 100% helpdesk instead.

If an order is rejected without a valid reason, that seems like a bug, isn't it ?

If you know the reason, of course it's fine to just deal with it in the code.

It should not or rarely happen if at all with market order, but with limit orders and in case the broker uses limit orders for take profit as was the standard for mt4, it should not be any surprise. 

Why not a surprise with limit orders ? I don't get it.

 
Alain Verleyen #:

Why was it rejected ? Do you know it ?

If not the broker should answer about that.

It was rejected with that broker for some hours, even all other condition are 100% correct

i try manual entry, also recieved 10006 ,

 
Alain Verleyen #:

If an order is rejected without a valid reason, that seems like a bug, isn't it ?

If you know the reason, of course it's fine to just deal with it in the code.

Why not a surprise with limit orders ? I don't get it.


my broker at that moment only allow closeOnly !!

when i close everthing orders=postions=0

i tru manualy and through expert --- again 10006

after some hours things become normal

and based on that for this error, may suggestion: trading-prevenetion for sometime?

and if there is a loop (placing 100 pending order) must be broken immediatly 

we must treat it in this case like error 10026/10027/10017/10016 / 10031/10032 -- fatal error that must break the loop

any objection? since iam not the best one here . .