How Long Should You Backtest a Trading System?

<p>This is a common question that new traders ask, but there isn't one simple answer. In this post, I'll break down how to figure out exactly how long you should test a trading system.</p>
<p><strong>As a general rule, you should backtest a trading system for as long as it takes for you to have confidence to trade the system with real money. </strong></p>
<p><em>In other words, it depends on a few different factors.</em></p>
<p>Let's dive into what you should know about <a href="https://www.tradingheroes.com/btesting" title="Backtesting Guide" class="pretty-link-keyword"rel="" target="_blank">backtesting</a> and how long you should do it.</p>
<p>It all begins with defining our terms…</p>
<h2>The Definition of “Long”</h2>
<p>The first thing that I have to clarify is the what is meant by “long” because there can be some confusion here.</p>
<p>There are different interpretations of this word, so here are the definitions that I'm going to cover in this post.</p>
<ul>
<li>Length of time spent backtesting</li>
<li>Amount of historical data used</li>
<li>Number of backtested trades</li>
</ul>
<p>When we look at the 3 definitions, we realize that “long” can mean entirely different things.</p>
<p>So I'll address each one to clear up any confusion, and show you which ones really matter.</p>
<h2>Length of Time Spent Backtesting</h2>
<p><strong>Like with many things in life, the amount of time that you spend on backtesting isn't an indicator of the quality of work that was done during that time.</strong></p>
<p>Therefore, the idea that you have to spend a minimum amount of time backtesting is not useful.</p>
<p>In an extreme example, you could backtest for 4 months, but only have 2 backtested trades.</p>
<p>That wouldn't tell you anything about how profitable the trading strategy is.</p>
<p><strong>So when you're looking for a minimum amount of backtesting to prove a trading strategy, you need to throw out the idea that the act of backtesting should be done for a certain period of time.</strong></p>
<h2>Amount of Historical Data Used</h2>
<figure aria-describedby="caption-attachment-1022242"><img decoding="async" loading="lazy" class="wp-image-1022242 size-full" src="https://www.tradingheroes.com/wp-content/uploads/backtesting-screen.png" alt="backtesting screen " width="1200" height="601" srcset="https://www.tradingheroes.com/wp-content/uploads/backtesting-screen.png 1200w, https://www.tradingheroes.com/wp-content/uploads/backtesting-screen-768×385.png 768w" sizes="(max-width: 1200px) 100vw, 1200px" /><figcaption>Image: <a href="https://www.tradingheroes.com/best-forex-backtesting-manual-software/">NakedMarkets</a></figcaption></figure>
<p>Another way to measure the amount of backtesting a trader does is to track the amount of historical data used in the test.</p>
<p>In other words, you could backtest a system over 3 years or 30 years of historical data.</p>
<p><em>Obviously, more data is better.</em></p>
<p><strong>When you have a lot of historical data, you'll know how your trading strategy would have performed over many different market cycles.</strong></p>
<p>This is very important in finding out if you have robust trading strategy or if your trading strategy only works in certain market conditions.</p>
<p>For example, if your trading strategy wasn't tested during the 2007 financial crisis, you wouldn't know what would happen in an extremely volatile market.</p>
<p>So while the amount of historical data you use to do your backtest is an important factor in determining a valid test, there's one more things that you have to consider…</p>
<h2>How Many Times Should You Backtest a Trading Strategy?</h2>
<p>That brings me to the final backtesting measurement…</p>
<p><strong>The most useful metric to look at is the total number of backtested trades.</strong></p>
<p>If you tested a trading strategy over 300 trades, that would be a lot more reliable than if you tested the strategy over only 10 trades.</p>
<p>That's pretty obvious.</p>
<p><em>But what's not so obvious is the minimum number of trades that will give you confidence in the system you're testing.</em></p>
<p>There can be a gray area where you're not sure if you have enough trades in your test.</p>
<p>When you're in doubt, zoom out and consider the bigger picture.</p>
<h3>Think about a day trading strategy…</h3>
<p>If you only test 100 trades, then you might only have 2-3 months of data. That's not nearly enough to get a good idea of if the strategy is reliable or not.</p>
<p>Even 500 trades might not be enough.</p>
<p>You don't necessarily have to test every single day for the past 20 years, but you should have samples from different market conditions.</p>
<p>There should be trades from:</p>
<ul>
<li>Volatile markets</li>
<li>Quiet markets</li>
<li>Trending markets</li>
<li>News shock markets</li>
</ul>
<p>The more trades you have from each of these types of markets, the more confidence you'll have in your strategy.</p>
<h3>Now consider a swing trading strategy…</h3>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-1022248" src="https://www.tradingheroes.com/wp-content/uploads/backtesting-trades-example.png" alt="Backtesting trades screenshot" width="1079" height="390" srcset="https://www.tradingheroes.com/wp-content/uploads/backtesting-trades-example.png 1079w, https://www.tradingheroes.com/wp-content/uploads/backtesting-trades-example-768×278.png 768w" sizes="(max-width: 1079px) 100vw, 1079px" /></p>
<p>With a swing trading strategy, you might have a relatively low number of trades in your backtest.</p>
<p>For example, let's say that you backtested the <a href="https://www.tradingheroes.com/rsi-divergence-explained/" target="_blank" rel="noopener">RSI Divergence trading strategy</a> on the daily chart of the EURUSD.</p>
<p>With this trading strategy, you might only get 25 trades over 20 years.</p>
<p>So does that mean that you throw out the strategy, even if it was profitable?</p>
<p>Of course not.</p>
<p>But you might not have enough confidence in it to trade it live.</p>
<p><strong>In that case, it's important to forward test the strategy until you get to a point where you're confident that the strategy works.</strong></p>
<p><a href="https://www.tradingheroes.com/forex-forward-testing-guide/" target="_blank" rel="noopener">Forward testing</a> will take some time.</p>
<p>But it's the best way to gain confidence, when you have only have small amount of data.</p>
<p>You could also test the strategy on other markets and timeframes.</p>
<p>If you find other instances where the strategy works, that can also give you more validation that the strategy is reliable.</p>
<h2>The 100 Trades Myth</h2>
<p>There's a meme on the internet that you need a minimum of 100 backtested trades to prove that a strategy works.</p>
<p><em>That's simply not true.</em></p>
<p>100 trades is nice number of trades to have.</p>
<p>But again, the number of trades you have in a test only tells you part of the story.</p>
<p>Here's what you need to know about the 100 trades myth…</p>
<p><iframe loading="lazy" title="YouTube video player" src="https://www.youtube.com/embed/NU6NYkKhksU" width="840" height="450" frameborder="0" allowfullscreen="allowfullscreen"><span data-mce-type="bookmark">?</span></iframe></p>
<p><strong>The biggest issue with setting a blanket minimum number of trades is that it doesn't take into account the timeframe being tested and the behavior of the specific market.</strong></p>
<p>Some statistics professors might tell you that you need a minimum of 30 trades to prove that a trading strategy works.</p>
<p>Others will say 500 trades.</p>
<p>In all fairness, that's a good place to start, from a strictly mathematical point of view.</p>
<p>But in reality, there's a lot of variability between markets, market cycles and trading systems.</p>
<p>What worked in one market or cycle probably won't work in another.</p>
<p>That's why you should be conscious of all of the factors, not just the number of trades alone.</p>
<h2>Final Thoughts</h2>
<p>So that's what you need to know about how long you should backtest.</p>
<p>There isn't one simple answer to this question.</p>
<p><strong>On the surface, you could say that you should have as many backtested trades as possible, over as long a historical period as possible. </strong></p>
<p>But you have to take into account the nuances.</p>
<p><em>You need to consider your trading strategy, your goals and your level of confidence in your testing.</em></p>
<p>Not to worry though, once you start backtesting, you'll get a feel for what's reliable and what's not.</p>
<p>Just get started.</p>
<p>Learn more about backtesting <a href="https://www.tradingheroes.com/category/backtesting/" target="_blank" rel="noopener">in these posts</a>.</p>
<p>The post <a rel="nofollow" href="https://www.tradingheroes.com/how-long-should-you-backtest/">How Long Should You Backtest a Trading System?</a> appeared first on <a rel="nofollow" href="https://www.tradingheroes.com">Trading Heroes</a>.</p>

Leave a Comment

Leave a Reply

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