The Important Steps of Forward Testing in Trading - XAUBOT

The Important Steps of Forward Testing in Trading

What is forward testing?

Algorithmic trading plays such an important role in all financial markets, including forex, that such markets are basically defined by algorithmic trading. Why do we say that? Well, it’s simple. Just look at the following statistics: 

Across ALL financial markets, an average of 70% of all trading activity is automated and done with the help of algorithmic trading. 

Of course this number can be higher for some markets such as the market of equities where as much as 80% of trading is algorithmic. But since our focus is mainly on the foreign exchange market, the figure for forex stands to be over 70%. 

Want to make it simpler? This means at least 3 out of 4 trades that are made in the forex market are done so using algo trading. 

But a better question would be, why are we telling you this? We are trying to emphasize the sheer importance of algo trading. The focus of this article, however, is going to be on how you can optimize your trading algorithm. But not just any method of optimization. We are going to focus on the importance of forward testing on trading algorithm optimization. 

 

 

What is Forward Testing?

 

Imagine you have a trading algorithm. For the purpose of this article, it doesn’t really matter how you got it. Let’s just imagine your friend gave you one! 

Now, you should not just go ahead and use this trading algorithm that your friend has given, should you? Of course not. Why? Because as much as you might trust your friend or the algorithm that you have, you still have to test it first. 

This is where we are going to talk about forward testing, which of course as the name suggests is literally a form of testing. 

But what kind of testing exactly? To understand forward testing better, it is a good idea to first compare it with backtesting. This is because most traders are already familiar with or at least have heard of backtesting. 

In backtesting, we will expose a trading algorithm to past market data, i.e. “back” in backtesting. As you can probably guess, we do this so we can see how the algorithm performs when it is exposed to those historical data. This is all of course done in a simulated environment. 

On the other hand, in forward testing we expose our trading algorithm not to past market data but to live and current market data. 

The aim in forward testing is to see how the algorithm would perform with real time price movements and even future forming movements. 

This was forward testing in a nutshell. In the following sections, let’s together go through the exact difference between forward testing and backtesting, how forward testing takes place, and whether you can do it on your own. And don’t worry, you can! 

 

 

The Difference Between Backtesting and Forward Testing

 

Perhaps the best way to conceptualize backtesting and forward testing is to think of them as two sides of the same coin. 

Let’s call this coin the coin of testing. One side would be forward testing and the other side backtesting. This is because they do share fundamental similarities. They are only different in the way they are executed and their ultimate aim. 

 

 

Why is Forward Testing Essential?

 

If you are a smart trader, you would definitely be wondering by this point why we even need forward testing. Isn’t backtesting enough to fully test our algorithm? Here we want to answer this exact question and see why forward testing is essential. 

  1. Validating Robustness

If an algorithm does well in backtesting it does not mean that it will 100% do well with live data. So, forward testing gives you a way to validate the robustness of the trading algorithm. 

  1. Accounting for Market Dynamics

The data used in backtesting does not always reflect the dynamic nature of the market where things can change instantly. Therefore, with the help of live data in forward testing, you can put your algorithm to test against market dynamics. 

  1. Measuring Execution Accuracy

You can think of backtesting as a mere simulation and think of forward testing as real trading but in a controlled manner. So in this way, you can use forward testing to tweak the small features of the trading process. 

  1. Identifying Behavioral Bias

While you do not carry out the backtesting, in forward testing you as the trader can take over and execute the trades yourself. In this way you can account for your behavioral bias and see how it affects the trading process. 

 

 

How to Conduct Forward Testing

 

Let’s recap on what we learned so far. Up to this point, we learned what forward testing is, we learned its differences with backtesting, and we also learned why it is essential to use forward testing for our trading algorithm. 

Now, it is time to see how you can actually conduct forward testing yourself. 

 

Use a Demo Account (or a live account)

 

The best way to conduct forward testing is to use a demo account. As you know, a demo account or demo trading will provide you with virtual currency and real time market data. Well, there is a slight delay between when the data is registered in the market and fed into the demo account. But it is basically real time market data. 

