• Home
  • Forex For Beginners
  • Forex Brokers
    • Binary Options Brokers
  • Forex Robots
  • All Posts
  • Trading Tools
    • Economic Calendar
    • Forex Market Hours
    • Online Quotes
    • Forex Charts
    • Lot Size Calculator
    • Margin Calculator
Forex Trader Portal

Forex - Trading Strategies, Robots, Indicators, Lessons

How to test EA in the MT5 tester

November 21, 2024 by Michael Leave a Comment

Before sending your expert advisor to a live account, you need to find out: is there a point in it? After all, a lot of forex robots are designed exclusively for selling to trusting fools. One of the first steps of advisor aptitude test is running in the strategy tester.

During testing, the advisor is run based on historical data, treating each quotation and making virtual transactions in the same way as if it was in the real market. In fact, the tester shows how the robot would work in the past. We already have the instruction on advisors test in MT4, so we have prepared the same one for a newer terminal - Metatrader 5.

MT5 trading platform is a powerful tool for development, testing and debugging of automated trading strategies. However, the main feature of MT5 tester is that you can test the strategy, working simultaneously on multiple currencies.

MT5 does not support robots made for MT4, and vice versa: MT4 does not support advisors to MT5.

Setting the strategy tester

To start the tester go to View - Strategy Tester or call the tester window with keyboard shortcut Ctrl + R.

You can also choose the strategy from the browser window and clicking “Test” in the context menu - advisor will be selected in the strategy tester.

  1. In the drop-down list, select the advisor test (tester also supports visual indicator test);
  2. Next, select the advisor or indicator, which is going to be tested. Custom advisors are stored in the Advisors section, examples provided with the terminal are in the Examples, and advisors, downloaded from the store - in the Market;
  3. Now we select trading tool, based on historical quotations of which we will conduct the test. If you do not see the symbol you want, check the market overview window. To display all available quotations open the context menu by clicking the right mouse button and select “Show All”;

Before starting the test, the tester automatically loads all necessary history, so you do not need to worry about this. Loading history can take some time, but only the missing data will be loaded at the next startup.

Loading history on your own was necessary for the strategy tester in MT4. In MT5 this problem is solved. Everything is updated automatically.

  1. Next, choose the timeframe for the test. MetaTrader 5 supports 21 timeframes: from one minute to one month;

  1. After selecting the timeframe it is necessary to determine the period of testing. You can select one of the preset options: all available history, last month, last year or any custom period;
  2. Here, you can manually specify the exact start and end date of the test, up to the present day;
  3. To eliminate the “fitting” you can specify an additional forward-period (you won’t need it for standard test advisor without setting options)Let’s say you choose the optimum settings for the advisor based on test from the current year (up to today’s date). In this case, there is some probability that chosen parameters will only work within the test period, and in the future the results can vary greatly.

    For further verification, you can split test period into 2 parts: back test and forward test. Forward test is a period of advisor re-run, say, the last quarter of the entire test. In MT5 tester you can select a forward from half, third or a quarter of the test duration, or choose your own start date. That is, you conduct advisor parameter optimization on the first time period, and test again on the second one with the same parameters. If during the forward testing results of the strategy are fundamentally different from the previous test results, your selected parameters are unstable and you shouldn’t use this such advisor on a real account;

  4. Currently there are 12 trade modes available: Without Delay and mode with a random, custom delay. Without Delay mode provides a perfect execution without slippage and requotes.

Random or Custom delay mode allows you to test advisor in conditions close to real. To do this random delay in orders execution is given, in 90% of the cases - up to 8 seconds, the other ten - up to 18 seconds. A small remark: such delays on the market are not real, but if your advisor is able to cope with them, it’s really quite good.

  1. Next, you should choose the way of tick data generation.
  • In the “Every tick” mode tick data is modeled on the basis of a minute history. The method is accurate enough, especially when there is no opportunity to test real tick data. If the strategy sends high-frequency queries or uses ultrashort goals, the test results in this mode may be slightly different from real. In this mode, only the spread mean value is modeled during the M1 bar;
  • The next mode, “Every tick based on real ticks“, allows you to test automated strategies on real tick data, downloaded from the broker server. You do not need to download anything on your own, the tester does this automatically before starting the test. Since the test uses real prices, yet it is the most accurate method for strategies testing. In particular, the accuracy of testing is provided by real floating spread. Tick data may need a significant amount of disk space, so before starting the test wait for the history to be downloaded;
  • «1 minute OHLC» - testing based on M1 history, using only the level of the opening price, high, low and close. During the advisor testing in the “Open prices only” mode only the opening price of the bars is used;
  • The last mode, “Math calculations,” disables automatic history updating and ticks generation. This method can be used for the selection of the advisor parameters.

  1. The deposit size is specified on the basis of your real risk capital and money management of the strategy itself. So, you shouldn’t choose a $ 100 000 deposit, if you do not have a $ 100,000 deposit;
  2. Select the amount of leverage;
  3. The visualization mode allows you to visually assess the work of an expert on historical data - all transactions will be displayed on the chart. We will return to this function later. More details about the optimization in MT5 will be given in our next lessons.
  4. Now you just have to press the START button and the test will begin.

Testing visualization

Visualization is worth using when the normal test might not be sufficient and visual evaluation of an advisor is required on the chart. When you activate this function, the visualization will be opened in a new window. Visualization window almost fully complies in functionality with the interface of the terminal. Before starting, make sure that the optimization has been disabled - visual test only works for single runs.

