×

Authorised and Regulated: SCB

MT4 Walk Forward Optimisation

Business team investment trading do this deal on a stock exchange. People working in the office.

Technology has revolutionized the world of trading. Among the most wonderful things made possible by technological advancements is the availability of powerful platforms like MetaTrader 4 (MT4) that not only make forex trading fast and smooth, but also allow us to make highly informed decisions. Programs like Expert Advisor (EA) allow analytical and trading processes to be automated, so that we can react instantly to market movements and continue to trade even while we sleep!

While there are amazing benefits of such software, there are some limitations as well. We need to be super cautious that the software we’re using to make trade decisions will hold up into the future. This is where Walk Forward Testing comes into play. Walk forward testing is essentially a way of simulating real market data and moving along with the markets live, without actually investing any real money. This so-called virtual trading, or simulation of actual trading, helps us better understand the movements of markets. Since, this follows the software’s logic in a live market, it helps us determine whether the software will keep its performance in future.

Walk Forward Optimisation for MT4

Walk Forward Optimisation, or WFO, is critical to ensure that the optimized EA continues to deliver the best results going ahead. Based on the parameters you have set or the EA strategy itself, the EA may not prove truly profitable or may even result in you losing money. Hence, the need for walk forward optimisation – a way of checking whether EA would be profitable in future.

Walk forward optimisation involves forward testing using in-sample data (or data that was used during optimization) for a specific time window in a series of data. The rest of the data is known as out-of-sample data (or data that was not used during optimisation). The out-of-sample data is tested against the recorded results. This process of optimisation and forward testing is repeated by shifting the work window gradually into the future.

In case the average performance of EA in these forward tests is acceptable, you can rest assured that the EA is robust and will be profitable in a live trading environment in the future. Otherwise, you will need to change one or more of the parameters you had previously set to ensure the long-term profitability of EA.

Having said that, MetaTrader does not provide any in-built tool for walk forward testing. While this is not available on MT4, the tool provided on MT5 (MetaTrader Strategy Tester) is rudimentary at best. In the absence of a powerful tool, walk forward testing and optimisation can be complex, confusing, tedious and time-consuming.

The Workaround

The good news is that one can find a Walk Forward Analyser, or software that automates walk forward optimisation for MT4 and generates reports of testing analysis within minutes. Most of these tools are paid ones and you’ll need to choose one that is robust and reliable. This can be done by reading reviews of the most popular ones and determining which suits you the most.

The walk forward analyser you choose should be easy to use and based on the MetaTrader Strategy Tester. You will need to provide the settings and testing parameters. The tool should be capable of performing forward testing multiple times over weeks, months and years. On completion of the walk forward testing, you would receive a report with results of the analysis and optimisation.

So, while we rely heavily on technology to make predictions and trade profitably, it is essential to periodically test the performance of the EA as well as the parameters we have set, to ensure continued profitability in the longer term.

Disclaimer

If you liked this educational article, please consult our Risk Disclosure Notice before starting to trade. Trading leveraged products involves a high level of risk. You may lose more than your invested capital.