My EA isn't working. Now what?
Most EA problems are one of a handful of settings, and many aren't problems at all: a breakout EA that hasn't traded today is usually just waiting. Start with the 60-second check, then open the problem that matches what you see. Unfamiliar words link to the glossary.
The 60-second check
These five things solve most cases. Check them before anything else.
- Algo Trading is on in the toolbar, and the EA's icon on the chart isn't grey.
- The EA is on the right symbol, with your broker's suffix, and on the right timeframe.
- MetaTrader is open and connected: bottom-right corner shows a connection speed, not "No connection".
- You're logged in with the master password, not the investor password.
- The Experts and Journal tabs (Ctrl+T) show no red errors.
Find your problem
Open the one that matches what you see.
The EA is on the chart but isn't opening any trades
Usually the Algo Trading button is off, the EA is on the wrong symbol or chart, MetaTrader is closed, or there simply was no valid setup yet. Breakout EAs can go several days without trading.
Work through these in order. The first three cause most cases.
- Algo Trading is switched off. The Algo Trading button in the toolbar must be on, and the Allow Algo Trading box must be ticked in the EA's settings (double-click the EA name on the chart, then the Common tab). The small icon next to the EA's name in the top-right corner of the chart turns grey when it isn't allowed to trade.
- Wrong symbol or chart. The EA must sit on the chart of the exact symbol it trades, with your broker's suffix (
XAUUSD.r,XAUUSDm,GOLD…), and on the timeframe the product page asks for. - MetaTrader isn't running. An EA only trades while MT5 is open and connected. If your computer sleeps, the EA sleeps too. That is what a VPS is for.
- There was no setup yet. This one is normal, not a fault. Breakout EAs wait for a range to form and break, only trade in their session, and skip days when filters say no: news, low volatility, or a daily trade or loss limit already reached. Several quiet days in a row happen.
- You logged in with the investor password. The investor (read-only) password lets you watch an account but not trade on it. Log in again with the master (trading) password.
- The market is closed. Forex and gold close at the weekend, and indices and gold have a short daily break. Nothing trades in those windows.
How to tell it's aliveThe EA name is on the chart, its icon is active, and the Experts tab shows no errors. If all three are true, it is waiting for its setup, not broken. Judge a breakout EA over weeks, not days.
Pending orders appear and then disappear without a trade
That is normal for breakout EAs. They place buy stop and sell stop orders at the edges of a range, and cancel the ones that never trigger when the setup expires.
This is normal behaviour. Breakout EAs usually place a buy stop above a range and a sell stop below it, then wait for price to decide. A pending order that never triggers is cancelled when its window closes, and once one side triggers, the other side is often cancelled too.
You'll see this every day in the History tab as orders with the status cancelled and no position attached. Nothing was lost: an order that never filled costs nothing.
A trade closed on its own, without hitting stop loss or take profit
Most often it was a time exit at the end of the session, or the stop loss had been moved to breakeven or trailed closer. Rarely, it was a broker stop out because margin ran too low.
Check the closing price and time in the History tab, then compare with these three causes:
- Time exit. Some of my EAs close any open trade at the end of their session, whatever the result. See time exit.
- The stop had moved. Once a trade is in profit, the EA may move the stop to breakeven or trail it. The trade then closes at the new stop, which is no longer where it started.
- Stop out. If the trade's comment in the History tab starts with
sofollowed by a percentage, the broker closed the trade because margin level fell too low. That means the position was too big for the account: lower the risk per trade. See stop out.
The lot size isn't what I expected
The EA sizes positions from your risk setting, stop distance and your broker's tick value, so lots differ between brokers and account currencies. On small accounts, the broker's minimum lot of 0.01 can be larger than your risk allows.
With a risk setting in percent, the EA works out the lot from three things: your account equity or balance, how far away the stop loss is, and what one point is worth at your broker (the tick value). So:
- Different brokers give different lots for the same risk, because contract sizes and tick values differ. That is normal.
- Wider stops mean smaller lots. On a volatile day, the EA trades smaller so the money at risk stays the same.
- Small accounts hit the minimum lot. If 0.01 lot of gold is already more than your risk %, the EA either skips the trade or takes the minimum lot, depending on the EA. Check the product page.
To see what lot your balance, risk and stop distance should give, use the lot size calculator.
My live results are different from the backtest
Some difference is always expected: live trading adds real spreads, commission, slippage and your broker's own price feed. Small differences are normal; large ones usually mean a different symbol setup, a much smaller account, or wrong settings.
A live account will never match a backtest trade for trade. Expected differences come from:
- Costs. Real spreads widen at news and opens, and commission and swap apply. A backtest with a fixed low spread looks better than reality.
- Execution. Slippage and gaps move fills by a few points.
- Your broker's prices. Each broker's feed and server time differ slightly, so ranges and candles are not identical.
- A much smaller account. On small balances the minimum lot changes how risk is applied.
What should worry you is a large, consistent gap. Check that you are on the right symbol and timeframe, that the inputs match the ones you tested, and that the backtest used real ticks. See modelling mode.
It stopped working after a restart, a Windows update or moving to a VPS
After a restart MetaTrader has to be running again, logged into the right account, with the EA still on its chart and Algo Trading on. On the MQL5 built-in VPS, the EA must be migrated again after any change.
- MetaTrader didn't start again. After a Windows update or a VPS reboot, MT5 is often simply closed. Set it to start automatically with Windows, and check your VPS after updates.
- A different account or profile loaded. Charts and EAs belong to the profile that was open. If MT5 opened on another account or an empty profile, your EA is not on screen.
- Algo Trading is off after the restart. Check the button again.
- MQL5 built-in VPS. The virtual hosting runs a copy of your terminal. Every time you change an EA, its inputs or its charts, you must migrate again, or the VPS keeps running the old setup.
- Running twice. Never run the same EA on the same account from two places at once, such as your laptop and a VPS. Both copies will trade.
Two EAs are closing or modifying each other's trades
Each EA, and each copy of the same EA, needs its own magic number so it only manages its own trades.
Every EA marks its trades with a magic number and only manages trades carrying its own number. If two EAs, or the same EA on two charts, share the same number, they will treat each other's positions as their own. Give each one a different magic number in its inputs.
Common error messages
What the Experts and Journal tabs are telling you. The number is MetaTrader's error code, which often appears next to the message.
| Message | What it means | What to do |
|---|---|---|
AutoTrading disabled by client10027 | The Algo Trading button, or Allow Algo Trading in the EA's settings, is off. | Switch it on (see the first problem above). |
AutoTrading disabled by server10026 | Your broker does not allow EAs on this account. | Ask the broker to enable algorithmic trading, or use another account type. |
Trade is disabled10017 | Trading is blocked on this symbol or account, often because you are logged in with the investor password. | Log in with the master password, or check the symbol with your broker. |
Market is closed10018 | The EA tried to trade outside the symbol's trading hours. | Nothing to fix. It will trade when the market reopens. |
Not enough money10019 | Not enough free margin to open the position at that size. | Lower the risk setting, close other positions, or add funds. |
Invalid volume10014 | The lot is below the broker's minimum or doesn't match its lot step. | Usually a very small account. See minimum lot. |
Invalid stops10016 | The stop loss or take profit is too close to the current price for this broker. | Common during fast markets. If it happens often, send me the log. |
Requote / No quotes10004 / 10021 | Price moved while the order was being sent. | Normal in fast markets. The EA will usually retry or wait for the next setup. |
Still stuck? Send me this
If none of the above fixes it, email me. With these five things I can usually answer in one reply instead of five:
- The EA name and version
- Your broker, account type (hedging or netting, raw or standard) and the exact symbol name
- A screenshot of the chart with the EA attached
- The last 20 lines of the Experts and Journal tabs (right-click, copy)
- Your settings, as a .set file or a screenshot of the Inputs tab