Why a chat thread is not a specification
A developer codes exactly what is written. "Buy when the trend is up and price pulls back" contains three undefined terms: trend, up and pulls back. Each has a dozen reasonable interpretations, and the developer will pick one. If it is not the one you meant, you have paid for the wrong EA.
A specification replaces every judgement word with something a program can measure. It also becomes the acceptance test: the EA is finished when it does what the document says.
1. Market and context
State the symbols, the timeframes, the platform (MT4 or MT5) and the account type. On MT5, say whether the account is netting or hedging. Name the broker if execution rules matter — minimum stop distance, lot step and trading hours differ between them.
2. Entry rules
Write each condition so that two people looking at the same chart would agree whether it is true. For every indicator give the exact settings and say which bar is read: the forming bar or the last closed one. That single choice is the usual source of repainting signals and of backtests that cannot be reproduced live.
Say how many positions may be open at once, whether a new signal in the same direction adds to the position, and what an opposite signal does.
3. Exit rules
List every way a trade can end: stop loss, take profit, trailing stop, break-even move, partial close, time-based exit, opposite signal, end of session. For each, give the trigger and the amount. If two exits can fire on the same tick, say which one wins.
4. Risk and position sizing
Fixed lot, percentage of balance or equity, or volatility-based — choose one and define the calculation. Then add the limits that protect the account: maximum daily loss, maximum total drawdown, maximum open exposure and maximum number of trades per day. Say what the EA does when a limit is hit, and when it is allowed to trade again.
5. Filters
Trading sessions with the time zone they are expressed in. Maximum spread. News blackout windows and where the calendar comes from. Days of the week. Behaviour around rollover, when spreads widen.
6. Edge cases
This is the section most briefs leave out and the one that decides live behaviour:
- The terminal restarts with positions open. Does the EA recognise and keep managing them?
- The market gaps over a stop or an entry level at the weekend open.
- The broker rejects an order, fills it partially, or requotes.
- The connection drops for a minute during a trade.
- A position is closed or modified by hand while the EA is running.
Write the expected behaviour for each. "Do nothing and log it" is a valid answer; silence is not.
7. Inputs, display and logging
List the parameters you want to be able to change without a new build, with their default values and ranges. Describe anything shown on the chart. Ask for a log line for every decision — signal seen, filter that blocked it, order sent, result — so a questioned trade can be explained afterwards.
8. Testing and acceptance
Agree the evidence before the build starts: the test period, the tick data source and modelling mode, and the forward-test period on a demo account. Add a handful of marked-up chart examples — "this is a valid entry, this one is not, and here is why". Those examples become test cases.
9. Delivery
State what you expect to receive: source files, the compiled build, test reports, installation notes, and how long defects are fixed without charge. If you plan to sell the EA, say so now, because licensing and account binding are easier to build in than to add.
Use the template
We start every project from the same document, and it is free to use with any developer: download the trading system specification template (PDF). Fill in what you know. The gaps are not a problem — they are the agenda for the first call.
When it is ready, send it to us and an engineer will reply with questions and a price for building the EA.