Home / Learn Hub / Platforms / What Is an Expert Advisor?
Intermediate

What Is an Expert Advisor (EA)? Automated Trading Explained

An Expert Advisor is a program that trades your account for you. That is a genuinely useful thing and also the reason the category attracts more outright scams than anything else in retail trading.

In one sentence:

An Expert Advisor is a piece of software that runs inside MetaTrader and places, manages and closes real trades on your account automatically, whereas an indicator only draws analysis on a chart.

Expert Advisors (EAs) at a glance

What it doesPlaces, modifies and closes real orders on your account without you clicking anything.
Where the file goesFile › Open Data Folder › MQL5 › Experts (or MQL4 › Experts on MT4).
How to switch it onThe AutoTrading button in the toolbar, plus Allow Algo Trading in the EA’s own settings.
How to tell it is runningA smiling face in the top-right corner of the chart. A sad face or a cross means it is not trading.
One per chartOnly one EA can run on a given chart. Multiple EAs need multiple charts.
Needs to stay onThe terminal must be running and connected. Most people use a VPS for this.
Biggest dangerHidden martingale or grid logic that recovers losses by increasing size.
Market Structure ProMSP is an indicator, not an EA. It analyses and grades conditions. It does not place trades.

What it is and why it works

MetaTrader runs three kinds of add-on program, and the difference between them matters more than almost anything else in this section. An indicator analyses price and draws something on the chart: it cannot touch your account. A script performs a single action once and stops, such as closing every open position. An Expert Advisor runs continuously and can place, modify and close orders on your live account without any further input from you.

An EA is a set of rules turned into code. It watches the market according to whatever logic it was given, and when its conditions are met it sends a real order to your broker. It can attach stops and targets, move them, close part of a position, and reverse. Everything a trader can do at an order ticket, an EA can do, faster and without hesitation, twenty-four hours a day.

That is the appeal, and it is a real one. Automation removes hesitation, revenge trading, missed setups, moving your stop because you did not like how the candle looked, and the thousand small deviations from plan that erode discretionary results. If your rules genuinely have an edge, executing them mechanically is better than executing them emotionally.

The catch is in the conditional. An EA does not create an edge, it enforces one. Automating a losing strategy produces losses faster and more consistently than trading it by hand. And because "robot that trades for you" is an easy thing to sell to people who would rather not learn, the EA market is dense with products whose impressive results come from a martingale or grid engine that survives right up until the day it does not. Understanding what is under the bonnet is not optional here; it is the whole exercise.

How to trade it, step by step

  1. Understand what the EA does before you install it. Ask three specific questions: does every trade have a fixed stop loss, does position size ever increase after a loss, and can it hold multiple open positions in the same direction. If the answer to the second or third is yes, you are looking at martingale or grid logic, and you need to know that before any backtest impresses you.
  2. Install it into the Experts folder. Open MetaTrader, click File › Open Data Folder, go into MQL5 (or MQL4) and then Experts, and copy the .ex5 or .ex4 file there. Indicators go in the Indicators folder and Expert Advisors go in Experts, putting one in the other’s folder is the most common installation error. Then right-click Expert Advisors in the Navigator and choose Refresh.
  3. Backtest it yourself before you believe anyone’s screenshots. Press Ctrl+R, load the EA, and run it over several years with a realistic fixed spread and your actual commission entered. Watch it in visual mode. Then look specifically at the largest drawdown and the trade sizes during losing runs. A vendor’s backtest is a marketing asset; yours is information.
  4. Run it on a demo account for a meaningful period. Not a week. Long enough to include a losing streak, a major news event and a month-end. Many EAs perform beautifully for weeks and then meet the condition they were never designed for. A demo account costs nothing and this is exactly what it is for.
  5. Enable trading in two places. Click the AutoTrading button in the toolbar so it turns green, and tick Allow Algo Trading on the Common tab of the EA’s settings when you attach it to the chart. If the EA needs internet access, also add its address under Tools › Options › Expert Advisors › Allow WebRequest for listed URL.
  6. Confirm it is actually live before walking away. Look at the top-right corner of the chart. A smiling face means the EA is attached and permitted to trade. A sad face or a cross means it is loaded but disabled, which is how people discover after a week that nothing was ever running. Then check the Experts tab in the Toolbox for its initialisation messages.
  7. Set the risk inputs yourself and set them low. Whatever the default lot size or risk percentage is, halve it, then halve it again for the first month. Vendors set defaults that produce impressive returns in their marketing, not defaults calibrated to your account. Check the resulting position size against the position size calculator and make sure a single loss costs a small fixed percentage.
  8. Put it on a VPS if it needs to run continuously. An EA only works while the terminal is open and connected. A laptop that sleeps, updates or loses Wi-Fi mid-trade can leave a position open with no management. A VPS keeps the terminal running on a machine that does not sleep, and it is the standard setup for anyone running automation seriously.
  9. Monitor it and know how to stop it. Check the account daily even when everything looks fine. Learn the two ways to stop an EA: click AutoTrading off to prevent new orders, or remove the EA from the chart entirely. Neither closes your existing positions, you close those yourself, and knowing that distinction under pressure is worth rehearsing before you need it.

