Camovia Tray™

Blog · Knowledge

How to Step-by-Step Backtest a Strategy in MT5: A Practical Guide for Traders

Camovia Tray Team · 2026-09-13

Have you ever spent hours developing a trading strategy, only to watch it crumble in real-market conditions? Or perhaps you are not sure whether your Expert Advisor (EA) will hold up when the market turns volatile. These are common concerns for traders, and the answer to them often lies in one essential practice: backtesting.

But how do you actually backtest a strategy in MetaTrader 5 step by step? And more importantly, how can you ensure that you are testing not just for historical performance, but for real-world viability?

Why Backtesting Matters

Backtesting is the process of evaluating a trading strategy using historical price data to see how it would have performed in the past. For traders using MetaTrader 5 (MT5), the built-in Strategy Tester is the primary tool for this task. It allows you to simulate trades based on an Expert Advisor's rules, giving you insight into potential profitability, drawdown, and risk before you commit real capital.

But backtesting is more than just hitting the "Start" button—a thoughtful, step-by-step approach is what separates meaningful validation from misleading results.

Step-by-Step: How to Backtest a Strategy in MT5

Here is a clear, practical guide to running a backtest on MT5. Let's walk through each step.

1. Open the Strategy Tester

To begin, open MetaTrader 5 on your Windows desktop—the Strategy Tester is not available on mobile or web versions . Go to the "View" menu and select "Strategy Tester," or use the keyboard shortcut Ctrl+R . This opens the dedicated testing interface where you will configure and run your backtest.

2. Select Your Expert Advisor and Trading Instrument

In the Strategy Tester window, choose the EA you want to test from the "Expert" dropdown menu. Next, select the trading symbol (e.g., EURUSD, XAUUSD) and the timeframe you want to test against. The chosen symbol and timeframe will determine the historical data used for your simulation .

3. Set the Date Range and Testing Parameters

Configure the testing period by specifying the start and end dates for the backtest. This is where you decide whether to test your strategy on recent data or further back in history.

You will also need to set the initial deposit, leverage, and other parameters that define the testing environment. If you are testing a multi-currency strategy, be aware that it will require data for all involved symbols and will run more slowly than a single-symbol test .

4. Choose the Right Modelling Mode

One of the most critical decisions in backtesting is which modelling mode to use. MT5 offers four options, each balancing speed and accuracy :

  • Every tick (based on real ticks): Uses actual historical tick data. This is the most accurate mode, but also the slowest. It is ideal when precision is essential, especially for short test periods .
  • Every tick (generated): Generates ticks from bar data using a model. Faster than real ticks, but slightly less accurate because it approximates price movements between bars .
  • 1-minute OHLC: Simulates trades using only the open, high, low, and close of each 1-minute bar. This is a practical compromise between speed and accuracy, suitable for many strategies .
  • Open prices only: Uses only the open price of each bar. This is the fastest mode, best for quick estimates or initial parameter optimisation when you need to run many combinations rapidly .

Choose a model that matches your need for fidelity—if you are validating a strategy for live trading, favour accuracy over speed.

5. Configure Optimisation (Optional)

If you want to find the best parameters for your EA, enable the optimisation feature. This tells the Strategy Tester to run multiple backtests with different combinations of input parameters, then report which set produced the best result according to your chosen metric .

While optimisation is powerful, be cautious. It is easy to "overfit" your strategy to historical data—meaning it works beautifully in backtest but fails in live markets. To guard against this, you can use the forward testing option.

6. Run the Test

Once all settings are configured, click the Start button. MT5 will begin downloading historical data (if not already cached) and run the simulation. A progress bar shows how the test is advancing, and you can monitor the Journal tab for any errors or messages from the EA .

7. Analyse the Results

After the test finishes, the Results tab displays a comprehensive performance report. Key metrics include total trades, profit factor, expected payoff, drawdown, and the Sharpe ratio. You can also view a graph of the equity curve to see the account balance over time .

For multi-currency tests, the trade log will distinguish which trades were placed on each instrument, allowing you to assess performance across your basket .

8. Forward Testing for Real-World Validation

To mitigate the risk of overfitting, MT5 includes a forward testing option. This splits your date range into two parts: the first part is used for optimisation (in-sample), and the second part is reserved for validation (out-of-sample). The best parameter set from the optimisation run is then tested on the forward period. If your strategy performs well on both segments, it is more likely to hold up in live trading .

The Practical Challenge: Running a Backtest While Managing Your Live Environment

Now that you know the technical steps, consider the practical reality. You are running multiple backtests, tweaking parameters, and maybe even running optimisation across hundreds of combinations. Each test takes time, and during that time, you are looking at the MT5 platform window—often full-screen.

Here is where many traders hit a friction point: the MT5 interface is heavy. To run a backtest, you leave it open. To check a live price, you switch back. To review a position you have open, you navigate away from the Strategy Tester again. The constant switching between testing and monitoring is distracting and inefficient.

But there is a simple solution. Camovia Tray is a lightweight tool that turns your MT5 into a tray application—it lives in your system tray, not on your taskbar. While your backtest is running, you can hover over the Camovia Tray icon to instantly see real-time quotes for your selected instruments without bringing MT5 into focus [Product Knowledge: Feature 1]. You can also view your open positions and even close them with a click, all from the tray, without interrupting your testing workflow [Product Knowledge: Feature 2].

Additionally, if you are running a backtest that requires your full attention on the Strategy Tester, you can use Camovia Tray to hide the MT5 main window from the taskbar and Alt+Tab switching list entirely. This keeps your workspace clean and ensures the testing environment stays front and centre [Product Knowledge: Feature 3]. And because Camovia Tray reads data entirely from your local MT5 terminal—never sending anything to the cloud—your strategy data and trade history remain on your computer [Product Knowledge: Feature 8].

Final Thought

Backtesting is an invaluable step in validating your trading strategy, but it is only as effective as the process you follow. By approaching it step by step—choosing the right modelling mode, using optimisation carefully, and applying forward testing—you build confidence in your EA's ability to perform in real markets.

And while your backtest runs, tools like Camovia Tray can help you keep an eye on the live market and manage your open trades without cluttering your screen or distracting you from the analysis at hand. It is about working smarter, not harder.

Turn MT5 / MT4 into a Tray Tool

Check quotes, manage positions, and hide in one click.

Download Camovia Tray

Frequently Asked Questions

What is the tray lock feature?

Lock the tray function instantly at key moments to protect your privacy and prevent private information from leaking.

What information can I monitor?

Quotes and open positions: symbol, direction, open time, current P&L, and more - all visible in the popup positions tab. Click an order to close it.

Which languages are supported?

Chinese and English, switchable on both the website and the client.

How do I download it?

Install from the Microsoft Store - the download page on this site has the link.

Popular Symbols Trading Hours

Open/close times, weekend hours & live market status: