Expert Advisor Not Working? Diagnose the Failing Stage
“Not working” can mean an EA does not load, receives no usable data, produces no signal, has a request rejected or trades at a loss. These are different problems. Identify the failing stage using logs and a reproducible case before changing strategy parameters or enabling additional permissions.
Key Takeaways
- Record the terminal build, EA version, input set, broker symbol, timeframe and exact error message.
- Check compilation, initialization, data, signal conditions and trade responses in that order.
- No trades can be correct behavior. Losses alone do not establish a coding defect or overfitting.
- A historical tester result does not rule out code paths that fail only during connected operation.
1. Does the EA compile and initialize?
Confirm the platform and file type: MQ5/EX5 belong to MT5, while MQ4/EX4 belong to MT4. If source is available, compile the main file in MetaEditor and inspect its Errors tab. In the terminal, examine Experts output and Journal entries around the time the EA was attached. Preserve the exact message and timestamp.
- A successful load is different from successful initialization. Investigate missing indicators, includes, invalid inputs or explicit initialization failure.
- After an update, compare the old and new build, source and dependencies. Do not assume a platform API change without a diagnostic.
- If only a compiled program is supplied, provide the vendor with version, settings and logs. Regenerating a similar strategy does not repair or recover its original source.
2. Are the required data and permissions available?
Check connectivity, the exact broker symbol name and trading session. Confirm the EA has sufficient history and that requested indicator values are ready. Check terminal-wide algorithmic trading, the EA setting and account/server permissions. Use the current labels and status messages rather than relying only on a button color.
- A closed market can mean no new quotes or rejected trading; it does not universally prevent EA initialization.
- A program can select and use additional symbols itself. Inspect how it requests and synchronizes data rather than assuming every symbol must be manually displayed.
- Enable DLL or external-request access only when the program actually requires a trusted dependency. Do not enable it as a generic fix.
- Renko implementations differ: inspect whether bricks are generated internally or provided by another chart or indicator. There is no universal attachment rule for every Renko EA.
3. Did the signal become true?
Inspect or log each condition using the exact values and bars the EA reads. A spread filter, time window, open-position check or completed-bar requirement may correctly block entry. Compare those values with the written specification. Avoid loosening thresholds merely to make trades appear.
- Record which condition returned false and the data timestamp. A missing value should not be silently interpreted as a valid zero.
- Check time-zone assumptions and whether the EA uses chart settings or explicit symbol/timeframe inputs.
- In MQL5, NewTick events can be coalesced while one is already queued or processing. Long handlers can affect what the program observes.
4. Was a trade request sent, rejected or filled?
Record the trade request and server return code. MQL5 distinguishes invalid volume, invalid stops, insufficient funds, a closed market and disabled trading. Use the exact result to investigate the matching condition. OrderSend returning true does not by itself establish that the requested trade was filled.
- Compare volume with the broker minimum, maximum and step, and price distances with current symbol restrictions.
- Check account mode and the intended order/position handling. Netting and hedging logic are not interchangeable.
- Log failure handling and retries. Blindly resending a request can create duplicates if the first result was merely delayed or uncertain.
5. Reproduce the discrepancy without changing the question
Use the same EA version and inputs in the tester, then compare the data, account and execution assumptions with connected operation. Tester trades with no connected trades narrow the investigation, but they do not prove the code is correct. Environment-dependent logic, timing, unavailable data and broker rules can all contribute.
- If the EA trades but loses money, compare actual orders with intended rules before calling it a software failure. Win rate, profit factor and drawdown thresholds alone cannot diagnose overfitting.
- Broker and prop-firm policies depend on the actual account program and current contract. Check automation, copying and prohibited-strategy terms directly; account labels such as demo or swap-free do not establish permission.
- With editable source, Pineify can help interpret a diagnostic and draft a targeted change. Recompile and rerun the failing case in MT5. Pineify Strategy Optimizer is not an MT5 debugging tool.
This page is educational and does not provide investment advice. Diagnose changes in a tester or demo environment before considering live use. Automated trading can result in substantial loss.