Size every one of those entries with the position size calculator and check the trade is worth taking with the risk/reward calculator before you commit.

The conditions it needs

Traders with fully mechanical rules

If your entry, exit and sizing rules can be written down with no ambiguity, an EA will execute them more consistently than you will. This is the legitimate use case and it is a real advantage. The prerequisite is that the rules already work when you trade them manually.

Strategies that need constant attention

Anything trading sessions in a timezone you sleep in, or requiring reaction faster than a human clicking, is a natural fit. An EA does not get tired at 3am and does not miss the entry because it was making coffee.

Traders whose problem is discipline, not analysis

If you keep a journal and it shows that your losses come from breaking your own rules (moving stops, entering early, revenge trading) automation removes that failure directly. But be honest with yourself: if you cannot leave a manual trade alone, you may not be able to leave an automated one alone either.

Systematic trade management on manual entries

A useful middle ground. Some EAs do not choose entries at all; they manage positions you opened, applying break-even rules, trailing stops and partial closes mechanically. You keep discretion over what to trade and remove discretion from how it is managed, which is where most damage happens.

Anyone who has not yet defined their rules

This group should not be running an EA. Buying automation before you have a tested process means outsourcing decisions you have never made yourself, to code you cannot read, at a size you have not verified. Start with a written trading plan traded by hand.

When it fails

For different levels of experience

If you are brand new

The most important sentence on this page for a beginner: an Expert Advisor trades your real money on its own, and an indicator does not. If you are unsure which of the two something is, look at where it was installed; the Experts folder means it can trade, the Indicators folder means it cannot.

The second most important: be extremely careful with anything sold as a trading robot. The honest ones exist, but the category is full of products promising consistent monthly returns with tiny drawdowns, and the way that result is usually manufactured is by increasing position size after every loss. That works until the market moves in one direction for long enough, and then the account is gone in a single sequence. If a seller will not tell you whether the EA increases size after a loss, you have your answer.

As a beginner you do not need automation. You need to be able to place a trade with a stop, size it properly, and follow a written plan. If you want to see what an EA does without any risk, install one on a demo account and watch it for a month. That is genuinely educational and costs nothing.

If your results are inconsistent

The intermediate temptation is to buy an EA because your own discretionary results are inconsistent. Think carefully about that reasoning. If the inconsistency comes from breaking your rules, automation helps. If it comes from not having rules that work, automation just applies the problem faster.

If you do run one, the two settings that matter most are risk per trade and the stop loss. Reduce whatever the vendor set. Confirm from the trade history that every position opens with a stop attached at the broker, not a virtual one held in the EA’s memory, a virtual stop disappears if the terminal disconnects, leaving an unprotected position.

The most useful thing you can build at this stage is a management EA rather than an entry EA. You keep the discretion over what to trade, and hand over the part where most intermediate traders lose money: moving to break-even, taking partials, and trailing a stop by a defined rule instead of by feel. Read risk management and encode what you find there rather than buying someone else’s entries.

If you are experienced

The engineering realities: an EA runs on the OnTick event, so its responsiveness is bounded by tick delivery and terminal load, and anything with a latency-sensitive edge needs to be colocated rather than run from home. Order handling on MT5 goes through the orders, deals and positions model with explicit fill policies, and an EA ported from MQL4 that assumed one ticket equals one position will manage positions incorrectly on a netting account without throwing a single error.

Use magic numbers rigorously so that multiple systems on one account do not manage each other’s positions, and handle the case where a position exists that the EA did not open. Build in a hard kill condition (maximum daily loss, maximum open exposure, maximum consecutive losses) that halts trading independently of the strategy logic. Most catastrophic automated losses come from an edge case the strategy logic never anticipated, not from the strategy being wrong.

On validation, treat forward testing on the tester’s reserved out-of-sample period as the minimum bar, then run at minimum size live for a statistically meaningful number of trades before allocating properly. Live-versus-backtest slippage and spread divergence are the numbers to track during that period, not profit: see backtesting a strategy for the framework.

Risk management for this strategy

An EA concentrates risk in a way manual trading does not, because it can act repeatedly and quickly without anyone approving each decision. A logic error, a bad parameter or an unexpected market condition can produce dozens of positions in minutes. Every automated setup therefore needs a hard external limit that does not depend on the strategy behaving correctly: a maximum lot size, a maximum number of open positions, and a daily loss limit that stops trading entirely.

