How to Backtest Day Trading Strategies
<p><a href="https://www.tradingheroes.com/btesting" title="Backtesting Guide" class="pretty-link-keyword"rel="" target="_blank">Backtesting</a> a day trading strategy is different than backtesting a swing trading strategy. This tutorial will help you understand the difference and give you the proven process for backtesting an intraday trading strategy.</p>
<p><strong>To properly backtest a day trading strategy a trader must create a trading plan, choose the right software, monitor trading expenses, test the correct historical periods, and do a detailed analysis of the results. </strong></p>
<p>I'll also share with you how to figure out when it's time to start trading a strategy live, as well as the best tools and resources that you can use to start backtesting.</p>
<p>Now let's get into the details of each aspect of the process.</p>
</p><div>
<p>Table of Contents</p>
<p><a href="https://www.tradingheroes.com/#Create_a_Trading_Plan">Create a Trading Plan</a></p>
<p><a href="https://www.tradingheroes.com/#How_to_Choose_the_Right_Backtesting_Software">How to Choose the Right Backtesting Software</a></p>
<p><a href="https://www.tradingheroes.com/#Manual_or_Automated">Manual or Automated</a></p>
<p><a href="https://www.tradingheroes.com/#The_Market_You_Trade">The Market You Trade</a></p>
<p><a href="https://www.tradingheroes.com/#Cost_of_Software_and_Data">Cost of Software and Data</a></p>
<p><a href="https://www.tradingheroes.com/#Download_as_Much_Historical_Data_as_Possible">Download as Much Historical Data as Possible</a></p>
<p><a href="https://www.tradingheroes.com/#Monitor_Trading_Expenses">Monitor Trading Expenses</a></p>
<p><a href="https://www.tradingheroes.com/#Backtest_at_the_Right_Times">Backtest at the Right Times</a></p>
<p><a href="https://www.tradingheroes.com/#Backtest_Honestly">Backtest Honestly</a></p>
<p><a href="https://www.tradingheroes.com/#Analyze_the_Results">Analyze the Results</a></p>
<p><a href="https://www.tradingheroes.com/#What_to_Avoid_When_Backtesting_Day_Trading_Strategies">What to Avoid When Backtesting Day Trading Strategies</a></p>
<p><a href="https://www.tradingheroes.com/#How_to_Know_When_You_Should_Go_Live_With_a_Strategy">How to Know When You Should Go Live With a Strategy</a></p>
<p><a href="https://www.tradingheroes.com/#How_Day_Trading_Backtesting_is_Different_from_Backtesting_a_Swing_Trading_Strategy">How Day Trading Backtesting is Different from Backtesting a Swing Trading Strategy</a></p>
<p><a href="https://www.tradingheroes.com/#Final_Thoughts">Final Thoughts</a></p>
</div><div> </div><p>
<p><iframe loading="lazy" title="YouTube video player" src="https://www.youtube.com/embed/2YHl98jb4gU" width="840" height="450" frameborder="0" allowfullscreen="allowfullscreen"><span data-mce-type="bookmark">?</span></iframe></p>
<h2>Create a Trading Plan</h2>
<p>The first step in the process is to create a detailed trading plan.</p>
<p>A trading plan must consist of the following:</p>
<ul>
<li>Entry criteria</li>
<li>Risk or lots per trade</li>
<li>Where to place your stop loss</li>
<li>When to exit the trade</li>
<li>How to <a href="https://www.tradingheroes.com/trailing-stop-loss/" target="_blank" rel="noopener">trail your stop loss</a> (if applicable)</li>
</ul>
<p>You should write down your plan on a piece of paper or in a digital file like a Word Document.</p>
<p>Reference this trading plan every time you're about to enter a trade in backtesting.</p>
<p>It will help you remember the rules of a trading strategy and you'll be less likely to make a mistake.</p>
<p>If you want a downloadable trading plan worksheet, you can <a href="https://www.tradingheroes.com/forex-trading-plan-guide/" target="_blank" rel="noopener">get it here</a>.</p>
<h2>How to Choose the Right Backtesting Software</h2>
<p>The next step is to choose the software that you're going to use to backtest with.</p>
<p>There are many options out there, but the best option for you will depend on 3 primary factors.</p>
<h3>Manual or Automated</h3>
<p>Many new traders want to start off with automated backtesting so they can backtest a ton of data very quickly.</p>
<p>That's ideal…in theory.</p>
<p><strong>In reality, most trading strategies cannot be 100% automated because there are certain criteria that rely on trader discretion and not on purely robotic steps.</strong></p>
<p>On top of that, most people don't have the skills to start programing trading systems.</p>
<p>Therefore, it's generally best to start with manual backtesting.</p>
<p>If you really want to do some automated backtesting, find a backtesting platform that allows you to do <a href="https://www.youtube.com/watch?v=IYE2qXvQC1U" target="_blank" rel="noopener">partially automated backtesting</a> and does not require coding.</p>
<p>That will allow you to get started quickly and you can step up to learning to code later.</p>
<p>What if you are already a programmer?</p>
<p>Then you're ahead of the game. Look into using languages like <a href="https://www.python.org/" target="_blank" rel="noopener">Python</a> to automate your backtesting.</p>
<h3>The Market You Trade</h3>
<p>Some software programs are specifically built for certain markets. If you use them to backtest other markets, they might not work as well.</p>
<p>For example, <a href="https://www.amibroker.com/" target="_blank" rel="noopener">Amibroker</a> is great for backtesting automated stock trading strategies. But it's not good for backtesting in Forex.</p>
<p><a href="https://www.tradingheroes.com/forex-tester-5-review/" target="_blank" rel="noopener">Forex Tester</a> works very well for backtesting Forex strategies, but it's not as good for testing strategies in futures trading.</p>
<p>So look for the best software for the market you're going to test.</p>
<h3>Cost of Software and Data</h3>
<p>The great thing about trading is that there are many tools available for big and small budgets.</p>
<p>If you want to keep your costs low, you can go with a free platform like <a href="https://www.tradingheroes.com/tag/metatrader-5-tutorials/" target="_blank" rel="noopener">MetaTrader 5</a>. It usually provides a decent amount of historical data and the software is easy to use.</p>
<p><em>On the downside, these free programs are very bare bones and you won't get features like detailed reporting, which can save you a lot of time.</em></p>
<p>To get more time-saving features, you can use platforms like <a href="https://www.tradingheroes.com/best-forex-backtesting-manual-software/" target="_blank" rel="noopener">NakedMarkets</a> or <a href="https://www.multicharts.com/" target="_blank" rel="noopener">MultiCharts</a>.</p>
<p><strong>In my opinion, it's best to pay up for a professional quality software package. They save you a lot of time and time is the only thing you cannot get back.</strong></p>
<p>Now let's talk about data…</p>
<p>Sometimes these backtesting platforms don't provide enough historical data. Luckily, you can download the data separately and upload it to your backtesting platform.</p>
<p>Amibroker allows you to download data from free websites like Yahoo Finance.</p>
<p>Vendors like <a href="https://www.tickdata.com/" target="_blank" rel="noopener">TickData</a> provide data files that aren't cheap, but they have complete data for most major markets.</p>
<h2>Download as Much Historical Data as Possible</h2>
<p>Once you've chosen the best software for your backtesting, now it's time to download historical data for your backtesting.</p>
<p>Many backtesting software packages have the ability to download data from their own data source, or upload third party data files.</p>
<p>Regardless of where you get the data from, you want to have as much clean data as possible.</p>
<p>This is because you should backtest in different market conditions, such as:</p>
<ul>
<li>High volatility</li>
<li>Low volatility</li>
<li>Strongly trending markets</li>
<li>Weakly trending markets</li>
<li>Ranging markets</li>
<li>Unusual news events</li>
</ul>
<p>The 2 highlighted areas on this AUDCAD chart illustrate very different market conditions.</p>
<p>Area 1 is a strongly trending market and your strategy could perform very differently in that market, compared to area 2, where the market is ranging.</p>
<p>So it's important to have as many historical scenarios as possible.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-1022568" src="https://www.tradingheroes.com/wp-content/uploads/AUDCAD_2023-01-24_22-26-01.png" alt="AUDCAD chart" width="1833" height="890" srcset="https://www.tradingheroes.com/wp-content/uploads/AUDCAD_2023-01-24_22-26-01.png 1833w, https://www.tradingheroes.com/wp-content/uploads/AUDCAD_2023-01-24_22-26-01-768×373.png 768w, https://www.tradingheroes.com/wp-content/uploads/AUDCAD_2023-01-24_22-26-01-1536×746.png 1536w" sizes="(max-width: 1833px) 100vw, 1833px" /></p>
<p>There's a common myth on the internet that if a trading strategy is profitable after 100 trades, then it will work in live trading.</p>
<p><strong>That's simply not true and 100 trades is certainly not enough to backtest a day trading strategy.</strong></p>
<p>If you only backtest 100 trades, that usually won't cover more than a few weeks.</p>
<p>Here's a video that demonstrates why 100 trades isn't enough.</p>
<p><iframe loading="lazy" title="YouTube video player" src="https://www.youtube.com/embed/NU6NYkKhksU" width="840" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><strong>In reality, you should test as many trades as possible.</strong></p>
<p>But it isn't feasible to backtest ALL of the trades in your historical data because there are so many potential trades with a day trading strategy.</p>
<p><em>The solution is to pick specific time periods that represent the different types of market conditions mentioned above.</em></p>
<p>If this is your first time backtesting a day trading strategy, then I would suggest picking a few 2-week periods to start testing.</p>
<p>Start with one 2-week period in a volatile market, one period in a ranging market and a third 2-week period in a random market.</p>
<p>This will give you a good feel for if a trading strategy has an advantage or not.</p>
<p>You should obviously do more testing than that later, but backtesting a day trading strategy can be overwhelming.</p>
<p>Starting with a few short periods will help you get into the flow and understand the process.</p>
<p><strong>Backtesting in a few short historical periods will also save you time. </strong></p>
<p>You could spend a lot of time backtesting several months in the same market condition, like a trending market.</p>
<p>That wouldn't help because you won't know how the system performed in a ranging market.</p>
<p><em>When you test short periods in different market conditions, that will give you a better idea of how your strategy will work overall. </em></p>
<h2>Monitor Trading Expenses</h2>
<p>There are 3 types of trading expenses that should be taken into account when backtesting a day trading strategy.</p>
<ol>
<li>Spread</li>
<li>Slippage</li>
<li>Commission</li>
</ol>
<p><strong>Whenever you're backtesting a day trading strategy, it's very important to take these factors into account because they can have a big effect on the profit of every trade.</strong></p>
<p>For example, if you scalp in Forex, your biggest winners may be only 10 pips. Let's say that the average spread in the currency pair you're testing is 2 pips. If you don't factor in the spread in backtesting, then your strategy will be at least 20% less profitable than your backtesting shows.</p>
<p>There are different ways that you can factor in the expenses in a trade.</p>
<p>If you use a spreadsheet to record your backtesting trades, then you can add a column for expenses. Be sure to use accurate expenses if you use this method.</p>
<p>You can get spread and commission numbers from your broker.</p>
<p>To get approximate slippage numbers, take a few trades in a demo account at your broker, if possible. Be sure to take several demo trades at the time you'll be trading to get a good slippage estimate.</p>
<p>An easier way to estimate your trading expenses is to use backtesting software.</p>
<p>Many professional backtesting software solutions factor in the spread automatically and allow you to manually set slippage and commission in the settings of the software.</p>
<p>For example, <a href="https://www.tradingheroes.com/best-forex-backtesting-manual-software/" target="_blank" rel="noopener">NakedMarkets</a> shows the current spread at the bottom of the screen.</p>
<p><img decoding="async" loading="lazy" class="size-full wp-image-1022564 aligncenter" src="https://www.tradingheroes.com/wp-content/uploads/spread.png" alt="Trading spread" width="376" height="119" /></p>
<p>This spread changes on every candle, according to the spread data in the file.</p>
<p>In the settings for each symbol, you can also set the spread and commission manually.</p>
<p><img decoding="async" loading="lazy" class="size-full wp-image-1022565 aligncenter" src="https://www.tradingheroes.com/wp-content/uploads/spread-commission.png" alt="Spread and commmission" width="420" height="434" /></p>
<p>This is just one example, but other software packages have similar features.</p>
<p>Regardless of which method you use for backtesting, factoring in your trading expenses is vital in backtesting day trading strategies.</p>
<h2>Backtest at the Right Times</h2>
<p>Another important factor to take into consideration is the hours of the day that you take trades in backtesting.</p>
<p><strong>Track the times that you'll actually be trading. If you take trades in backtesting that are outside of your normal trading hours, then your backtesting results will be inaccurate.</strong></p>
<p>For example, if you take backtesting trades during the time you're normally sleeping, then there's no way that you'll be able to take those trades in real life.</p>
<p><strong>The easiest way to track market times is to mark the market hours on your chart while you're backtesting.</strong></p>
<p>Many backtesting platforms have the ability to do this.</p>
<p>For example, in NakedMarkets, you can add an indicator that marks the major Forex market open and close times.</p>
<p><img decoding="async" loading="lazy" class="size-full wp-image-1022573 aligncenter" src="https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.49.00-PM.png" alt="Trading sessions indicator" width="597" height="384" /></p>
<p>If you use MetaTrader 5 to do <a href="https://www.tradingheroes.com/how-to-do-mt5-manual-backtesting/" target="_blank" rel="noopener">manual backtesting</a>, I've come up with a <a href="https://www.tradingheroes.com/mt5-eas-indicators-scripts/time-marker-alert-mt5/" target="_blank" rel="noopener">simple custom indicator</a> that allows you to mark specific times on your chart.</p>
<p>This indicator will mark the same time every day on the 1 hour chart or lower. It can also send you alerts to your phone when the time period starts.</p>
<p>In this example, the marker shows the London open.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-1022572" src="https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.38.59-PM.png" alt="Time marker for MT5" width="1284" height="690" srcset="https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.38.59-PM.png 1284w, https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.38.59-PM-768×413.png 768w" sizes="(max-width: 1284px) 100vw, 1284px" /></p>
<h2>Backtest Honestly</h2>
<p>Now that you have a trading plan, backtesting software, data, and you know when to backtest, it's time to get to work testing.</p>
<p>If you backtest manually, do not move your chart forward to quickly. You don't want to pass a trading entry and have future information about a trade.</p>
<p>Even worse, some people will move their chart forward a few candles to see how a trade would have worked out, before taking a trade.</p>
<p>When you're doing manual backtesting, do your best to simulate real trading conditions and don't overshoot your entry.</p>
<p>Automated backtesting can also have pitfalls.</p>
<p>When you're optimizing an automated trading strategy, optimize your strategy on one set of data. But do more testing on other sets of data to be sure that you haven't over optimized your strategy to the test data.</p>
<p>For example, if you optimized your strategy in the years 1999, 2004 and 2019. You should also test your strategy in other years like 2003, 2008 and 2013.</p>
<p><em>Don't optimize over all years in your data file. </em></p>
<p>Obviously, you should test during more years than that, but that's just a small example of how you shouldn't optimize your strategy on your entire data set.</p>
<h2>Analyze the Results</h2>
<p>Once you've completed your first round of backtesting, now it's time to review the results.</p>
<p>If you're using a spreadsheet, then calculate the vital statistics on your spreadsheet.</p>
<ul>
<li>Win %</li>
<li><a href="https://www.tradingheroes.com/how-to-calculate-maximum-drawdown-in-excel/" target="_blank" rel="noopener">Maximum drawdown</a></li>
<li>Maximum number of losers in a row</li>
<li>Short win %</li>
<li>Long win %</li>
<li>Average Win / Average Loss</li>
<li>Graph of your performance</li>
</ul>
<p>It can take some time to compile this information, but it's worth it.</p>
<p>If you use backtesting software that has built-in reporting, you'll save a lot of time because you won't have to manually calculate your statistics.</p>
<p>Here's a sample of the stats that NakedMarkets provides.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-1022575" src="https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.45.46-PM.png" alt="Backtesting stats" width="1107" height="604" srcset="https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.45.46-PM.png 1107w, https://www.tradingheroes.com/wp-content/uploads/Screen-Shot-2023-01-25-at-7.45.46-PM-768×419.png 768w" sizes="(max-width: 1107px) 100vw, 1107px" /></p>
<h2>What to Avoid When Backtesting Day Trading Strategies</h2>
<p>There are 2 main things to avoid when backtesting intraday strategies.</p>
<p><strong>First, avoid trading software that doesn't have many years of backtesting data.</strong></p>
<p>I love using <a href="https://www.tradingheroes.com/tag/tradingview-tutorials/" target="_blank" rel="noopener">TradingView</a> as a trading and charting platform.</p>
<p>But as this is being written, it does <em>not</em> have enough historical data to do a proper backtest for a day trading strategy.</p>
<p>This may change in the future, but as it currently stands, they only provide a couple of years of data.</p>
<p><strong>Second, avoid very complex trading strategies. They are hard to test and it can be easy to miss entry criteria when taking trades.</strong></p>
<p>Complex strategies also have a lot of moving parts and those types of strategies tend to break down over time.</p>
<p>In general, the simplest trading strategies tend to work the best because the take advantage of basic principles of market dynamics.</p>
<p>If you avoid these 2 common mistakes, you'll have a much higher probability of finding a strategy that works over the long haul.</p>
<h2>How to Know When You Should Go Live With a Strategy</h2>
<p>Once you've tested a strategy, you might be wondering if it's good enough to trade live.</p>
<p><strong>That's going to be a personal decision and it's up to you to determine if the strategy meets your goals and if you have enough confidence in it to risk real money. </strong></p>
<p>If you currently don't have a fully tested trading strategy, then it can be a good idea to start trading a strategy that has an edge, until you find a strategy that has better performance.</p>
<p><em>Even if a strategy doesn't have a huge return, you can use the power of compounding to build up your account while you test other strategies. </em></p>
<p>But again, the final decision is up to you.</p>
<h2>How Day Trading Backtesting is Different from Backtesting a Swing Trading Strategy</h2>
<p>Backtesting a day trading strategy requires much more focus and diligence.</p>
<p>Expenses will have a much bigger impact on the profitability of a day trading strategy.</p>
<p>With a swing trading strategy, you don't have to worry about expenses as much and there is a larger margin for error.</p>
<p>However, there is a much higher potential to build your account quickly with a day trading strategy.</p>
<p>You could do both.</p>
<p>But you have to match your trading timeframe to your personality. Some people cannot handle day trading and others find swing trading too slow.</p>
<p>So take your personality into account and don't only try to make money quickly with day trading.</p>
<h2>Final Thoughts</h2>
<p><strong>Backtesting is the best way to prove that a trading strategy has an edge. </strong></p>
<p>If a strategy worked in the past, then it's very likely to work in the future.</p>
<p>Of course there's no guarantee that the strategy will work in the future. But if it <em>never</em> worked in the past, then there's no way that it will start magically working in the future.</p>
<p>I see way too many new traders take random trading strategies from the internet and start trading them with real money.</p>
<p><em>Just because someone on YouTube speaks with confidence and tells you that a trading strategy works, does not mean that it will actually work.</em></p>
<p><strong>On top of that, the strategy may work for them, but it may not be a good fit with your trading personality.</strong></p>
<p>So backtest everything for yourself. If you get positive results, then open a demo account or small live account and <a href="https://www.tradingheroes.com/forex-forward-testing-guide/" target="_blank" rel="noopener">forward test</a> the strategy.</p>
<p>If that goes well and you have confidence in the strategy, then you can start trading with your full account.</p>
<p><em>That is how you backtest a day trading strategy properly.</em></p>
<p>The post <a rel="nofollow" href="https://www.tradingheroes.com/backtest-day-trading-strategies/">How to Backtest Day Trading Strategies</a> appeared first on <a rel="nofollow" href="https://www.tradingheroes.com">Trading Heroes</a>.</p>
Leave a Comment