An Expert Advisor (EA) is an automated trading system designed to execute trades based on pre-programmed rules. EAs operate on the MetaTrader 5 (MT5) platform, removing the need for manual intervention by analysing market conditions and placing trades automatically.
Traders use EAs to ensure their trading strategies’ precision, efficiency, and discipline.
While an EA can execute trades effectively, its performance heavily depends on how well it is configured. Market conditions change over time, meaning an EA that worked well in the past may not remain profitable.
Optimisation is the process of fine-tuning an EA’s parameters to adapt to different market conditions, enhancing its profitability and stability.
Without optimisation, an EA may:
MT5 provides a powerful Strategy Tester tool, which allows traders to backtest and optimise their EAs. This tool simulates trading based on historical data to determine how an EA would have performed under different conditions.
Key features of the MT5 Strategy Tester include:
By understanding the importance of EA optimisation and how the MT5 Strategy Tester works, traders can fine-tune their automated strategies to achieve better performance and adapt to changing markets.
Optimisation in MT5 refers to systematically adjusting an Expert Advisor’s (EA) parameters to improve performance. The goal is to identify the best possible settings that maximise profitability, reduce drawdowns, and improve trading consistency.
The MT5 Strategy Tester allows traders to run multiple backtests using different combinations of input parameters, evaluating the EA’s performance under historical market conditions. By doing so, traders can find optimal settings that align with their trading goals.
While both backtesting and optimisation are essential for EA development, they serve different purposes:
Feature | Backtesting | Optimisation |
Purpose | Tests the EA’s performance using a fixed set of parameters. | Finds the best combination of parameters for optimal performance. |
Execution | Runs a single test based on past data. | Runs multiple tests with different parameter settings. |
Time Required | Relatively fast, as only one test is performed. | Can be time-consuming, especially with large datasets. |
Outcome | Provides a performance report with key statistics. | Identifies the best parameter set based on selected criteria. |
Optimising an EA is essential for improving its trading efficiency and adapting it to various market conditions. Some key benefits include:
Proper preparation is crucial before running an optimisation in MetaTrader 5 (MT5). A well-prepared setup ensures reliable results and prevents common pitfalls like overfitting. Traders must select the right EA, set up historical data, choose the best trading pairs and timeframes, and configure EA parameters for optimisation.
Not all Expert Advisors (EAs) are designed for optimisation. Some may have hard-coded parameters that cannot be adjusted, while others may require manual input for certain conditions. Before optimising, you must ensure:
If an EA lacks flexibility, optimisation won’t be effective.
The accuracy of optimisation depends on the quality of historical price data. If the data is incomplete or low-quality, optimisation results may not reflect real market conditions.
Steps to Set Up High-Quality Historical Data:
Download historical data from Symbols options in MT5
The effectiveness of an EA depends on the currency pair or asset being traded and the timeframe in which it operates.
The timeframe selection depends on the EA’s trading style:
Trading Style | Recommended Timeframe |
Scalping | M1, M5, M15 |
Intraday | M15, M30, H1 |
Swing Trading | H4, D1 |
Long-Term | D1, W1 |
If unsure about the timeframes, start with H1 and then refine based on results.
Before optimisation, define which EA settings to optimise and which to keep fixed.
Types of Parameters to Optimize
Setting Parameter Ranges
Optimisation requires defining minimum, maximum, and step values for each parameter.
Parameter | Min Value | Max Value | Step |
Take Profit (TP) | 20 pips | 100 pips | 5 pips |
Stop Loss (SL) | 10 pips | 50 pips | 5 pips |
Lot Size | 0.1 | 1.0 | 0.1 |
Moving Average Period | 10 | 100 | 5 |
Traders must use logical ranges—too many values slow down optimisation, while too few reduce accuracy.
The MT5 Strategy Tester is a powerful tool for optimizing Expert Advisors (EAs). It allows traders to test multiple parameter combinations, simulate real market conditions, and determine the most effective settings.
To access the MT5 Strategy Tester:
The interface consists of several sections:
Section | Purpose |
EA Selection | Choose the EA to optimise. |
Symbol & Timeframe | Select the currency pair and timeframe for testing. |
Model Selection | Choose how price data is simulated (tick, OHLC, etc.). |
Optimisation Mode | Select whether to use a full or genetic algorithm. |
Parameter Settings | Define which inputs will be optimised and their range. |
Execution Settings | Set deposit amount, leverage, and spread conditions. |
Results Tab | View the performance of different parameter combinations. |
Strategy Tester options in MT5 (EN)
Strategy Tester options in MT5 (TC)
Strategy Tester options in MT5 (SC)
MT5 offers two primary optimisation modes:
1. Slow (Full) Optimization: It tests all possible combinations of input parameters and provides the most accurate results but is time-consuming. It is suitable for small parameter ranges or when high accuracy is needed.
2. Fast Genetic Algorithm (GA) Optimization: It uses machine learning techniques to find the best settings, prioritises high-performing parameter combinations and eliminates weaker ones. It is much faster than full optimisation and is ideal for large parameter ranges.
It is recommended that the Genetic Algorithm be used first to identify promising settings, then refined with Full Optimization.
To optimise an EA, define which parameters should change and set their ranges:
MT5 provides different testing models for optimisation. The choice depends on speed vs. accuracy.
Testing Model | Speed | Accuracy | Best Use Case |
Every Tick | Slow | High | Scalping & precise strategies |
1-Minute OHLC | Medium | Medium | Swing & intraday trading |
Open Prices Only | Fast | Low | Initial quick testing |
For scalping EAs, use “Every Tick”; for a balanced speed and accuracy, use “1-Minute OHLC”.
For realistic optimisation, ensure market conditions reflect real trading scenarios.
1. Spread Settings: While optimising, you can use fixed or variable spreads. You can also set a realistic spread or use the current speed for a real-market simulation.
2. Slippage Settings: It accounts for order execution delays. You must set a reasonable value (e.g., 2-3 pips for volatile markets).
3. Initial Deposit & Leverage: You must set a realistic deposit amount and leverage (e.g., $10,000 with 1:100).
Once the Expert Advisor (EA) optimisation process in MetaTrader 5 (MT5) is complete, the next step is to analyse the results to ensure the selected parameters offer a balance of profitability, stability, and risk control.
MT5 provides several key metrics in the Optimization Results tab. Each of these metrics helps evaluate the EA’s overall performance.
Metric | Description | Ideal Value |
Net Profit | Total profit after losses | Higher is better, but not the only indicator |
Drawdown (%) | Maximum drop in balance/equity | Below 20% for low risk |
Profit Factor (PF) | Ratio of gross profit to gross loss | PF > 1.5 is good, >2.0 is excellent |
Win Rate (%) | Percentage of profitable trades | 40-60% is acceptable if R:R is high |
Expected Payoff | Average profit per trade | Higher is better |
Sharpe Ratio | Risk-adjusted return | Above 0.5 is acceptable, above 1.0 is excellent |
Recovery Factor | Net profit ÷ max drawdown | Above 3.0 is strong |
Stability Factor | Measures consistency | The closer to 1.0, the better |
After running optimisation, MT5 ranks parameter combinations based on net profit by default. However, blindly choosing the most profitable result can be risky.
Overfitting happens when an EA is optimised too specifically for past data, making it perform well in backtests but fail in live trading.
Signs of overfitting:
Ways to prevent overfitting:
MT5 provides graphical data in the Results and Graph tabs, helping you visually assess an EA’s stability.
Equity Curve Type | Interpretation |
Smooth upward growth | Ideal performance, good consistency. |
Slow rise with occasional dips | Acceptable, but check drawdown. |
Steep spikes, deep crashes | Overfitted or high-risk EA. |
Flat or downward slope | Non-profitable, needs adjustments. |
To get the best possible EA settings, compare different optimisation tests. To compare different optimisation tests effectively, traders must:
After analysing the resu
Ultima Markets is a fully licensed broker and a multi-asset trading platform offering access to
250+ CFD financial instruments, including Forex, Commodities, Indices and Shares. We
guarantee tight spreads and fast execution. Until now, we have served clients from 172
countries and regions with our trustworthy services and well-built trading systems.
Ultima Markets has achieved remarkable recognition in 2024, winning prestigious awards
such as the Best Affiliates Brokerage, Best Fund Safety in Global Forex Awards, and
the Best APAC CFD broker in Traders Fair 2024 Hong Kong. As the first CFD broker to join
the United Nations Global Compact, Ultima Markets underscores its commitment to
sustainability and the mission to advance ethical financial services and contribute to a
sustainable future.
Ultima Markets is a member of The Financial Commission, an international independent
body responsible for resolving disputes in the Forex and CFD markets.
All clients of Ultima Markets are protected under insurance coverage provided by Willis
Towers Watson (WTW), a global insurance brokerage established in 1828, with claims
eligibility up to US$1,000,000 per account.
Open an account with Ultima Markets to start your index CFDs trading journey.
Get started or expand your knowledge of trading at any level with a wealth of financial industry terms and definitions that you won’t find anywhere else.
A decentralized system that uses algorithms to automatically manage liquidity and trading in financial markets without traditional market makers.
Bookmark
The yearly interest rate a trader pays on borrowed funds or e arns on investments, excluding compounding.
Bookmark
The yearly interest rate a trader earns, including compounding, which reflects the real return on an investment.
Bookmark
A security method using two different keys (public and private) to encrypt and decrypt data, ensuring secure transactions.
Bookmark
The apportionment of premiums and discounts on forward exchange transactions that relate directly to deposit swap (interest arbitrage) deals, over the period of each deal.
Bookmark
A direct peer-to-peer exchange of different cryptocurrencies without the need for intermediaries, reducing counterparty risk.
Bookmark
The value of a country's exports minus its imports.
Bookmark
A type of chart which consists of four significant points: the high and the low prices, which form the vertical bar; the opening price, which is marked with a horizontal line to the left of the bar; and the closing price, which is marked with a horizontal line to the right of the bar.
Bookmark
A certain price of great importance included in the structure of a Barrier Option. If a Barrier Level price is reached, the terms of a specific Barrier Option call for a series of events to occur.
Bookmark
Any number of different option structures (such as knock-in, knock-out, no touch, double-no-touch-DNT) that attaches great importance to a specific price trading. In a no-touch barrier, a large defined payout is awarded to the buyer of the option by the seller if the strike price is not 'touched' before expiry. This creates an incentive for the option seller to drive prices through the strike level and creates an incentive for the option buyer to defend the strike level.
Bookmark
The first currency in a currency pair. It shows how much the base currency is worth as measured against the second currency. For example, if the USD/CHF (U.S. Dollar/Swiss Franc) rate equals 1.6215, then one USD is worth CHF 1.6215. In the forex market, the US dollar is normally considered the base currency for quotes, meaning that quotes are expressed as a unit of $1 USD per the other currency quoted in the pair. The primary exceptions to this rule are the British pound, the euro and the Australian dollar.
Bookmark
The GBP/USD (Great British Pound/U.S. Dollar) pair. Cable earned its nickname because the rate was originally transmitted to the US via a transatlantic cable beginning in the mid 1800s when the GBP was the currency of international trade.
Bookmark
The Canadian dollar, also known as Loonie or Funds.
Bookmark
A currency trade which exploits the interest rate difference between two countries. By selling a currency with a low rate of interest and buying a currency with a high rate of interest, the trader will receive the interest difference between the two countries while this trade is open.
Bookmark
A monthly gauge of Canadian business sentiment issued by the Richard Ivey Business School.
Bookmark
A chart that indicates the trading range for the day as well as the opening and closing price. If the open price is higher than the close price, the rectangle between the open and close price is shaded. If the close price is higher than the open price, that area of the chart is not shaded.
Bookmark
Speculators who take positions in commodities and then liquidate those positions prior to the close of the same trading day.
Bookmark
Making an open and close trade in the same product in one day.
Bookmark
A term that denotes a trade done at the current market price. It is a live trade as opposed to an order.
Bookmark
An individual or firm that acts as a principal or counterpart to a transaction. Principals take one side of a position, hoping to earn a spread (profit) by closing out the position in a subsequent trade with another party. In contrast, a broker is an individual or firm that acts as an intermediary, putting together buyers and sellers for a fee or commission.
Bookmark
The difference between the buying and selling price of a contract.
Bookmark
European Central Bank, the central bank for the countries using the euro.
Bookmark
A government-issued statistic that indicates current economic growth and stability. Common indicators include employment rates, Gross Domestic Product (GDP), inflation, retail sales, etc.
Bookmark
An order to buy or sell at a specified price that remains open until the end of the trading day.
Bookmark
The time zone of New York City, which stands for United States Eastern Standard Time/Eastern Daylight time.
Bookmark
A name for the Euronext 50 index.
Bookmark
The dollar level of new orders for both durable and nondurable goods. This report is more in depth than the durable goods report which is released earlier in the month.
Bookmark
The Federal Reserve Bank, the central bank of the United States, or the FOMC (Federal Open Market Committee), the policy-setting committee of the Federal Reserve.
Bookmark
Refers to members of the Board of Governors of the Federal Reserve or regional Federal Reserve Bank Presidents.
Bookmark
Refers to the price quotation of '00' in a price such as 00-03 (1.2600-03) and would be read as 'figure-three.' If someone sells at 1.2600, traders would say 'the figure was given' or 'the figure was hit.
Bookmark
When an order has been fully executed.
Bookmark
Group of 7 Nations - United States, Japan, Germany, United Kingdom, France, Italy and Canada.
Bookmark
Group of 8 - G7 nations plus Russia.
Bookmark
A quick market move in which prices skip several levels without any trades occurring. Gaps usually follow economic data or news announcements.
Bookmark
Gearing refers to trading a notional value that is greater than the amount of capital a trader is required to hold in his or her trading account. It is expressed as a percentage or a fraction.
Bookmark
An index of the top 30 companies (by market capitalization) listed on the German stock exchange – another name for the DAX.
Bookmark
Every 100 pips in the FX market starting with 000.
Bookmark
A country's monetary policymakers are referred to as hawkish when they believe that higher interest rates are needed, usually to combat inflation or restrain rapid economic growth or both.
Bookmark
A position or combination of positions that reduces the risk of your primary position.
Bookmark
To sell at the current market bid.
Bookmark
Names for the Hong Kong Hang Seng index.
Bookmark
Little volume being traded in the market; a lack of liquidity often creates choppy market conditions.
Bookmark
The IMM, or International Monetary Market, is a part of the Chicago Mercantile Exchange (CME) that deals with trading currency and interest rate futures and options.
Bookmark
A traditional futures contract based on major currencies against the US dollar. IMM futures are traded on the floor of the Chicago Mercantile Exchange.
Bookmark
8:00am - 3:00pm New York.
Bookmark
Abbreviation for the Dow Jones Industrial Average.
Bookmark
Measures the mood of businesses that directly service consumers such as waiters, drivers and beauticians. Readings above 50 generally signal improvements in sentiment.
Bookmark
Measures the total value of new orders placed with machine tool manufacturers. Machine tool orders are a measure of the demand for companies that make machines, a leading indicator of future industrial production. Strong data generally signals that manufacturing is improving and that the economy is in an expansion phase.
Bookmark
A name for the NEKKEI index.
Bookmark
To limit your trades due to inclement trading conditions. In either choppy or extremely narrow markets, it may be better to stay on the sidelines until a clear opportunity arises.
Bookmark
Nickname for NZD/USD (New Zealand Dollar/U.S. Dollar).
Bookmark
Option strategy that requires the underlying product to trade at a certain price before a previously bought option becomes active. Knock-ins are used to reduce premium costs of the underlying option and can trigger hedging activities once an option is activated.
Bookmark
Option that nullifies a previously bought option if the underlying product trades a certain level. When a knock-out level is traded, the underlying option ceases to exist and any hedging may have to be unwound.
Bookmark
The last day you may trade a particular product.
Bookmark
The last time you may trade a particular product.
Bookmark
Statistics that are considered to predict future economic activity.
Bookmark
A price zone or particular price that is significant from a technical standpoint or based on reported orders/option interest.
Bookmark
Also known as margin, this is the percentage or fractional increase you can trade from the amount of capital you have available. It allows traders to trade notional values far higher than the capital they have. For example, leverage of 100:1 means you can trade a notional value 100 times greater than the capital in your trading account.*
Bookmark
The longest-term trader who bases their trade decisions on fundamental analysis. A macro trade’s holding period can last anywhere from around six months to multiple years.
Bookmark
Measures the total output of the manufacturing aspect of the Industrial Production figures. This data only measures the 13 sub-sectors that relate directly to manufacturing. Manufacturing makes up approximately 80% of total Industrial Production.
Bookmark
A request from a broker or dealer for additional funds or other collateral on a position that has moved against the customer.
Bookmark
A dealer who regularly quotes both bid and ask prices and is ready to make a two-sided market for any financial product.
Bookmark
An order to buy or sell at the current price.
Bookmark
An abbreviation for the NASDAQ 100 index.
Bookmark
The amount of currency bought or sold which has not yet been offset by opposite transactions.
Bookmark
8:00am – 5:00pm (New York time).
Bookmark
An option that pays a fixed amount to the holder if the market never touches the predetermined Barrier Level.
Bookmark
Symbol for NYSE Composite index.
Bookmark
The price at which the market is prepared to sell a product. Prices are quoted two-way as Bid/Offer. The Offer price is also known as the Ask. The Ask represents the price at which a trader can buy the base currency, which is shown to the right in a currency pair. For example, in the quote USD/CHF 1.4527/32, the base currency is USD, and the ask price is 1.4532, meaning you can buy one US dollar for 1.4532 Swiss francs.
In CFD trading, the Ask represents the price a trader can buy the product. For example, in the quote for UK OIL 111.13/111.16, the product quoted is UK OIL and the ask price is £111.16 for one unit of the underlying market.
Bookmark
If a market is said to be trading offered, it means a pair is attracting heavy selling interest, or offers.
Bookmark
A trade that cancels or offsets some or all of the market risk of an open position.
Bookmark
Attempting to sell at the current market order price.
Bookmark
A designation for two orders whereby if one part of the two orders is executed, then the other is automatically cancelled.
Bookmark
Refers to the offer side of the market dealing.
Bookmark
The forex quoting convention of matching one currency against the other.
Bookmark
A very heavy round of selling.
Bookmark
A market that moves a great distance in a very short period of time, frequently moving in an accelerating fashion that resembles one half of a parabola. Parabolic moves can be either up or down.
Bookmark
When only part of an order has been executed.
Bookmark
When a central bank injects money into an economy with the aim of stimulating growth.
Bookmark
When a central bank injects money into an economy with the aim of stimulating growth.
Bookmark
An indicative market price, normally used for information purposes only.
Bookmark
A recovery in price after a period of decline.
Bookmark
When a price is trading between a defined high and low, moving within these two boundaries without breaking out from them.
Bookmark
The price of one currency in terms of another, typically used for dealing purposes.
Bookmark
Reserve Bank of Australia, the central bank of Australia.
Bookmark
Reserve Bank of New Zealand, the central bank of New Zealand.
Bookmark
The Securities and Exchange Commission.
Bookmark
A group of securities that operate in a similar industry.
Bookmark
Taking a short position in expectation that the market is going to go down.
Bookmark
The process by which a trade is entered into the books, recording the counterparts to a transaction. The settlement of currency trades may or may not involve the actual physical exchange of one currency for another.
Bookmark
Symbol for the Shanghai A index
Bookmark
Assuming control of a company by buying its stock.
Bookmark
The process by which charts of past price patterns are studied for clues as to the direction of future price movements.
Bookmark
Traders who base their trading decisions on technical or charts analysis.
Bookmark
US government-issued debt which is repayable in ten years. For example, a US 10-year note.
Bookmark
A illiquid, slippery or choppy market environment. A light-volume market that produces erratic trading conditions.
Bookmark
Describing unforgiving market conditions that can be violent and quick.
Bookmark
Measures the average wage including/excluding bonuses paid to employees. This is measured quarter-on-quarter (QoQ) from the previous year.
Bookmark
Measures the number of people claiming unemployment benefits. The claimant count figures tend to be lower than the unemployment data since not all of the unemployed are eligible for benefits.
Bookmark
Measures the relative level of UK house prices for an indication of trends in the UK real estate sector and their implication for the overall economic outlook. This index is the longest monthly data series of any UK housing index, published by the largest UK mortgage lender (Halifax Building Society/Bank of Scotland).
Bookmark
Measures the change in the number of people claiming unemployment benefits over the previous month.
Bookmark
Also known as the maturity date, it is the date on which counterparts to a financial transaction agree to settle their respective obligations, i.e., exchanging payments. For spot currency transactions, the value date is normally two business days forward.
Bookmark
Funds traders must hold in their accounts to have the required margin necessary to cope with market fluctuations.
Bookmark
Shows the market's expectation of 30-day volatility. It is constructed using the implied volatilities of a wide range of S&P 500 index options. The VIX is a widely used measure of market risk and is often referred to as the "investor fear gauge."
Bookmark
Referring to active markets that often present trade opportunities.
Bookmark
Chart formation that shows a narrowing price range over time, where price highs in an ascending wedge decrease incrementally, or in a descending wedge, price declines are incrementally smaller. Ascending wedges typically conclude with a downside breakout and descending wedges typically terminate with upside breakouts.
Bookmark
Slang for a highly volatile market where a sharp price movement is quickly followed by a sharp reversal.
Bookmark
Measures the changes in prices paid by retailers for finished goods. Inflationary pressures typically show earlier than the headline retail.
Bookmark
Where a limit order has been requested but not yet filled.
Bookmark
Acronym for The Wall Street Journal.
Bookmark
Symbol for Silver Index.
Bookmark
Symbol for Gold Index.
Bookmark
Symbol for AMEX Composite Index.
Bookmark
Yemeni Rial. The currency of Yemen. It is subdivided into 100 fils.
Bookmark
See YER.
Bookmark
See JPY.
Bookmark
Yield is the return on an investment and is usually expressed as a percentage.
Bookmark
See CNY
Bookmark
Rand. The currency of South Africa. It is subdivided into 100 cents.
Bookmark
Zambian Kwacha. The currency of Zambia. It is subdivided into 100 Ngwee.
Bookmark
Zimbabwe Dollar. The currency of Zimbabwe. It is subdivided into 100 cents.
Bookmark
See ZMW.
Bookmark
A technical indicator that draws tops and bottoms - filtering out noise.
Bookmark
See ZWL.
Bookmark
Cancel
Confirm