EA Settings Explained: Lot Size, Stop Loss and Profit Targets

By the Victoryalgo team · · 7 min read

Every Expert Advisor (EA) has settings that control how it trades. MetaTrader calls them inputs. This guide explains the most common ones in simple words, including lot size, stop loss, take profit and profit targets.

Every EA is different, and the same setting can have a different name. Always read your EA's manual or ask its developer. The numbers below only show how the maths works. They are not recommended settings. New to EAs? Start with our complete guide to Expert Advisors.

Where to Find an EA's Settings

The settings window opens when you attach an EA to a chart. If the EA is already running, click its chart and press F7. In MT5, the window can have these tabs:

  • Common: information about the EA and the box that lets it trade.
  • Inputs: the EA's own settings. You will use this tab most.
  • Dependencies: you see this only if the EA uses other EX5 or DLL files.

On the Inputs tab, double-click a value to change it, then click OK. The EA then starts again with the new settings. Before you do this, find out how your EA handles trades that are already open. To add an EA to a chart, read How to Install and Run an EA on MT5.

Pips or Points? Check This First

This is an easy setting to get wrong. Some EAs use pips and others use points. On most symbols, a point is one step in the last digit of the price.

Symbol and price format1 pointExample
EURUSD, 5 decimals0.0000120 pips = 200 points
USDJPY, 3 decimals0.00120 pips = 200 points
Gold (XAUUSD), 2 decimals0.01A $5.00 move = 500 points
Gold (XAUUSD), 3 decimals0.001A $5.00 move = 5,000 points

For example, you want a 20-pip stop on EURUSD, but the EA uses points. If you type 20, the stop will be only 2 pips away. Be extra careful with gold, because traders and EAs do not all define a gold pip in the same way. Ask which unit the EA uses, then check the real distance on a demo trade.

Lot Size and Risk Settings

  • Fixed lot: every trade has the same size, such as 0.10 lot. If the stop loss distance changes, the amount at risk changes too.
  • Risk percent: the EA works out the lot size from your balance or equity, your risk percent and the stop loss distance.

Check if the risk percent uses balance or equity. Also ask what happens when the lot size it works out is below your broker's minimum. The EA should skip the trade or warn you, not quietly take more risk. You can check the numbers with our free lot size calculator.

Stop Loss Settings

  • Fixed distance: the stop is always the same distance from the entry price.
  • ATR-based: ATR measures recent price movement. The stop is wider when the market moves more.
  • Chart-based: the stop goes beyond a recent high or low.

Brokers can set a minimum distance for stops. If a stop loss or take profit is too close to the price, the order can fail with an "Invalid stops" error. A stop loss can also fill at a worse price than you set, for example in a fast market or after a weekend gap.

How to Set Profit Targets in an Expert Advisor

A take profit (TP) is the price where a winning trade should close. Many traders call it a target. These are common ways for an EA to set one:

Target typeHow it worksExample
Fixed distanceThe target is always the same distance from the entry price.40 pips
Risk-to-rewardThe target is a multiple of the stop loss distance.20-pip stop × 2 = 40-pip target
ATR-basedThe target changes with recent price movement.2 × ATR
Several targetsThe EA closes part of the trade at each target.Half at target 1, the rest at target 2
Daily profit targetThe EA stops opening trades for the day when the total reaches your chosen amount.An amount in money or a percent

Before You Use Targets

  • Check the trade size. Each part must fit your broker's minimum lot and lot step. If the minimum is 0.01 lot, a 0.01-lot trade cannot be split between two targets.
  • Check the account type. On an MT5 netting account, each symbol has one position, with one stop loss and one take profit. Several targets need extra code.
  • Ask where the target is kept. A normal take profit is kept on the broker's server, so it normally still works if MT5 closes. A hidden or virtual target is kept by the EA. It works only while MT5 is running and connected.
  • Understand the daily target. Does it only stop new trades, or does it close open trades too? Does it count open profit? When does the day reset?

A target is an instruction, not a promise. The price may never reach it.

Break-Even and Trailing Stop Settings

  • Break-even trigger: how far the price must move in your favour before the EA moves the stop loss to the entry price. Costs and slippage can still lead to a small loss.
  • Trailing start: how far the price must move before the stop loss starts to follow it.
  • Trailing distance: how far the stop loss stays behind the price.
  • Trailing step: how far the price must move before the EA moves the stop loss again.