On the top toolbar, you can customize the display style of the price data, change the scale and speed of testing. Information about current prices is available from the market overview window, and all traded instruments are also displayed there. You can test the indicator work in history based on values in data window. In the tool window, you can monitor the current open positions, as well as learn the history of trades and trading log.

Chart itself is not adjustable, but you can use your own template. It’s enough to create a chart template with the desired coloring, attach the desired indicators, or objects, and save the template with the name of the test advisor. To do this, open the context menu of the chart and select “Save Template”.

A standard file save window will be opened. Enter a template name and click “Save”.

Testing of multi-currency strategies

With MT5 tester release traders got an opportunity to test strategies, trading on several instruments. It should be borne in mind that during the multi-currency testing by instruments the history is taken from the trading platform, so before testing turn on the necessary tools in the market overview, go to their charts and set a monthly timeframe. Scrolling the chart to the left terminal will automatically upload the history from the trading server in the form of 1-minute data, until it reaches maximum. Unlike MT4, MT5 predecessor, the new terminal does not support manual download, and takes all the work of downloading and syncing of historical quotations upon itself.

For the test, we’ll download a multi-currency advisor from the Market, MQL5. Downloading advisor demo from the store is possible without leaving the terminal. To do this, go to “Toobox” - “Market”, and select the desired product.

Click “Download demo” on the advisor’s description page.

“Test” button will appear after advisor download.

In the tester, in “Settings”, select 0.1 lot so that the number of dollar/euro is roughly equal to the number of points earned.

How to set up strategy tester for testing on several currency pairs?

In no way! All settings for testing on several currency pairs are within the advisor. There you can switch them on and off, if it was available initially in these settings. The main thing is to note these currency pairs in the “Market Watch” and load their history, as it was said earlier. Everything else advisor performs by itself.

Set the test interval (in this case, the last year), timeframe, parameters of the deposit, select the visualization (if you need it) and press “Start”.

In the “Market Watch” all the tools that are accessed by the advisor will be shown. The chart displays used indicators and trading inputs.

On completion of the test in the “Graph” tab a graph showing the balance/funds for the test interval will be shown. In most cases, the work of the strategy can be assessed according to the graph of its profitability. The more stable and “smoother” the graph, the better. Do not strive for maximum profitability, lot can be always increased. The good strategy should, first and foremost, have a high profit to risk (loss) ratio and a smooth yield curve.

Judging from the chart - we have not an adviser, but garbage. Actually, like most robots in the Market.

For a more detailed report, click on the “Results” tab.

Through the context menu you can save the report in xml markup format, if you are going to study the report via the office software package, or html, to view the report through the browser.

The report displays detailed charts of distribution of the transactions in time. Based on a detailed report, you can find more suitable input parameters for the advisor. For example, the chart shows that the largest loss by the strategy are obtained on Monday night, so you can limit the time of the expert work in the way that it doesn’t trade during periods of low profitability.

Conclusion

Despite the fact that the MT5 tester passed a tremendous way of development and, at the moment, is truly one of the most powerful tools of such a kind in the market, yet it does not take into account many factors that appear only when testing on real account. Test results should be taken as a reference point, and certainly not as the ultimate truth.

But the main advantages of MT5 tester are multi-currency trading, testing on real tick data and cloud optimization (more on that another time). All this allows you to quickly check the trading system, before using the advisor on the real account.

Regards, Michael

ForexTraderPortal.com

Related Posts:

  • How to set up monitoring of your account on MyFxBook
  • Best Forex Robots 2021
    Best Forex Robots 2021
  • Montag Expert Advisor - Profit on Mondays
    Montag Expert Advisor - Profit on Mondays
Posted in: For Traders Tagged: expert advisors, learn to trade, metatrader 5
« PVSRA Trading method - Look at the chart with the Market Maker Eyes Lesson 1 - Believe in Yourself and Change Your Life! »
← PVSRA Trading method - Look at the chart with the Market Maker Eyes
10 Things That Traders Are Afraid Of →

Categories

  • Binary Options
  • Currency Pairs
  • For Traders
  • Forex for Beginners
  • Forex Indicators
  • Forex Robots
  • Forex Trading Psychology
  • Forex Trading Strategies
  • Price Action

Recommended Forex Broker

Have To Look

  • The 5 Steps to becoming a trader
  • How to install a Forex Robot?
  • The whole truth about leverage in Forex
  • What is difference between old and new pips in Forex?
  • Trading Strategies Installation Instructions
  • My VPS choice

    About This Site

    This blog mission is to teach people about Forex trading, including trading strategies, robots (EA), and indicators. We provide newcomers with lessons, reviews, tutorials, and more.

    Join us on Facebook!

    Random Posts

    • The Whole Truth About Leverage in Forex
    • How to trade СFD — try your hands on stocks, metals and commodities
    • Indicator “Candle Temperature” - Precise Levels For Scalping
    • The „Grandmaster“ – win-win Forex strategy
    • How to Trade Ethereum (Cryptoсurrency)

    Copyright © 2023 Forex Trader Portal.

    Omega WordPress Theme by ThemeHall

    Home | Forex Robots Laboratory | For copyright holders | All posts |
    Risk Warning. There is a high level of risk involved when trading leveraged products such as Forex. You should not risk more than you can afford to lose. All posts published on this portal are only recommendatory and all responsibility for decisions lies on readers.
    (c) 2015-2021 All rights reserved