What are the benefits of a robust trading system? Let me start with a practical example. I guess this situation is not unfamiliar to you:
You get an excellent trading algo idea. You draft the code in the editor of your favorite trading platform, and you see an equity curve with positive expectancy. It’s great, but you want better. You add optimizable parameters and keep tuning and tweaking the system until you get a smooth equity curve. Once you get the perfect slope, you declare your algo ready.
It is time to trade. You enable live trading execution on your platform and lean back to enjoy the show. Do I need to continue? You can probably guess the end of the story. In the best case, your trading strategy will show some good trades, but once the market sentiment changes, your strategy will start losing money. Perhaps you think the current drawdown is worse than the backtested average, so you turn off the strategy execution.
Table of Contents
What is robustness testing?
In the context of algorithmic trading, robustness testing refers to evaluating a trading strategy’s performance and reliability under different market conditions and scenarios. This testing is typically done to ensure that a trading strategy is reliable, stable, and able to generate consistent returns over time, regardless of market conditions.
In general, robustness testing is essential in developing and evaluating any trading strategy, as it helps identify potential weaknesses or vulnerabilities that may impact the strategy’s performance and reliability. By thoroughly testing a strategy’s robustness, traders can gain confidence in its ability to generate consistent returns and make informed decisions about when and how to use it in their trading activities.
How we build a robust trading system?
To increase the robustness of your trading strategies, follow our 4 steps framework to make your them more bulletproof. Add these steps to your trading algorithm development or system evaluation procedure, and you will experience their positive effect in less than 6 months’ time.
Step 1 – Use a maximum of 4 optimizable input parameters
Beginner system developers like to add optimizable parameters to each quantifiable property of an algo. Maybe this seems like a good idea, but the practice shows that each parameter exponentially increases your strategy’s chance of being over-optimized.
I recommend using a maximum of 4 input parameters when optimizing and developing your algo.
Step 2 – Do not tweak
Most algo strategy developers dream of a linear and upwards-pointing equity curve. They draft their initial algo idea, add some optimizable input parameters and run an optimized backtest. The resulting system performance chart looks alright, but it could be better. What’s next? They start adding extra rules:
- What if this strategy does not trade on certain days of the week?
- Skipping every other trade.
- Change the exponential moving average to simple MA.
- Adding a new exit type which will help remove a couple of terrible trades from the year 2022 backtest
Do not add tweaking optimization cycles to your development process! You will not only cheat yourself but also mislead your risk management calculation. Never change the strategy logic after running a backtest.
My rule of thumb: feel free to implement every trading decision rule, inclusive or exclusive conditions, at the beginning of the system development. After you carry out a backtest, consider the trading algo is sealed. Does the strategy look bad? Discard it and try again.
Step 3 – Check the performance of your algo on different markets and timeframes
Would you trust an algo that works only on 120 minutes Soybean bars but nowhere else? Wouldn’t it be ensuring to know that your trading strategy produces fine results in multiple sectors and timeframes? So why don’t you check it?
Take your strategy and optimize it on as many different markets as possible. For the optimization, use the same range for input parameters you used when developing the original system.
Does it seem like a lot of work? Try it with Tradesq. You can automatize the whole process with Tradesq’s Smart Backtesting. On the Schedule Smart Backtesting page, you
- Insert your EasyLanguage algo code.
- Choose your target markets (currently, 40+ futures markets are supported across multiple sectors)
- Choose timeframes.
- Specify your input parameters’ optimization ranges
When you click the Backtest Strategy button, Tradesq’s whole cloud infrastructure will come into motion. In a couple of hours, a backtesting report will be generated:
The report will clearly show the markets and timeframes where your strategy produced good results. The definition of a sound system can be configured under the Settings / Screening Parameters menu.
The above sample shows backtesting results of a system that is showing promising results using Currency, Energy, Grain, Index, and Metal markets. Is this an ensuring result? Partially, maybe. We want to see a strong presence of good results in a sector: multiple markets of the same sector should show hits across more than one timeframes.
Step 4 – Forward test your algo
Forward testing (or Out of Sample Testing) is probably the most crucial step of the robustness check. You can be the most cautious system developer using the best practices, but only the future will tell how stable is the system you have built.
To pass the forward testing phase of your strategy evaluation, we recommend waiting for at least a 3 months period after the algo is developed. Once the forward testing period is over, backtest your strategy using the input parameters you chose at development time. Take a closer look at the end of the equity cure, which was built since you started the forward testing. What does it look like? Does it show similar characteristics to the previous parts?
This is another area where Tradesq can help. There are two ways your strategy can be forward-tested in Tradesq:
- Automatically: when you use the Smart Backtesting feature to test your algo various markets and timeframe, Tradesq’s algorithm will automatically pick up the best outcomes and please them to forward testing.
- Manually: you can add an algo for Forward testing using the Schedule Forward Test function in the Forward Testing menu.
Once a strategy is added to the list of Forward Tested strategies, Tradesq will keep monitoring its performance week by week. As the Forward Testing goes on, the performance chart of your algo will be updated weekly:
And that is not all. You continuously track the performance of all Forward Tested strategies in Tradesq, including thousands built by the community and your private ones.
Robustness testing is vital in algorithmic trading because it helps ensure that a trading algorithm will perform well in various market conditions. This is critical because the financial markets are constantly changing and can be volatile, and an algorithm that is not robust may produce inaccurate or suboptimal results under certain circumstances. By thoroughly testing an algorithm for robustness, traders can have confidence that it will function properly and make profitable trades even in challenging market environments. In addition, robustness testing can help identify and fix potential vulnerabilities or weaknesses in an algorithm, which can help prevent costly mistakes or losses. Overall, robustness testing is a vital part of the algorithmic trading process and helps ensure the success and reliability of trading systems.