Drag an Expert Advisor onto a chart and MetaTrader asks whether it may trade. Say yes, and a small smiley face appears in the corner. From that moment a piece of compiled code is receiving every price update the broker's server sends and deciding, on each one, whether to place, modify or close an order in your account.
That is the whole architecture. An EA is not connected to anything except the terminal, it has no privileged data, and it sees exactly the prices you see. What it has is speed and the absence of hesitation.
Where it runs and when it stops
The code lives in the Experts folder of the terminal's data directory and executes in a loop driven by ticks. On a quiet Sunday evening it may run twice a minute. During a data release it may run hundreds of times a second. Between ticks, it does nothing at all, which catches people out: an EA cannot react to time passing on a dead feed, so a strategy that must close a position at a specific second needs the market to be printing prices at that second.
It also stops the moment the terminal does. Close the platform, let the laptop sleep, lose the connection, and open positions sit there unmanaged with whatever stop loss was already on the server. Server-side stops survive a disconnect. EA logic does not. That single asymmetry is why anyone running automation seriously rents a machine that stays up, a topic covered in the forex VPS guide.
Permissions are layered and all of them must be on: algorithmic trading enabled in the terminal options, the AutoTrading toolbar button pressed, and trading allowed in the EA's own properties. A DLL import prompt is a separate question and deserves a hard look, because an EA that needs external libraries to place a market order does not need them for that.
The strategy tester is a laboratory, not a forecast
MetaTrader ships a tester, and it is genuinely useful for one thing: proving the code does what you think it does. It is much weaker as evidence that a strategy will make money.
The reason is the data. MetaTrader 4 models ticks by interpolating inside minute bars, and the platform's own modelling quality figure tells you how much of the result is invention. MetaTrader 5 improved this with real tick data where the broker provides it, but the tester still applies one spread assumption, one execution assumption, and no requote, no rejection, and no widening around a news print. Live conditions include all four. We covered the general problem in backtesting basics.
Then comes optimisation, the feature that quietly ruins more accounts than any other. Running thousands of parameter combinations and selecting the best one produces a set of numbers that describes the past with great precision and carries no information about next month. The mechanics of that failure are set out in backtest overfitting, and the defence is forward testing on a demo account for long enough to be boring.
If the seller's proof is a tester report, you have been shown a simulation of the seller's choosing. Ask for a forward record on a live or demo account with a start date that precedes the marketing, and treat any refusal as the answer.
Every broker is a different environment
The same file behaves differently on two servers, and the differences are mundane rather than sinister. Symbols carry suffixes, so an EA hardcoded to EURUSD does nothing on a server that calls it EURUSD.m. Minimum stop distance rules reject a stop placed too close to the current price. Order filling modes differ between fill-or-kill and immediate-or-cancel, and an EA sending the wrong one gets an error code instead of a position.
Then there is cost. An EA that opens and closes many small trades is extremely sensitive to spread and to commission, and a strategy that tested well against one server's historical spread can be flat or negative against another's. Overnight financing does the same thing to longer holds, which is where swap rates stop being a footnote.
Two hygiene items make live operation survivable. Give every EA a distinct magic number so its orders can be identified and closed separately from your manual trades. And test on a demo account of the same broker and the same account type, since a demo on a different server tells you about a different environment.
The equity curve that always ends the same way
A large share of commercially sold EAs share one design: they never take a loss, because a losing position is met with a larger position in the same direction until price returns. The equity curve rises in a smooth line for months. Then a trend runs, exposure compounds, margin is consumed, and the account is gone in an afternoon.
These are sold as recovery systems, smart averaging or grid managers. The mechanics and why the smooth line is the warning sign rather than the selling point are laid out in the martingale problem and grid trading. If the description of a strategy includes the phrase "no stop loss", the drawdown is not absent. It is unrealised.
Prop firms have their own view. Many permit automation but prohibit named behaviours such as latency arbitrage, tick scalping or coordinated copying across accounts, and some prohibit EAs entirely. The rulebook governs, and breaching it typically voids the account rather than producing a warning, which is a reason to read the funded account rules before installing anything.
Running one without losing sleep
Treat an EA as an operational system rather than a purchase. Know its maximum concurrent exposure and confirm it against the account, not against the tester. Put a hard account-level limit somewhere outside the EA's control. Check the journal and experts logs daily for error codes, because a silent stream of rejected orders looks identical to a quiet market from the outside. And keep a manual kill switch you can reach from a phone.
The point of automation is removing hesitation from a process you have already decided is correct. It does not remove risk, and leveraged trading carries a high risk of loss regardless of who or what is pressing the button.
"An EA does not have a bad day, which is the argument for it. It also does not notice that the market changed in March, which is the argument for checking on it."
— Alex Onta, Executive Director, SINGUARD
Key Takeaways
- An EA executes on incoming ticks inside the terminal, so it stops managing positions the moment the platform closes or the connection drops.
- Tester results prove the code runs, not that the strategy works, and heavy parameter optimisation makes the report less informative rather than more.
- Symbol suffixes, stop distance limits, filling modes, spread and swap are set per broker, so the same file trades differently on each server.
- A perfectly smooth equity curve with no stop loss usually means position averaging, and that drawdown is unrealised rather than absent.
Frequently Asked Questions
Does my computer have to stay on for an Expert Advisor to trade?
Yes. An EA runs inside the MetaTrader terminal and only executes when the terminal is open and connected to the broker's server. If the machine sleeps or the connection drops, the EA stops managing positions until it reconnects, which is why most people who run one seriously rent a virtual private server rather than using a laptop.
Why does an EA perform differently on two brokers?
Symbol names, spreads, minimum stop distances, order filling modes and swap charges are set per broker, and the same code produces different orders under each. An EA tested against one server's historical spread will trade differently on a server with wider spreads at the same times of day, even with identical settings.
Can I use an Expert Advisor on a prop firm challenge?
It depends entirely on the firm's rules. Many allow automation while prohibiting specific behaviours such as latency arbitrage, tick scalping or copying between accounts, and some ban EAs outright. The rulebook is the authority, and using one where it is not permitted usually voids the account rather than triggering a warning.