Backtest and optimalizáció -

Backtest and optimalizáció

Strategy Tester

To get the most out of your expert advisor, you'll need to backtest and optimize your strategy using MetaTrader's Strategy Tester. While forward testing on a demo account is essential, backtesting allows you to simulate trading over a long period of time in just minutes. And with the optimization feature, you can find out which settings performed best over a selected historical chart period.

There is considerable debate over the accuracy of MetaTrader's strategy tester. At best, backtesting offers only a close approximation of how trades would be executed in real-time. But it's the only tool available to rapidly test any strategy over a wide range of trading situations, and one that you should learn how to use well.

MetaTrader -

Forward test

Forward testing simply means to open a demo account and run the expert advisor in real time to see how it works and performs. Forward testing is essential, however it takes a lot of time before you get a good idea about how the expert advisor will perform. Instead of relying solely on forward testing, we can also perform backtests.


Backtesting is a key component of effective trading-system development. It is accomplished by reconstructing, with historical data, trades that would have occurred in the past using rules defined by a given strategy. The result offers statistics that can be used to gauge the effectiveness of the strategy. Using this data, traders can optimize and improve their strategies, find any technical or theoretical flaws, and gain confidence in their strategy before applying it to the real markets. The underlying theory is that any strategy that worked well in the past is likely to work well in the future, and conversely, any strategy that performed poorly in the past is likely to perform poorly in the future.

MetaTrader -


Metatrader’s Strategy Tester allows you to optimize your expert advisor to find the most profitable settings for the multitude of possible input variable combinations. You can optimize an expert advisor on a specific chart for a specific time period to find out which input values produced the highest returns and lowest drawdown.

However, it is important to remember that you should not over-optimize. You may get amazing results with a specific input combination, but because the values are so constrained, you probably won’t see results like that in the future. When optimizing an expert advisor, remember to use your head and think about why you are getting the results you are. Was it from one huge winner that you are unlikely to see in the future? Or did it win many times, making it a plausible trade setup for the future.

MetaTrader -

History Data

Before you start backtesting you will need to make sure you have complete and accurate history data set up. If your modeling quality is less than 90% or you see mismatched chart errors, then your data is insufficient.