For Business

Backtesting & Statistics

How to Backtest in the MetaTrader Strategy Tester

The Strategy Tester is the panel in MetaTrader that runs a coded rule over old bars and lists every trade, opened with Ctrl+R and driven by seven settings. This paper shows you the tester in five lines; the idea as a treadmill with the coded rule running in place while the old bars roll under it; the Settings tab filled in for the example rule and week from the backtesting paper; the deals list it returns, five trades and minus 567 dollars at one lot on real bars; and the modelling setting, which decides how finely the bars are replayed and can change the answer.

Difficulty
Beginner
Reading time
5 min
Pages
8
Reviewed by
Saman Rahbar

This paper is locked

Read it in the browser and keep the PDF with Premium, or buy this one paper.

The Strategy Tester in five lines

The Strategy Tester is the panel in MetaTrader that runs a coded rule over old bars for you, opened with Ctrl+R. It needs the rule written as an Expert Advisor, which is a small program the platform can run, a symbol, a timeframe and two dates. It gives back every trade in a list, a graph of the account balance through the test, and a page of totals. The one setting that changes the answer is modelling, how finely the old bars are replayed. Coded and run on the same week as the hand test, the example rule from the earlier paper gives the same answer, a loss of 567 dollars at one lot, where a lot is 100,000 units of the currency, in about a second.

A treadmill

Picture a treadmill. The runner is the rule, coded as an Expert Advisor, and it stays in one place; the belt is the old bars, rolling under it from the start date to the end date; the console sets the dates and the speed. The rule never sees ahead of the belt, which is the same honesty the card gave the hand test, and it never gets tired, which is why a year of hourly bars takes a minute rather than a month of evenings. It also never writes a note beside a trade, and the treadmill will run a bad rule as smoothly as a good one.

This paper is locked