Home / EA Debugging and Code Review — Find What Is Breaking Your EA Before the Market Does

EA Debugging and Code Review — Find What Is Breaking Your EA Before the Market Does

Most Expert Advisors that fail in live trading compiled without errors and backtested profitably. The problems are structural — silent order failures, missing state persistence, hardcoded assumptions that only work in the Strategy Tester — and they only surface when real money is on the line. At barmenteros FX, we read your EA’s source code, find what is causing the problem, and tell you honestly whether to fix it or rebuild it.

What the Report Contains

A written report in four sections, with specific code locations and plain explanations:

  1. Compilation and warnings — whether the source compiles in a current MetaEditor, with which errors and warnings, and which of them matter.
  2. Defects and risks — what we find in order handling, stops and lot sizing, ranked by severity (critical / important / minor), with what can break and under what conditions.
  3. Behavior against what you expect — whether the code does what you describe. We compare your description with what the code does, and reproduce the problem in the Strategy Tester when the tester can show it.
  4. Fixed-price quote for the fix — what the repair costs and how long it takes, or a fix-or-rebuild recommendation when targeted fixes would not hold.

The report is yours whether or not we do the fixes. Use it to fix the code yourself, hand it to another developer, or commission us to implement the changes.

What the Diagnosis Does Not Include

  • The fix itself. It is quoted in the report, and you decide.
  • A call. The report is written, and we answer your questions about it in writing: one round, within 7 days of delivery.
  • An opinion on whether the strategy will make money, or any promise about passing a prop firm challenge.
  • Testing on your live account or at your broker. Logs from your terminal help us, and we will ask for them when the problem depends on them.
  • A line-by-line audit of every code path. A diagnosis follows the problem you report and the main risk areas, so it cannot prove that no other defect exists. For that, see the full code review under Pricing and Next Steps.

How It Works

Step 1 — Send your EA and describe the problem. Use the order button to send your .mq4 or .mq5 source file, with your own .mqh include files. Tell us what the program is supposed to do, what is going wrong, and whether it has been running live.

Step 2 — We confirm the scope and send the invoice. Within one business day we check two things only: the program’s size, and that the source is complete with its include files. If it is over the limit, we tell you and quote a full code review instead. You owe nothing until you pay an invoice.

Step 3 — We diagnose. The 3 business days start when we have your payment and the complete source. We trace the execution path of the problem you report and check the code against five failure patterns: silent OrderSend, amnesia on restart, hardcoded assumptions, ignored execution feedback, and missing defensive guards.

Step 4 — You receive the report and decide. Fix it yourself, hire someone else, or commission us. If you order the fix from us within 30 days of the report, the full $149 is credited against it (up to the price of the fix).

Who This Is For

This service exists for traders and firms in specific situations:

  • Your EA backtests profitably but behaves differently live — requotes, missed entries, unexpected position sizes, orders that should have closed but did not
  • You bought or commissioned an EA and want an independent second opinion before risking real capital
  • AI generated your EA code (ChatGPT, Copilot, Claude) and you need a human who understands broker execution to verify it will survive live markets
  • Your EA crashed or lost money after a terminal restart and you need to understand why — start with what to check when MT4 crashes, freezes or hangs
  • You are scaling from demo to live and want the order, stop and lot logic checked before real money is on the line

Who This Is Not For

  • Traders looking for someone to create a strategy — we review and fix code, not develop trading ideas. For full EA development, see our custom EA development service.
  • EAs without source code — we need the .mq4 or .mq5 file. We cannot review compiled .ex4 / .ex5 files.

What barmenteros FX Finds in Code Reviews

Five EA failure patterns found in code reviews: silent order failures, terminal restart amnesia, hardcoded broker assumptions, ignored execution feedback, and missing defensive guards

We have been building and rescuing trading systems since 2011. The failures below are the structural ones a code review is designed to catch. These are not obscure bugs — they are predictable, systematic gaps that the Strategy Tester never reveals. Sometimes the code is not broken at all — it is faithfully implementing a strategy that was specified wrong.

Silent order failures. The EA calls OrderSend() and never checks the return value. In backtest, every order fills instantly. In live trading, requotes happen during fast markets, margin runs out after drawdowns, and broker rejections occur during restricted sessions. The EA does not know the order failed, updates its internal state based on a position that does not exist, and compounds errors from that point forward.

