Building Expert Advisors
Select Build Expert Advisor for a new automated program when no source is being modified. Describe entries, exits, sizing and limits on when trading is allowed. An EA can submit and manage orders, so its order behaviour needs the same attention as the indicator conditions that generate a signal.
Begin with a version small enough to inspect. A crossover with fixed stops can be tested before adding percentage risk, sessions and trailing logic. This helps identify which change introduced a problem. If you already have source implementing part of the design, use Existing Expert Advisors.
Set the trading rules
State whether signals use completed bars or ticks, which directions are allowed and how many positions the EA can manage. Give stop and target distances with explicit units. Explain whether opposite signals close a position, reverse it or are ignored, and whether another entry is allowed after a trade closes on the same bar.
Describe how the EA distinguishes its positions from manual trades or other robots. Specify the intended account model when it affects the design. For sessions, identify the time basis and whether the end of the session prevents new entries or also closes existing positions. These choices should come from the specification.
Generate and inspect the source
Send the request and review any Prompt Builder offer. For larger designs, use a plan to separate the trading baseline from later controls. When generation finishes, read the implementation notes and build result, then download the complete .mq5 file. Check the inputs and defaults against your request.
A passed build confirms compilation in the checking environment. If checking was unavailable or errors remain, follow Existing EA. Compile locally as well, especially when custom indicators or include files are required. Keep the complete returned file rather than assembling pieces from different responses.
Inspect trades before optimising
Run a short visual Strategy Tester test. Check individual entries and exits, initial volume, protective orders and repeated signals. Look for management of unrelated positions or trades left open when a rule required a close. A profitable summary does not establish that these behaviours are correct.
Only then run longer tests or consider optimisation. Keep settings and source versions with reports so results can be reproduced. Testing Expert Advisors covers the workflow, and Strategy Tester Analysis explains how to review an exported workbook in Xen.