MT5 error 10014: Invalid volume (TRADE_RETCODE_INVALID_VOLUME)

The lot size is below the minimum, above the maximum or off the volume step. Nothing was executed; round the volume and resend.

10014TRADE_RETCODE_INVALID_VOLUME
After a fixSafe to retry?
NoCould it have executed?

What it means

You see this code in the retcode of a trade result, from OrderSend() in MQL5 or order_send() in Python.

Every symbol has a smallest volume, a largest volume and a step. A volume that breaks any of the three is refused with 10014.

Cent and micro accounts often have different limits from standard accounts at the same broker, so a size that works on one account can fail on another.

Common causes

  • A volume below volume_min, often from a risk formula that returns a tiny number.
  • A volume above volume_max.
  • A volume that isn't a whole multiple of volume_step, such as 0.015 when the step is 0.01.
  • Floating point leftovers like 0.30000000000000004.

How to fix it

  • Read volume_min, volume_max and volume_step from symbol_info() for that exact symbol name.
  • Round down to the step, clamp to the limits, then round to a sane number of decimals.
  • Skip the trade if the rounded size falls below the minimum, rather than forcing the minimum.

Example in Python:

import math
import MetaTrader5 as mt5

def valid_volume(symbol, raw):
    s = mt5.symbol_info(symbol)
    steps = math.floor(raw / s.volume_step + 1e-9)
    vol = round(steps * s.volume_step, 8)
    if vol < s.volume_min:
        return None                  # too small to trade: skip it
    return min(vol, s.volume_max)

print(valid_volume("EURUSD", 0.237))  # 0.23 when the step is 0.01

Is it safe to retry?

Yes, once the volume fits the symbol's rules.

Could the order have executed?

No. The order was refused.

How Tickwire handles it

Tickwire checks the volume against the symbol's minimum, maximum and step before sending. A bad volume is refused with 10014 and nothing is sent.

minVolume and volumeStep are in the symbol specification. See broker quirks.

MT4 error 131 comes back as 10014.

Related MT5 Python functions

All MetaTrader error codes

One API for MT4 and MT5

Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.