MT5 error 10019: Not enough money (TRADE_RETCODE_NO_MONEY)

The account's free margin can't cover the order. Nothing was executed; reduce the volume or free up margin first.

10019TRADE_RETCODE_NO_MONEY
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.

Opening the position would need more margin than the account has free. The server refuses rather than let the account go below its margin rules.

Margin depends on the symbol, the volume, the leverage and the current price, so an order that fit yesterday can fail today.

Common causes

  • A volume too large for the account's balance and leverage.
  • Open positions in loss that have eaten into free margin.
  • A symbol with a high margin rate, such as an index or a metal.
  • Leverage lowered by the broker, for example before a weekend or an event.

How to fix it

  • Ask the terminal for the margin first with order_calc_margin() and compare it with account_info().margin_free.
  • Size the order from free margin, not from balance.
  • Leave a buffer for spread and price moves between the check and the send.

Example in Python:

import MetaTrader5 as mt5

tick = mt5.symbol_info_tick("XAUUSD")
need = mt5.order_calc_margin(mt5.ORDER_TYPE_BUY, "XAUUSD", 0.5, tick.ask)
free = mt5.account_info().margin_free
if need is None or need > free * 0.9:
    print(f"skip: needs {need}, free {free}")

Is it safe to retry?

After you reduce the size or free up margin. The same request fails the same way.

Could the order have executed?

No. The order was refused.

How Tickwire handles it

Tickwire returns 10019 with outcome rejected. Account information shows freeMargin and leverage, so you can size orders before sending. See the quickstart.

MT4 error 134 comes back as 10019.

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.