MetaTrader 5 error 10019 · TRADE_RETCODE_NO_MONEY
Not enough money (free margin) to open this trade.
Check an order against MetaTrader 5 rules before sending it (free)
What the venue says
- There is not enough money to complete the request
Source: trade server return codes (MqlTradeResult.retcode), read 2026-11-28. Market: all.
Usual causes
- Lot size too large for the free margin
- Leverage lower than assumed
- Other open positions use the margin
How to fix it
- Before sending, compute required margin with OrderCalcMargin and compare with ACCOUNT_MARGIN_FREE
- Lower the lot size or close other positions
- Use a risk-based lot size instead of a fixed large lot
Check free margin before sending
bool MarginOk(const string sym, const ENUM_ORDER_TYPE type, const double lots)
{
double price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(sym, SYMBOL_ASK) : SymbolInfoDouble(sym, SYMBOL_BID);
double need = 0.0;
if(!OrderCalcMargin(type, sym, lots, price, need)) return false;
return need < AccountInfoDouble(ACCOUNT_MARGIN_FREE);
}Also known as: no money, not enough money, insufficient funds.
Stop this error before the order leaves your bot
The free order check tests size, price, tick, lot step and venue rules for one order and returns the venue error code it would hit. The free EA code check reads MQL5 and Python bot code for the rule checks that stop codes like this one. Both are free; the full EA list is US$19 with a 30-day refund.
Free order check Free EA code check
This page explains an error message. It is information for developers, not financial advice and not a recommendation to trade. Codes and texts come from the venue's official documentation on the date shown; venues change them, so check the source before relying on it. Register built 2026-11-28; the receipt id for this entry is rcp_371ffb2563174eceaaf5.