Troubleshooting

Common MetaTrader EA Errors and How to Troubleshoot Them

Most Expert Advisor problems come down to a handful of causes: the file is in the wrong place, trading isn't allowed, or the broker rejects the order. This guide shows where to look and how to fix the common ones.

By FX Bot Hub GuidesUpdated 3 min read

First, read the logs

Open the Terminal window in MT4 or the Toolbox in MT5 (Ctrl+T). The Experts tab shows messages from your EAs, and the Journal tab shows platform messages such as connection problems and rejected orders. The exact error text there usually points straight at the cause.

The EA doesn't appear in the Navigator

  • Wrong folder — EAs belong in MQL4\Experts (MT4) or MQL5\Experts (MT5) inside the data folder (File → Open Data Folder), not in the program's installation folder.
  • Wrong platform — an .ex4 file won't load in MT5 and an .ex5 won't load in MT4.
  • Not refreshed — right-click Expert Advisors in the Navigator and choose Refresh, or restart the platform.
  • Still zipped — extract .zip archives before copying the files.

The EA is attached but won't trade

Two switches must both be on: the platform-wide AutoTrading button (MT4) or Algo Trading button (MT5), and the EA's own permission — Allow live trading in MT4 or Allow Algo Trading in MT5, on the Common tab of its properties (press F7 on the chart). When either is off, MT4 reports error 4109 (trade not allowed) and MT5 reports 4752 (trading disabled for Expert Advisors).

  • Check whether the market for that symbol is open — trades are rejected outside trading hours.
  • Some symbols are close-only or disabled on certain account types; check Specification in Market Watch.
  • Some brokers restrict automated trading on particular accounts. Ask your broker if every switch is on and trades still fail.

Orders rejected by the broker

Common order errors
ErrorPlatform codeWhat usually causes it
Invalid stopsMT4 130 · MT5 10016Stop-loss or take-profit too close to the price (inside the broker's minimum stop level) or on the wrong side
Invalid volumeMT4 131 · MT5 10014Lot size below the minimum, above the maximum, or not a multiple of the volume step
Not enough moneyMT4 134 · MT5 10019Insufficient free margin for the position size
Market closedMT4 132 · MT5 10018Trading attempted outside the symbol's session

Fixes usually involve the EA's inputs: reduce the lot size, widen the stop distance, or use a symbol your account can trade. If the EA can't handle your broker's conditions (for example a different number of decimal places), contact its developer.

DLL imports not allowed

Some EAs call external libraries (DLLs). If the log says DLL calls aren't allowed, enable Allow DLL imports in the EA's properties — only for software from a source you trust, because DLLs run outside MetaTrader's protections.

License checks or web requests failing

EAs that verify a license online use MetaTrader's WebRequest function, which only works for addresses you allow. Go to Tools → Options → Expert Advisors, tick Allow WebRequest for listed URL, and add the address the developer gives you. Per MetaQuotes' documentation, WebRequest can't be used from indicators or inside the Strategy Tester.

Other common problems

  • The EA stopped overnight — MetaTrader must stay open and connected. If your computer sleeps or restarts, the EA stops; a VPS avoids this.
  • Settings lost after restart — save your inputs as a .set file and keep your chart layout in a profile or template.
  • "Not enough bars" or no signals in the tester — download more history or choose a longer test period.
  • Different results live and in the tester — usually spreads, slippage and execution; see How to Run a Strategy Backtest in MT5.

Put it into practice

All tutorials

Step-by-step tutorials that build on this guide.

  • Forex Bots & EAsIntermediate

    How to Troubleshoot an EA That Isn't Trading

    Work through the checks that fix most idle Expert Advisors in MT4 and MT5: permissions, market hours, the logs, broker rejections, filters and inputs.

    About 20 min(estimate) 8 steps
  • MetaTrader 4Beginner

    How to Read the MT4 Experts and Journal Logs

    Use the MT4 Experts and Journal tabs to see what your EA and terminal are doing, open the log files on disk, and copy the right lines for support.

    About 10 min(estimate) 6 steps
  • MetaTrader 5Beginner

    How to Install an Expert Advisor in MT5

    Install an Expert Advisor in MetaTrader 5: copy the .ex5 file to MQL5\Experts, attach it to a chart, allow Algo Trading and confirm it's running.

    About 10 min(estimate) 7 steps
All guides
  • Expert Advisors & Forex Bots

    What Is a Forex Expert Advisor (EA)?

    What a MetaTrader Expert Advisor is, how forex trading bots make decisions, common strategy types, and the real limits and risks of automated trading.

    3 min read