Most brokers offer demo trading that are also compatible with most trading platforms such as MetaTrader 4. So, if you want to keep things safe, the best option is to start with the demo account. 

However, you can also use a live account. But this is really risky and you should only do it if you have enough experience and expertise as a trader. 

Also, if you have indeed decided to use a live account, make sure to start with really small amounts of money just to test things out first. 

 

Allocate a Testing Period

 

This is a very important step and also a key difference between backtesting and forward testing. 

As we said before, backtesting is really quick. You just set up the parameters and choose the time frame and that’s it. It is over quickly and you receive a report. 

But in forward testing since we are dealing with real time market data the testing period is obviously real time as well. 

So make sure to allocate enough time for reliable results. This also depends on various factors such as the market conditions, the highs and lows, etc. 

But typically, you would at least need to do it for 1 month or more. 

 

 

Define Performance Metrics

 

The next step is to define the metrics or factors that you are testing. 

What are you testing exactly? What aspect of your algorithm? 

The performance metrics can be any of the following: 

  • Profitability: Net profit or loss over the testing period.
  • Win Rate: Percentage of winning trades.
  • Drawdown: Maximum equity loss during the period.
  • Risk-to-Reward Ratio: Average risk taken for each unit of reward.
  • Trade Frequency: Number of trades executed within the period.
  • Etc

 

 

Simulate Realistic Costs

 

If you are using a demo account for forward testing, then you need to incorporate costs that would normally occur in live accounts. 

This means costs such as spreads, the broker commissions, any rates that are related to swaps, etc. 

This is because sometimes these extra costs can be so substantial that they have a huge impact on the net profit earned. So don’t forget about them in forward testing or you might just be surprised later. 

 

Monitor Performance

 

So far it was really easy, right? Well, this step is even easier. Now it is time to sit back and let the algorithm do what it does – trade! 

At this point you only need to track and monitor the performance of the algorithm during the forward testing time period. 

 

Analyze Results

 

When forward testing is over, it is time to analyze the results. 

One of the best practices is to compare the results you have obtained with the results obtained through backtesting. 

In this way, you can see just how real to the simulation results your algorithm has performed. If it closes, then it shows the robustness of your algorithm under real market conditions. 

But if there are serious differences, then you need to make some serious adjustments as well and repeat the process of testing. 

 

 

Common Mistakes to Avoid in Forward Testing

 

Before we leave you to it, let’s go through some mistakes that you should definitely avoid in the process of forward testing. 

  1. Short Testing Periods: you can’t just run the algorithm for a couple of days and use that for evaluation. Very obviously that would not be dependable or reliable. The longer you let your algorithm and forward testing process go, the better and more reliable the results. 
  2. Ignoring Market Context: every algorithm can have a specialty. If your algorithm is highly adapted to high frequency trading and volatile conditions, perhaps it would not really perform well when the market is moving sideways and it has very little volatility. So take into account the context and conditions of the market at the time of testing. 
  3. Skipping Cost Simulations: nobody likes negative surprises, right? Especially if they are related to money. So if you do not want to be surprised by various costs and commissions, do not ignore these miscellaneous costs in the process of forward testing. 
  4. Neglecting Execution Factors: if you are using a demo account for forward testing, it can differ from using a live account in factors such as latency and therefore slippage. So you need to have an understanding that a demo account will never be 100% the same as a live account. 

 

Conclusion

 

Forward testing is an extremely essential part of the testing process for any trading algorithm. It goes hand in hand with backtesting and lets you confirm the results of the algorithm. 

Whereas in backtesting we subject the algorithm to historical market data, in forward testing the data that is used is real time market data. To do this, you can use a demo account or a live account with small amounts of money. 

Then the process of trading is run for a determined period of time. After that you can compare the results with the results of the backtesting process and hopefully you can confirm that your algorithm has performed as well as it had during backtesting. 

Leave a Reply

Your email address will not be published. Required fields are marked *

three × 3 =

×