What could cause this error retcode: 10006

 
Hi,

My orders go through almost all the time but one order did not overnight and the only thing it says is Request rejected. Along with a retcode of 10006.
It doesn't offer anymore details on it. I just tried another order and it went through fine, so I'm a little puzzled by this?

I recently went from testing on a demo to a live and everything seems fine apart from this one order.

My broker temporarily closes the market for Forex at night for a few minutes which I have taken into consideration. I do not try to place orders in that time. Also it would tell me market closed was the reason if that was why it got rejected.

Like I said though, my other orders went through fine and I tried an order through the Forex pair today and it went through.

Just trying to understand different reasons as to why it would do that randomly. It can really mess things up if my orders don't go through.

Thanks
 
Dean-Trades: a retcode of 10006.

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and inive about your problem

Always post the market and your call's variables.

 

Take the forex market as an example:

when your BUY STOP order is sent to the trading server and the STOP price you set is lower than the latest ASK price, the order will fail and your MT5 client terminal will receive the 10006 code back from the server.


Take the stock/futures market as an example:

When your BUY STOP order is sent to the trading server and the STOP price you set is lower than the LAST price, the order will fail and your MT5 client terminal will receive the 10006 code back from the server.

 
Kang Feng #:

Take the forex market as an example:

when your BUY STOP order is sent to the trading server and the STOP price you set is lower than the latest ASK price, the order will fail and your MT5 client terminal will receive the 10006 code back from the server.


Take the stock/futures market as an example:

When your BUY STOP order is sent to the trading server and the STOP price you set is lower than the LAST price, the order will fail and your MT5 client terminal will receive the 10006 code back from the server.

I only use market orders. I did find an error though around the time is happened. I didn't actually notice but there were 3 different orders that rejected with no reason as to why.
Here's that error:

WARNING:waitress.queue:Task queue depth is 5

Not sure this would cause an order to reject as it's just a queue right?
 
Dean-Trades #:
I only use market orders. I did find an error though around the time is happened. I didn't actually notice but there were 3 different orders that rejected with no reason as to why.
Here's that error:

WARNING:waitress.queue:Task queue depth is 5

Not sure this would cause an order to reject as it's just a queue right?


It is recommended that your EA do the necessary checks before sending orders.

OrderCheck() is actually a useful function.

Market orders should be less likely to be rejected than stop/limit orders because no order price is specified.

Then it is possible that the problem is with the volume setting of the order you are sending. 

Check the specifications of the financial product you are trading with, you may need to use NormallizeDouble() function.


https://www.mql5.com/en/docs/trading/ordercheck

https://www.mql5.com/en/docs/convert/normalizedouble

Documentation on MQL5: Trade Functions / OrderCheck
Documentation on MQL5: Trade Functions / OrderCheck
  • www.mql5.com
OrderCheck - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Dean-Trades:
Hi,

My orders go through almost all the time but one order did not overnight and the only thing it says is Request rejected. Along with a retcode of 10006.
It doesn't offer anymore details on it. I just tried another order and it went through fine, so I'm a little puzzled by this?

I recently went from testing on a demo to a live and everything seems fine apart from this one order.

My broker temporarily closes the market for Forex at night for a few minutes which I have taken into consideration. I do not try to place orders in that time. Also it would tell me market closed was the reason if that was why it got rejected.

Like I said though, my other orders went through fine and I tried an order through the Forex pair today and it went through.

Just trying to understand different reasons as to why it would do that randomly. It can really mess things up if my orders don't go through.

Thanks

Sometimes there are clues in the journal tab - any meaningful messages there? 

Reason: