Installation & SetupBeginner10 min read

EXPERT ADVISOR NOT WORKING? COMPLETE MT4 & MT5 DIAGNOSTIC GUIDE

Step-by-step troubleshooting checklist when an Expert Advisor won't attach, shows a sad face, or fails to open trades—including MT4/MT5 error codes 130, 131, 133, 134, and 4109.

By YoForexEA Research Desk

Quick Summary

When an Expert Advisor is not working in MT4 or MT5, verify the chart status icon (smiley face or active cap), confirm global and chart AutoTrading permissions, ensure the market is open with matching broker symbol suffixes, and inspect the Terminal Experts and Journal tabs for specific broker rejection codes such as 130, 131, 133, 134, or 4109.

Start With the Visual Status Icon

Before changing EA parameters, look at the top-right corner of your MetaTrader chart and the main toolbar:

  • No EA Name Displayed at All: The EA was never attached to that chart, failed initialization inside OnInit(), or removed itself intentionally (for example, due to an incompatible timeframe, symbol restriction, or expired trial key).
  • MT4 Sad / Frown Face: Automated trading permission is blocked either on the toolbar (AutoTrading button is red) or in chart properties (F7 > Common > Allow live trading unchecked).
  • MT5 Gray or Red Badge: Algo Trading is disabled globally in the toolbar or disabled under F7 > Common > Allow Algo Trading.
  • Smiley Face / Active Green Icon, Still Zero Trades: Permissions are active, so the block is coming from strategy conditions, spread filters, wrong symbol naming, market closure, or a broker order rejection logged in the Terminal tabs.

7-Point Diagnostic Checklist

  1. Check Connection Status (Bottom-Right Corner): Ensure MetaTrader displays live kilobyte bandwidth (e.g., 124/8 kb) rather than No connection, Invalid account, or Common error. Also verify you logged in with your Master / Trader password, not the read-only Investor password.
  2. Confirm Market Hours and Incoming Ticks: Almost all EAs execute trade logic inside OnTick(), which runs only when your broker sends a fresh price quote. Over weekends, daily market rollover breaks, or public holidays, zero ticks arrive so no new entries occur.
  3. Verify Broker Symbol Naming and Suffixes: If your broker uses EURUSD.m, EURUSDpro, XAUUSD.raw, or GOLD instead of plain XAUUSD, check whether the EA's symbol input matches the Market Watch spelling exactly (case-sensitive).
  4. Inspect Spread and Time Filter Inputs: Many scalpers include a MaxSpread input measured in points rather than pips. Entering 2 instead of 20 on a 5-digit broker sets a 0.2-pip ceiling and blocks every entry permanently. Similarly, verify GMT offset settings match your broker server clock.
  5. Check Free Margin and Minimum Lot Rules: If your account balance is too small for the requested lot size—or existing open trades consume free margin—order requests fail immediately.
  6. Verify DLL and WebRequest Whitelists: EAs that rely on external news calendars or HTTP APIs silently abort trade decisions if their required URL is missing from Tools > Options > Expert Advisors > Allow WebRequest for listed URL.
  7. Read Both the Experts and Journal Tabs: Open the bottom Terminal/Toolbox pane. The Experts tab prints messages emitted by the EA itself; the Journal tab records platform and trade-server diagnostics.

Common MT4 & MT5 Error Codes Reference Table

Error Code Constant / Meaning Root Cause How to Fix It
130 (MT4) / 10016 (MT5) ERR_INVALID_STOPS Stop Loss or Take Profit is closer than the broker's minimum StopLevel, or placed on the wrong side of Bid/Ask. Increase SL/TP distance beyond broker StopLevel + current spread, or ensure the EA normalizes price digits cleanly.
131 (MT4) / 10014 (MT5) ERR_INVALID_TRADE_VOLUME Requested lot size is below broker minimum (e.g., 0.01), above max lot, or not aligned with volume step. Check symbol specification (Right-click Symbol > Specification) and adjust initial lot or risk percentage.
133 (MT4) / 10017 (MT5) ERR_TRADE_DISABLED Trading disabled on this account type, Investor password used, or wrong symbol variant selected (e.g., non-tradeable reference chart). Log in with your Trader password, pick the active tradeable symbol suffix in Market Watch, or contact broker support.
134 (MT4) / 10019 (MT5) ERR_NOT_ENOUGH_MONEY Insufficient free margin to open the requested lot size at current account leverage. Reduce lot size or risk %, lower max simultaneous trades, or confirm broker leverage on the instrument.
136 / 138 (MT4) OFF_QUOTES / REQUOTE Price moved beyond the EA's slippage tolerance before execution completed. Increase Max Slippage slightly, check internet/VPS latency, or avoid thin rollover liquidity minutes.
4109 (MT4) / 10027 (MT5) ERR_TRADE_NOT_ALLOWED Automated trading disabled globally or in chart properties. Enable the green AutoTrading / Algo Trading button and check Allow live trading under F7 > Common.
4060 / 4014 ERR_FUNCTION_NOT_ALLOWED EA called WebRequest() or external DLL without terminal permission. Whitelist the exact URL in Tools > Options > Expert Advisors (or check DLL permission only if trusted).