The EA must be running to move a stop loss. If MT5 closes, the last stop loss saved on the broker's server normally stays there, but the EA cannot move it. See Do You Need a VPS to Run Your EA?

Other Common EA Settings

SettingWhat it does
Magic numberAn ID the EA adds to its trades so it can recognise them. Unless the developer says otherwise, use a different number for each EA and chart.
Maximum spreadThe EA does not open a trade when the spread is above this number. Check if it uses pips or points.
Deviation or slippageThe biggest price difference you accept when an order fills. MT5 measures it in points. It may have no effect, depending on how your broker fills orders.
Maximum open tradesLimits how many trades can be open at the same time.
Trading hoursSets when the EA can open trades. Many EAs use the broker's server time, not your local time.
Daily loss limitStops new trades when the day's loss reaches your limit. Ask if it uses balance or equity, and if it also closes open trades.

Several of these settings help limit risk. Learn more in 7 Risk Management Rules Every Expert Advisor Should Have. For funded accounts, try our prop firm drawdown calculator.

Save, Load and Reset Your Settings

In MT5, the Inputs tab has three useful buttons:

  • Save keeps your current inputs in a settings file (.set).
  • Load opens a settings file you saved earlier.
  • Reset brings back the default values.

Use a clear file name, such as EURUSD_H1_demo.set. Settings for one symbol, broker or EA version may not suit another.

How to Change EA Settings Safely

  1. Save your current settings first.
  2. Check for open trades, and ask how the change will affect them.
  3. Change one setting at a time, so you can see what it does.
  4. Test it on past data. See How to Backtest an EA in the MT5 Strategy Tester.
  5. Run it on a demo account.
  6. Write down what you changed and why.

Do not keep changing settings until the past results look perfect. This is called over-optimisation. Settings that fit the past too closely may not work in new market conditions.

A bot follows your rules, but results depend on your strategy and the market. You can lose money, so always test on a demo account first.

Need an EA With the Settings You Want?

Victoryalgo codes traders' own strategies into EAs through our MT5 EA development and MT4 EA development services. We write your rules in a rule sheet first, including the lot size, stop loss and target settings you want to control. For funded accounts, see our prop firm EA service.

Have a strategy you want to run as an EA? Send us your strategy on WhatsApp for a free consultation. The Victoryalgo team will read your rules and explain how they can be coded.

Victoryalgo is a software development company, not registered with SEBI or any financial regulator. This guide is general education about software, not investment advice. Forex and CFD trading is high risk. Indian residents may trade forex only through RBI-authorised channels.

Frequently Asked Questions

How do I set a profit target in an Expert Advisor?

Click the EA's chart, press F7 and open the Inputs tab. Find the take profit or target setting and check if it uses pips or points. Enter your value, click OK and test it on a demo account. Setting names are different in each EA.

What is the difference between pips and points?

On most symbols, a point is one step in the last digit of the price. On EURUSD with 5 decimals, 1 pip is 10 points. Gold pips are not always defined the same way, so ask which unit your EA uses.

Can I change EA settings while it is running?

Yes, but the EA starts again with the new settings when you click OK. Check for open trades first, and ask the developer how the change will affect them.

What are the best settings for an EA?

No settings are best for everyone. They depend on your strategy, symbol, broker and risk. Test any change on past data and on a demo account. Good past results do not mean good future results.

What is a magic number in an EA?

It is an ID the EA adds to its trades so it can recognise them. Unless the developer says otherwise, use a different magic number for each EA and chart.

More Guides & Free Tools

Want your strategy coded?

Send your rules on WhatsApp. Free consultation, clear quote.

WhatsApp Your Strategy

Risk & Regulatory Notice

  • We are NOT registered with SEBI or any financial regulator. We do not give investment advice, tips or signals, recommend brokers, manage money or trade for you.
  • Software only: we code the rules you give us. Nothing on this page is investment advice.
  • A bot follows your rules. It can't promise profit, and past or backtest results don't show future results.
  • Trading forex, gold, indices and CFDs is high risk. You can lose money, so always test on a demo account first.

Victoryalgo · Software development company · Based in India, working globally

Regulatory status, risk disclosure & policies
Chat with us