MT4 · code and request checks
MT4 error 131: 0.05 lot failed, 0.10 passed in the tester
Your MT4 EA can miss an entry with 131 because its calculated size is below this symbol's allowed minimum. My native tester rejected 0.05 lot and accepted 0.10 lot. These were simulated orders, not account trades.

Arnold Holm · 2026-10-07
What the error means
I keep the risk calculation unchanged and stop the order when the allowed minimum would make the position too large. Open one failed request in your Journal and compare its lot size with MODE_MINLOT, MODE_MAXLOT and MODE_LOTSTEP for that exact symbol. I ran this case in the native MT4 Strategy Tester, build 1491, on EURUSD H4 for 3–4 May 2021. The program refuses to run outside the tester. The symbol reported a minimum of 0.10 lot and a step of 0.10. I first requested half the minimum,0.05. OrderSend returned minus one and GetLastError returned 131. I then requested the minimum,0.10. That request returned ticket 1 with error 0. I selected the simulated order and read back its volume as 0.10, then closed it inside the tester. No account order was sent. The result shows the smallest useful correction for this specific failure: use a volume the symbol allows. It does not justify rounding every calculated volume upward. If your risk calculation asks for less than the broker minimum, making the position larger changes your risk. Stop that trade and explain the mismatch instead. MT4 uses 131 for invalid trade volume. A request with a completely invalid function argument can produce another error instead; the code number from the actual failed request decides which case you have.
Three code paths to check
1. Your calculated lot size is below the minimum
Read MODE_MINLOT for the exact symbol, not a value remembered from another account. A calculated 0.05 cannot be submitted where the minimum is 0.10. Keep the original risk calculation in the log. If the allowed minimum would exceed your planned loss, stop the request rather than doubling the size to make it pass.
2. The size does not fit the lot step
Read MODE_LOTSTEP and check whether the proposed size belongs to the allowed set. Formatting a number to two decimal places only changes its appearance; it does not prove that the broker permits that increment. Keep this check next to the request so that later sizing changes cannot bypass it.
3. A copied setting exceeds the symbol maximum
Read MODE_MAXLOT too. The same account can expose different rules for different symbols. Check positive values, the minimum, the maximum and the step together. A missing or unusable symbol property should stop the order path and produce a readable log, rather than silently falling back to a guessed lot size.
Own pattern: reject a size that does not fit the symbol
Use this check before the send path and log the proposed size with all three symbol properties. If it returns false, leave the calculated size unchanged and stop the order. Decide separately whether your rule can take an allowed size at its intended risk. The native case used 0.10 after explicitly selecting the symbol minimum; it did not secretly increase an arbitrary risk-sized position.
bool VolumeAllowed(string symbol, double lots)
{
double minLot = MarketInfo(symbol, MODE_MINLOT);
double maxLot = MarketInfo(symbol, MODE_MAXLOT);
double step = MarketInfo(symbol, MODE_LOTSTEP);
if(step <= 0 || minLot <= 0 || maxLot < minLot) return false;
if(lots < minLot || lots > maxLot) return false;
double steps = lots / step;
return MathAbs(steps - MathRound(steps)) < 1e-8;
}These are simulated EURUSD orders in the native MT4 tester, using its loaded symbol rules. Check the intended demo account separately before applying any change to your EA.
How you know it is fixed
Before: below the minimum
With minimum 0.10 and step 0.10, requested 0.05 must be rejected. The native run returned ticket minus one and error 131, with no simulated position opened for that request.
After: allowed minimum
Requested 0.10 passed in the native tester. The log recorded ticket 1, error 0 and selected order volume 0.10. Check the selected order, not just the function return.
Keep the risk decision separate
A calculated size below the minimum stops. A size above the maximum or off the step stops too. Do not turn a rejected size into a larger position without an explicit sizing decision.
I can fix it for you
If the three agreed tests don't pass, you get your money back. I fix one authorised, reproducible MT4 or MT5 defect in readable source up to 500 lines. The fixed price is 49 USD. Delivery is within 48 hours after source review and funding.
Free demo of your fixCheck my EA locallyRequest a free demo of your fix
Related checks
Common questions
Is 0.01 lot always valid?
No. Read the minimum and step for the current symbol. A micro-lot setting from another account can be below this account’s minimum.
Will NormalizeDouble fix error 131?
It can format a value but it cannot establish the permitted lot increments. Check the symbol rules and the planned risk before deciding which volume to send.
Sources and limits
- Official MT4 errors:131 invalid trade volume
- Official MT4 minimum, maximum and lot step
- Observed trader question behind this guide
These public questions explain the error; use your own EA log to check whether the same cause applies.