When an EA Works in Strategy Tester But Not Live

If an Expert Advisor opens dozens of trades in Strategy Tester yet stays idle on a live or demo chart, compare three differences: Strategy Tester often uses fixed spreads, ignores live broker StopLevel freezes during news, and skips live WebRequest() news-filter dependencies. Running the EA on a real-time demo account for several sessions reveals immediately whether an input filter—rather than a bug—is holding trades back.

Missing Dependencies, Custom Indicators & Terminal Updates

Sometimes an Expert Advisor attaches without obvious permission errors yet logs Cannot open file or Custom indicator not found inside the Experts tab. Many EAs call external custom indicators via iCustom(). If the accompanying indicator .ex4 or .ex5 file is missing from MQL4/Indicators or MQL5/Indicators—or was renamed slightly when downloaded (for example, TrendFilter(1).ex4)—the EA fails to read entry buffers and stays silent.

Similarly, major MetaTrader terminal updates occasionally deprecate old legacy binaries or require recompiling .mq4/.mq5 source files in the current MetaEditor build. Keeping your original source or updated vendor binary backed up alongside verified .set preset files avoids unexpected downtime after broker terminal upgrades.

Quick Triage Order When Trades Fail to Open

  1. Confirm green AutoTrading / Algo Trading on both the main toolbar and inside chart properties (F7).
  2. Verify a fresh incoming tick is updating Bid/Ask prices in Market Watch during active market hours.
  3. Open the Experts tab to check whether a broker code (130, 131, 133, 134, 4109) or an EA filter (Spread too high, Outside trading hours) blocked the order.

ACTION CHECKLIST

  1. Check chart status icon: Verify MT4 displays a smiley face or MT5 displays an active Algo Trading badge in the top-right corner of the chart.
  2. Confirm global and chart permissions: Ensure the toolbar AutoTrading/Algo Trading toggle is green and Allow live trading is checked under F7 > Common.
  3. Verify account connection and password: Confirm live network kilobytes appear in the bottom-right corner and that you logged in using the Master Trader password, not an Investor password.
  4. Match broker symbol suffix and market hours: Attach the EA to the exact tradeable Market Watch symbol (including any suffix) while the market is open and streaming ticks.
  5. Audit spread and session filters: Check MaxSpread (points vs pips) and trading hour GMT offsets in the Inputs tab.
  6. Check DLL and WebRequest permissions: Inspect Tools > Options > Expert Advisors to ensure any required news or API URL is whitelisted.
  7. Inspect Experts and Journal error codes: Open the Terminal/Toolbox Experts and Journal tabs to diagnose specific server rejections like 130, 131, 133, 134, or 4109.

FREQUENTLY ASKED QUESTIONS

Why does my Expert Advisor show a smiley face in MT4 but still open zero trades?

A smiley face only confirms that MT4 permits automated trading. The EA may still wait for indicator entry criteria, block trades due to a strict MaxSpread setting (points vs pips), sit outside configured trading hours, or fail with a broker error in the Experts tab.

What causes MT4 error 130 (Invalid Stops) on an Expert Advisor?

Error 130 occurs when the EA tries to place a Stop Loss, Take Profit, or pending order closer to market price than the broker's minimum StopLevel allows, or on the wrong side of Bid/Ask.

Why does my EA keep removing itself from the chart as soon as I click OK?

When OnInit() returns INIT_FAILED or calls ExpertRemove(), MetaTrader unloads the EA immediately. Check the Experts tab for messages explaining why—commonly wrong timeframe, missing custom indicator, unsupported account mode, or missing WebRequest permission.

What does error 4109 mean in MetaTrader 4?

Error 4109 (ERR_TRADE_NOT_ALLOWED) means the EA attempted to send an order while either the global AutoTrading toolbar button or the per-chart 'Allow live trading' checkbox in F7 properties was disabled.

EXPLORE RELATED EA HUBS

MT4 Expert Advisors →MT5 Expert Advisors →Gold EAs →

CONTINUE READING

EXPLORE VERIFIED EXPERT ADVISORS

Browse MT4 and MT5 bots, indicators, and setup resources across YoForexEA.

Browse EAsAll 18 Guides