Compiler Fixes
Set up CTrade correctly before debugging the rest of the EA.
A lot of MQL5 execution errors begin with a missing include or an inconsistent trade object. Fix this foundation before spending time on strategy logic.
Search intent
The developer is missing the standard trade include or has trade.Buy and trade.Sell errors.
Above-fold trial-intent marker: use after the free desk names one concrete blocker.
No-email quick start
Start with the CTrade error before joining anything.
Open the free desk, paste the first CTrade error plus the include/object block, and only opt in later if the output is useful enough to request a blocker pass.
After useful output
Measure the trial path without pushing checkout too early.
Run the free desk first. If the output names a real blocker or next validation step, use the guide-specific review pass or compare Starter from this same page so trial intent stays attached to the resource.
Active CTrade blocker lane
Send the smallest CTrade bundle while the issue is fresh.
This guide is now the active support-to-content lane for CTrade setup. Use the free desk first, then opt in only if the include, object scope, or failing trade call still blocks the next compile attempt.
Measure the CTrade guide-to-desk handoff
Open the compiler desk from this guide so the handoff records the CTrade resource, the guide page, and the exact desk CTA before any opt-in is requested.
Run CTrade compiler deskTrial-to-pricing handoff
If the first repair pass is useful, continue to pricing from this exact CTrade resource so the trial-to-pricing handoff is measurable.
Compare Starter after CTrade passCTrade blocker pass for this guide
Opt in only if this exact CTrade setup issue is blocking your MT5 EA. Send the first error, include section, CTrade declaration, failing trade call, and any retcode or GetLastError output.
Lead activation handoff
No email wait is required. After saving the opt-in, continue into the free desk with the same blocker so the visitor-to-lead-to-workflow path is measurable.
Continue in free deskChoose the workflow you want, then opt in only if you want Workfusionapp updates.
Cluster
Compiler Fixes
Tool path
mql5 compiler fixer
Reader
mq5 developer
Add the standard include once
The standard trade class should be included near the top of the EA. Keep it visible and avoid wrapping it inside conditional blocks.
Check execution result
A compile-clean trade call is not enough. The EA should inspect the result and log why a trade failed.
Keep trade calls behind risk gates
The trade object should be called only after spread, session, exposure, and daily loss checks pass.
Send a minimal CTrade support bundle
If the issue still blocks the build, make the support handoff small and reproducible. The next useful answer depends on seeing the first compiler error and the exact trade object wiring, not the whole strategy history.
Use the tool
Generate a Workfusionapp EA draft with CTrade, execution checks, and risk gates already wired together.
Related guides
Continue the EA build path.
Compiler Fixes
Fix 'trade' undeclared identifier in MQL5
Fix the MT5 compiler error where trade.Buy or trade.Sell fails because the CTrade object was not included or declared correctly.
Compiler Fixes
Fix undeclared identifier in an MQL5 EA
A practical checklist for fixing undeclared identifier errors in MT5 Expert Advisor code before compiling again.
MT4 Debugging
Debug an EA that opens too many trades
Find duplicate-entry, missing cooldown, magic number, and signal-state issues in an EA that overtrades.