Terminal restart amnesia. Every runtime variable resets when MetaTrader restarts. Grid levels reset to zero. Daily trade counters reset. Trailing stop positions are forgotten. A martingale EA mid-recovery at 8x lot size restarts at 1x, opening a base position instead of the recovery position — doubling exposure without the recovery logic that was supposed to manage it.

Hardcoded broker assumptions. Pip values, stop levels, lot step sizes, and symbol naming conventions hardcoded for one specific broker. Move the EA to a different account — or the broker updates its specifications — and calculations silently produce wrong values. This failure can stay hidden for a long time: see how a broker’s spread change can break an EA that ran profitably for years.

Ignored execution feedback. The EA sends a modification command and does not verify it was applied. OrderModify() returns false, the stop loss was not actually moved, but the EA proceeds as if it was. The position runs unprotected.

Much of this surfaces in the terminal’s own output before it shows up in the account — see how to read MetaTrader 4 log files.

Pricing and Next Steps

The EA Diagnosis costs $149 USD, paid in advance, for one MQL4 or MQL5 program of up to about 3,000 lines, including your own include files. If you order the fix within 30 days of the report, the full $149 is credited against its price, and the quote in the report stays valid for those 30 days. The credit cannot exceed the price of the fix.

When You Need More Than a Diagnosis

A full code review reads every line and every code path, and adds a strategy logic assessment: backtest-to-live discrepancies, overfitting indicators, and out-of-sample viability. It is also the route for programs over about 3,000 lines and for systems of several programs. We quote it individually, before any work begins, typically at $250–$800. The review cost is credited toward repair work.

Request a quote for a full code review →

Frequently Asked Questions

Do I need to provide the source code?

Yes. We need the .mq4 or .mq5 source file. Compiled .ex4 or .ex5 files cannot be reviewed — they contain machine code, not readable source. If you do not have the source, the original developer should provide it. At barmenteros FX, we include full source code delivery on every project we build.

Can you review AI-generated EA code?

Yes. AI tools like ChatGPT and GitHub Copilot can generate MQL code that compiles and backtests, but they can miss broker execution constraints, state persistence across restarts, and defensive guards that only matter in live trading. We review the generated code against the same standards we apply to human-written EAs.

What if the EA needs a complete rebuild?

We will tell you directly. The review report includes a fix-or-rebuild recommendation with a clear justification. If the code structure cannot absorb targeted fixes without cascading regressions, rebuilding from the working strategy logic is often faster and cheaper than patching. We explain exactly why in the report, so you can make an informed decision.

How long does a code review take?

The EA Diagnosis takes 3 business days from the moment we have your payment and the complete source code. A full code review typically takes 3–5 business days, and complex EAs with multiple interconnected systems may take up to 7. We confirm the timeline of a full code review before starting.

Is my trading strategy kept confidential?

Absolutely. All code reviews are covered under our standard confidentiality terms. We do not share or publish client code, and we do not reuse strategy logic. Your intellectual property remains yours.

Is a call included in the EA Diagnosis?

No. The diagnosis is a written report, and we answer your questions about it in writing: one round, within 7 days of delivery. If you need a call, we quote it separately.

What if my EA is over 3,000 lines?

We tell you before you pay anything, and we quote it as a full code review. The count includes your own include files. Compiled third-party libraries and DLLs are treated as black boxes: we can check how your code calls them, not what they do inside.

What if you cannot find the cause?

The report says so. It lists what we checked, what we ruled out, and what evidence would settle the question, such as terminal logs or your broker's symbol settings. Some problems only appear at one broker or on a live account, and we do not present a guess as a cause.

Is the $149 refundable?

Payments are final under our Payments & Refunds Policy. That is why we check the scope before we send the invoice: if the program does not fit, you are told before you pay anything.

Related Services

  • Custom EA Development — a new Expert Advisor for MT4 or MT5, from your strategy specification to production code, full source included
  • MT4 to MT5 Migration — an MT4 EA or indicator re-implemented for MT5’s order model and parallel-tested before cutover
  • MT5 Programmers — custom MQL5 Expert Advisors and indicators, for netting and hedging accounts
  • Our Services — the full catalogue: MetaTrader, TradingView, NinjaTrader and cTrader development, ML trading systems and license protection