Strategy testing and trading software · Germanycontact@stratcorealpha.com · DE
All trading software errors

MT4 · code and request checks

MT4 error 134 not enough money: check the requested lots

Your 100-lot request can fail with 10,000 in free margin. My MT4 test returned error 134; the same BUY at 0.1 lots was accepted.

Native MT4 tester: 100 lots rejected with error 134, 0.1 lots accepted, 10,000 starting free margin and zero account orders.

Arnold Holm · 2026-10-15

What the error means

A trader reported error 134 on the first trade even though the account appeared to have enough funds. That is a useful place to start: inspect the amount the EA actually requested. A percentage-risk input does not tell you the final lot amount, and a positive balance does not mean every legal position size is affordable. I ran my own small case in MT4 build 1491, using EURUSD H4 in the native Strategy Tester. The tester started with balance and free margin of 10,000 and an account ratio of 1:100. Its symbol allowed volumes from 0.1 to 100 lots in steps of 0.1. The 100-lot BUY was legal as a volume, but needed 120,440 in margin. The tester rejected it with ticket -1 and error 134. I then sent the same side at the minimum 0.1 lots. That simulated BUY received ticket 1 and error 0. I read the recorded order volume back and closed it in the tester. I check the actual requested lots and free margin before changing the signal or adding money.

Three code paths to check

  1. 1. The risk input hides the final volume

    A setting such as two percent is only an input. The code still has to turn a stop distance and cash risk into lots in the correct units. A misplaced conversion can produce a much larger request than the label suggests. Log the final lots immediately before the send, beside the symbol minimum, maximum and step. In my case, 100 lots passed those symbol limits and still failed the money check. A valid volume and an affordable volume are separate checks.

  2. 2. Balance is being used in place of free margin

    Use the account state at the request time. Existing positions and open losses can change what remains available. The MT4 AccountFreeMarginCheck function evaluates the remaining margin for a specified symbol, side and volume at current prices. Its documented insufficient-margin result raises error 134. Clear the old error before calling it and capture the result immediately. Keep that preflight result separate from the eventual OrderSend result. A successful preflight does not reserve funds or prevent a later rejection.

  3. 3. Making the order smaller is treated as a complete repair

    The smaller order in my test answered one narrow question: would this account state accept that amount? It did not establish a suitable stop, a cash-risk budget or a profitable strategy. I would first correct the calculation that produced the unintended size. Then I would check the intended stop-loss risk and margin again. If the smallest legal amount is too large for the chosen risk, the trade should stay blocked. Automatically raising it to the broker minimum changes the risk you asked for.

The tester-only volume change that reproduced the error

This excerpt preserves the two requests used in the test. The complete EA rejects any launch outside the tester. It records both return values and errors, checks the accepted order's actual volume and closes that simulated position. The screenshot shows the 100-lot rejection and the accepted 0.1-lot request on the same run. Use the result to compare your own failed request, rather than paste this test sequence into an EA that trades an account. The example intentionally tries an unaffordable request to make the failure visible.

if(!IsTesting()) return;
double excessive=MarketInfo(Symbol(),MODE_MAXLOT);
double lots=MarketInfo(Symbol(),MODE_MINLOT);
ResetLastError();
int bad=OrderSend(Symbol(),OP_BUY,excessive,Ask,10,0,0,"FIX12 unaffordable valid volume",607,0,clrNONE);
int badError=GetLastError();
ResetLastError();
int good=OrderSend(Symbol(),OP_BUY,lots,Ask,10,0,0,"FIX12 affordable min volume",607,0,clrNONE);
int goodError=GetLastError();

This was an offline/default MT4 tester run on one symbol and account setup. It sent zero account orders and does not establish a safe trading size.

How you know it is fixed

The large legal volume is rejected

The 100-lot request returned ticket -1 and error 134. The tester logged required margin of 120,440 against 10,000 free margin. Preserve the surrounding Journal lines so the generic error retains its cause.

The smaller amount is accepted and read back

The 0.1-lot BUY returned ticket 1 and error 0. Reading the simulated order confirmed the requested volume. A positive ticket alone was not the only check; the order was also closed in the tester.

Your five-minute Journal check

Open one rejected trade in your MT4 Journal. Compare its requested lots, free margin and required margin at that exact time. If the number differs from your calculation, trace that conversion first. Then inspect the symbol volume rules and the margin preflight before another demo attempt.

Your own source

Find the next line to check

Start with the free EA-Check. Your code stays in your browser. It highlights patterns with line numbers; it does not prove the broker accepts an order.

Check my EA locally

Want one small change shown on your own case?

SOLVED-FIRST: one small fix or change to your own case, shown first as screenshots or a short screen video. 15 USD fixed (or the higher platform minimum), first five paid orders only during 4–17 October 2026. The file follows within 24 hours after funding. Close on Upwork first; marketplace cases stay on their marketplace.

Outside that sprint: R49: one authorised, reproducible MT4/MT5 defect, with three agreed cases. 49 USD fixed. Delivery within 48 hours after source review and funding. The exact case is agreed before funded work.

Send the expected and actual behaviour

Common questions

Does error 134 mean my entry signal is wrong?

It identifies insufficient money for that request. Start with the actual volume and account margin state; changing the signal alone does not explain the rejection.

Is this the same as MT5 error 10019?

Both concern insufficient funds, but MT4 and MT5 use different request APIs and error reporting. The linked MT5 page shows its separate calculation case.

Sources and limits

These public questions explain the error; use your own EA log to check whether the same cause applies.

Trading risk disclosure

Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one's financial security or lifestyle. Only risk capital should be used for trading, and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical performance disclosure

Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. There are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical results are generally prepared with the benefit of hindsight, do not involve financial risk, and cannot completely account for the impact of financial risk in actual trading. Market conditions, the ability to withstand losses, and adherence to a trading program can all materially affect actual results.

NinjaTrader trademark disclosure

NinjaTrader® is a registered trademark of NinjaTrader Group, LLC. No NinjaTrader company has any affiliation with the owner, developer, or provider of the products or services described herein, or any interest, ownership or otherwise, in any such product or service, or endorses, recommends or approves any such product or service.

Testimonials, when shown, may not represent the experience of other clients and are not a guarantee of future performance or success. Virtual-currency trading carries additional risks. See the CFTC customer advisories. Read the full financial risk disclaimer.