Discussing the article: "Robustness Testing on Expert Advisors"

 

Check out the new article: Robustness Testing on Expert Advisors.

In strategy development, there are many intricate details to consider, many of which are not highlighted for beginner traders. As a result, many traders, myself included, have had to learn these lessons the hard way. This article is based on my observations of common pitfalls that most beginner traders encounter when developing strategies on MQL5. It will offer a range of tips, tricks, and examples to help identify the disqualification of an EA and test the robustness of our own EAs in an easy-to-implement way. The goal is to educate readers, helping them avoid future scams when purchasing EAs as well as preventing mistakes in their own strategy development.

Firstly, you should create a version of your EA without the leverage compounding effect, as this could distort the results and place undue importance on the tail of the sample set.

Here are the main metrics to look for:

  1. Profit Factor: The profit factor should be greater than 1, with a reasonable range between 1.2 and 1.5. A profit factor lower than 1.2 may indicate that the strategy is not profitable enough, while a value higher than 1.5 could suggest that the sample size is too small or that trading costs were not accounted for. While this doesn't necessarily mean your strategy is fraudulent, you should be cautious if the results seem unrealistic.

  2. Maximum Equity Drawdown: Focus on the maximum equity drawdown rather than the absolute drawdown, as it reflects the potential risk rather than the risk that has already occurred. The maximum equity drawdown should be at least 10% lower than your personal maximum drawdown tolerance. If it's too low, you can consider increasing your EA’s risk, and if it's too high, you may need to reassess the risk profile of your strategy.

  3. LR Correlation: The linear regression (LR) correlation measures the consistency of your equity curve. A correlation of greater than 0.9 signals that the returns were relatively consistent throughout the testing period. This helps ensure that the strategy doesn't have large fluctuations and that the performance is steady.

  4. Win Rate and Trade Volume for Long and Short Positions: If your EA trades both long and short positions, ensure that their win rates and trade volumes are reasonably similar. A significant discrepancy between the two could signal an imbalance in the strategy that may need to be addressed.

While other metrics are also important, these three are the primary factors to be aware of when assessing the reliability of your EA during in-sample and out-of-sample testing.

example backtest

Author: Zhuo Kai Chen

 
MetaQuotes:

Check out the new article: Robustness Testing on Expert Advisors.

Author: Zhuo Kai Chen

Great article zhuo.
 
Omega J Msigwa #:
Great article zhuo.

Thank you!

 

Great job Zhuo and a good article to read.  At point 4 which reads:

4. Win Rate and Trade Volume for Long and Short Positions: If your EA trades both long and short positions, ensure that their win rates and trade volumes are reasonably similar.

A significant discrepancy between the two could signal an imbalance in the strategy that may need to be addressed.

Is this true for a bias trend direction ( buy trend dominates longer period than sell trend. Should the EA still have a similar win rates and trade volumes ?

 
Daniel Opoku #:

Great job Zhuo and a good article to read.  At point 4 which reads:

4. Win Rate and Trade Volume for Long and Short Positions: If your EA trades both long and short positions, ensure that their win rates and trade volumes are reasonably similar.

A significant discrepancy between the two could signal an imbalance in the strategy that may need to be addressed.

Is this true for a bias trend direction ( buy trend dominates longer period than sell trend. Should the EA still have a similar win rates and trade volumes ?

Thanks for the comments. 

It depends on how much beta is involved in the strategy. If a single-asset strategy trades higher timeframe and higher holding period, it will be likely that the strategy result will have some bias following the macro trend. That's why I advised people to trade strategies that trades large amount(volume) by trading higher frequency or diversifying a strategy on multiple uncorrelated assets. If a strategy's merit doesn't involve assumptions of the trend bias, having symmetric rules for both buy and sell, then it should be expected to have similar trade amount and win-rate over a large sample size.

Of course, strategies can have bias assumptions on the trend like some long-only strategies for indices. For this type of strategy, traders should only trade one side cuz their assumptions were already that the other direction won't work as well as this direction. Just make sure to not use too many bias assumptions and it should be fine.

 
Thanks Zhuo for taking the time with this , opened my eyes to using Python to analyse the results , Main challenge for me is was it the ea or the trend responsible for the results :) , Probably should include a probability metric
 
linfo2 #:
Thanks Zhuo for taking the time with this , opened my eyes to using Python to analyse the results , Main challenge for me is was it the ea or the trend responsible for the results :) , Probably should include a probability metric

Consider doing a monthly return correlation check between the traded market and your backtest result. If the correlation is high like above 0.2, then it may suggest the market trend is responsible for a big part of your backtest result, which is not desired.

 

Is there a Chinese version?

If you have one, please submit a Chinese version as well.

If not, do you need a Chinese translation from the MQL5 documentation group?

 
Xiangdong Guo #:

Is there a Chinese version?

If you have one, please submit a Chinese version as well.

If not, do you need a Chinese translation from the MQL5 documentation group?

Hello, all my translations are done by MQL5 automatically. The Chinese version usually roll out a few months after submission, though the exact date of publish is not clear.