Handling OrderSend errors in MT4: 130, 134, 136 and what to do with each
Posted: Thu Oct 15, 2026 8:47 pm
Handling OrderSend errors in MT4: 130, 134, 136 and what to do with each
Every EA eventually hits order errors, and a lot of EA problems come from handling them badly. The common response is to retry immediately, which can make things worse. Here are three I see often and how I think about them.
Error 130, invalid stops. Your stop loss or take profit is too close to the current price or on the wrong side of it. This often happens when the broker has a minimum stop level and the EA ignores it, or when price moves between calculating the stop and sending the order. The fix is to check the stop level from the symbol info before sending, and recalculate stops using a fresh price right before the order.
Error 134, not enough money. The account doesn't have the margin for the size. Retrying won't help. The EA should reduce size or skip, and log it so you notice.
Error 136, off quotes. The broker couldn't provide a price, often during fast markets or news. A short wait and a limited number of retries with a fresh price can make sense, but with a cap so the EA doesn't loop forever.
The general rule: separate errors that might clear on their own from errors that mean something is wrong with the order. Retry the first type a limited number of times. Stop and log the second type.
What does your EA do when an order fails?
Every EA eventually hits order errors, and a lot of EA problems come from handling them badly. The common response is to retry immediately, which can make things worse. Here are three I see often and how I think about them.
Error 130, invalid stops. Your stop loss or take profit is too close to the current price or on the wrong side of it. This often happens when the broker has a minimum stop level and the EA ignores it, or when price moves between calculating the stop and sending the order. The fix is to check the stop level from the symbol info before sending, and recalculate stops using a fresh price right before the order.
Error 134, not enough money. The account doesn't have the margin for the size. Retrying won't help. The EA should reduce size or skip, and log it so you notice.
Error 136, off quotes. The broker couldn't provide a price, often during fast markets or news. A short wait and a limited number of retries with a fresh price can make sense, but with a cap so the EA doesn't loop forever.
The general rule: separate errors that might clear on their own from errors that mean something is wrong with the order. Retry the first type a limited number of times. Stop and log the second type.
What does your EA do when an order fails?