EA settings explained: magic number, lot mode, max spread, slippage and more
Open the settings of almost any Expert Advisor and you see the same kinds of inputs: a magic number, a lot mode, a maximum spread, a slippage value. Understanding them takes ten minutes and prevents the most common setup mistakes.
Two kinds of settings
When you attach an EA to a chart, MetaTrader opens a window with several tabs. Two of them matter most:
- The Common tab holds the permissions from MetaTrader itself, such as whether the EA is allowed to trade.
- The Inputs tab holds the EA's own settings, chosen by its developer.
Permissions in the Common tab
Allow algo trading
In MetaTrader 5 the box is called Allow Algo Trading; in MetaTrader 4 it is Allow live trading. The Algo Trading button in the MetaTrader 5 toolbar, called AutoTrading in MetaTrader 4, must also be on. If either is off, the EA runs but does not open trades. A smiling face or a blue hat icon in the top-right corner of the chart usually shows the EA is active.
WebRequest for EAs that use the internet
Some EAs download data, for example a news calendar or a license check. MetaTrader blocks these connections unless the address is added under Tools > Options > Expert Advisors > Allow WebRequest for listed URL. If the EA's guide lists an address, add it exactly as written.
The inputs most EAs share
Magic number
A number the EA writes on every trade it opens, so it can recognise its own positions. If you run two EAs, or the same EA on two charts, give each a different magic number. Two copies with the same number can manage or close each other's trades.
Lot mode: fixed lot or risk percent
- Fixed lot opens the same size on every trade, for example 0.01. Simple, but the risk as a percentage changes as the balance grows or shrinks.
- Risk percent or auto lot calculates the lot from the balance and the stop loss, so each trade risks roughly the same percentage. This is usually the safer default, as long as the percentage is small. See how to calculate lot size for the maths behind it.
Stop loss and take profit: points or pips?
Many EAs ask for distances in points, the smallest price step of the symbol. On a gold symbol with two decimals, 1 point is $0.01, so 100 points is a $1 move. On a symbol with three decimals, 1 point is $0.001. Read the EA's guide: entering pips where points are expected, or the other way round, makes the stop ten times too small or too large.
Maximum spread
The EA skips a trade if the spread at that moment is above this value. It protects you from entering at a terrible price, for example at the daily reopen. Around news the spread is naturally wide, so a news EA needs a different value than a scalper. Set it too low and the EA never trades; set it too high and the protection disappears.
Slippage or deviation
The maximum distance, in points, between the requested price and the filled price that you accept for a market order. Whether the broker honours it depends on the execution mode. Pending orders that trigger usually fill at the available price regardless of this setting.
Time filter
Many EAs only trade within certain hours. Check whether the hours are in broker server time, which is shown in Market Watch, or in another time zone. Server time is often GMT+2 or GMT+3, not WIB.
Maximum trades and daily limits
Limits such as a maximum number of open trades or a maximum daily loss stop the EA from piling up risk on a bad day. If the EA offers them, use them.
Save your settings as a .set file
Below the inputs list, the Save button stores all values in a .set file, and Load reads them back. Save a copy before you change anything, and keep one file per account or strategy. After a terminal reinstall or a move to a new VPS, loading the file restores everything in seconds.
Check that it works
After attaching the EA, open the Experts tab and the Journal tab at the bottom of MetaTrader. They show whether the EA loaded, whether WebRequest or license checks succeeded, and why a trade was refused. Most setup problems can be read there in plain words.
A short safety routine
- Start on a demo account or with the smallest lot.
- Change one setting at a time, and write down what you changed and why.
- Keep the developer's default values unless you understand the reason to change them.
- Recheck the settings after every EA update, because new versions can add or rename inputs.
Key takeaways
- The Common tab holds MetaTrader permissions; the Inputs tab holds the EA's own settings.
- Algo trading must be allowed both in the EA window and with the toolbar button; EAs that use the internet need their address in the WebRequest list.
- Give every EA or chart its own magic number.
- Risk percent sizing is usually safer than a fixed lot, as long as the percentage is small.
- Know whether distances are in points or pips, and save your settings in a .set file.
Trading carries a high level of risk and may not be suitable for everyone. This article is for education only and is not financial advice. Past results do not guarantee future results.