Insist on real stop losses placed at the broker with each position. Some EAs manage exits internally and place nothing on the server, which means a disconnection, a terminal crash or a VPS reboot leaves positions completely unmanaged in a moving market. Check the trade history after the first few trades to confirm a stop level is actually attached.

Finally, size the EA as one strategy among your total exposure, not as a separate account you stop thinking about. If it trades several symbols at once, correlated positions can mean your real risk is a multiple of the per-trade figure. Work out the worst-case simultaneous loss, not the average one, and check the arithmetic with the risk-reward calculator before you fund it.

Where Market Structure Pro fits

To be completely unambiguous: Market Structure Pro is an indicator, not an Expert Advisor. It does not place trades. It cannot open a position, close one, or modify anything on your account. It analyses the chart and tells you what it sees. Every trading decision and every click remains yours.

What it produces is a single verdict (TRADE, TRANSITION or NO TRADE) drawn from 27 underlying tools, with a confidence percentage, an A/B/C grade and a plain-English explanation of what is supporting or limiting that call. It is session-aware and spread-aware, and it includes a dedicated ranging filter whose entire purpose is to say NO TRADE when conditions are choppy or dead. It is non-repainting: state locks on the closed bar, so what it showed yesterday is what you will still see today.

That places it in the same category as the management-rule approach described above, but on the entry side: it does not remove your judgement, it gives your judgement a consistent reference point. If you have found that your worst trades are the ones taken in conditions you knew were poor, that is the problem it is built for. It is decision support, it is not a signal service, and it guarantees nothing. The install page covers setup, and MSP currently runs on MT5 only, with MT4, TradingView and cTrader versions planned but not yet released.

TRADETRANSITIONNO TRADE

One verdict with a confidence score, an A/B/C grade and a plain-English reason. Non-repainting, on every MT5 instrument and timeframe.

Stop guessing whether the setup is valid

Market Structure Pro reads structure, trend, momentum, levels, volatility, volume and session in one pass and gives you a single answer with the reasoning attached. Free 7-day trial, no card required.

Start free trial

Frequently asked questions

What is an Expert Advisor in trading?

An Expert Advisor is a program that runs inside MetaTrader and trades your account automatically according to rules written into its code. It can open, modify and close real positions without any input from you. EAs are written in MQL4 for MT4 or MQL5 for MT5 and are installed in the platform’s Experts folder.

What is the difference between an Expert Advisor and an indicator?

An Expert Advisor can place and manage real trades on your account; an indicator cannot touch your account at all. An indicator only analyses price and draws information on the chart, leaving every decision and every click to you. This distinction is the single most important thing to be clear about before installing anything.

Do forex robots actually work?

Some legitimately automate a sound strategy, and if the underlying rules have an edge then executing them mechanically is genuinely better than executing them emotionally. The great majority of EAs sold to retail traders do not, and many manufacture attractive results using martingale or grid logic that eventually loses the whole account. An EA enforces an edge, it cannot create one.

How do I install an Expert Advisor on MT5?

Open MT5, click <span class="mono">File › Open Data Folder</span>, go into <span class="mono">MQL5</span> then <span class="mono">Experts</span>, and copy the <span class="mono">.ex5</span> file there. Right-click Expert Advisors in the Navigator and choose Refresh, then drag the EA onto a chart. You must also enable the AutoTrading button in the toolbar and tick Allow Algo Trading in the EA’s settings before it will place any orders.

Why is my EA not trading?

Check the smiling face in the top-right corner of the chart; a sad face or a cross means it is not permitted to trade. The usual causes are the AutoTrading button being off, Allow Algo Trading not ticked in the EA’s Common tab, a missing WebRequest permission, or the EA’s own conditions simply not being met yet. The Experts tab in the Toolbox will normally say which.

What is a martingale EA and why is it dangerous?

A martingale EA increases position size after a loss so that one eventual win recovers the whole sequence. It produces long runs of small profits and a very appealing equity curve, which is why it sells well. When a market trends against it for long enough, the position sizes escalate beyond what the account can support and the entire balance is lost in one sequence.

Do I need a VPS to run an Expert Advisor?

If it needs to trade continuously, effectively yes. An EA only functions while the terminal is running and connected, so a laptop that sleeps, restarts for updates or drops Wi-Fi can leave positions unmanaged. A VPS keeps the terminal alive on a machine with a stable connection that never sleeps.

Can I run more than one EA at the same time?

Yes, but only one per chart, running several means opening several charts, one for each. If they trade the same symbol, give each a distinct magic number so they only manage their own positions, and account for the fact that their combined exposure may be far larger than any single one suggests.

Does Market Structure Pro place trades?

No. Market Structure Pro is an indicator, not an Expert Advisor. It analyses conditions and produces a TRADE, TRANSITION or NO TRADE verdict with a confidence percentage, a grade and an explanation, but it cannot open, close or modify any position. All execution remains entirely in your hands.

Related reading