Skip to content
RealTradeMaster

MetaTrader 5 troubleshooting

How do you fix MT5 error 10019?

MT5 trade server code 10019 means the server found insufficient funds to complete the request. For a new order, compare the margin needed for the exact request with free margin. A positive account balance can coexist with insufficient free margin. Open positions and some pending orders already use part of the account's funds. MetaQuotes trade server codes · MQL5 account properties

1. Confirm the actual request and current free margin

Check Free Margin in MT5's Toolbox → Trade tab. For an EA, capture ACCOUNT_MARGIN_FREE around the failed attempt, along with the exact symbol, direction, volume in lots and proposed price. Use the volume actually submitted, since an EA may have rounded or changed the size while preparing the request. In Market Watch → Specification, check the minimum volume, volume step and the broker's margin terms for that symbol. MetaTrader 5 Market Watch and Specification

2. Estimate the order, then check the full request

OrderCalcMargin() estimates margin for an order type, symbol, volume and price in the account currency. It estimates the order on its own, without including existing positions or pending orders. An EA can run OrderCheck() on the exact proposed request and inspect its return code, comment, margin and projected free margin. Broker and account rules, including netting or hedging, can make the order's impact different from the standalone estimate. MetaQuotes on OrderCalcMargin · MetaQuotes on OrderCheck · Request check result fields

Worked example. Suppose the account has $120 of free margin and a standalone estimate puts the new order at $180. In the simple case where the new order adds its full margin, the request is $60 short before any price changes. If an existing position changes the calculation, use the exact request precheck to see the projected free margin. If the minimum permitted size still fails the account's checks or the strategy's risk budget, skip the setup.

3. Handle the rejection in the EA

Log the reason and stop retrying the unchanged request. If the strategy permits a smaller order, round the candidate size down to a valid volume step, confirm it still meets the minimum and run a fresh precheck. Verify that the position size also satisfies the planned loss limit at the stop. Margin is the amount required to support the trade. The loss at the stop is a separate calculation.

Frequently asked questions

Why can error 10019 appear while there is money in my balance?

Free margin changes with equity and used margin. The server evaluates the funds available for the operation, which can be much lower than the balance.

Is 10019 the same as invalid volume?

No. MetaQuotes uses code 10014 for invalid volume. A volume can follow the symbol's lot rules and still require more funds than are available. MetaQuotes trade server codes

Get help with the rejection

Need help reading a margin rejection? Share the exact symbol, order type, volume and sanitized error line in TradeMaster Discord. Keep account IDs and unredacted statements private.

MetaQuotes references