1. Home
  2. Docs
  3. DLPAL DQ
  4. Back-testing strategies

Back-testing strategies

To back-test a strategy select the strategy line from the scan or Signal Tracking View results by clicking on it and hit the F3 key or click the right mouse button and then select Back-test.

The program extracts from the results the information for the data file needed to perform the back-test. You may change the data file to apply to a back-test by selecting a new directory where the new file can be found, provided that the name of that file is the same with that shown in the results. The back-test range is indicated in the back-test window.

All backtests by default are point tests per share/contract. Click OK for a point back-test. The results show details about each trade and the values of several performance parameters.

The profit-target and stop-loss can be changed when backtesting for studying the sensitivity of the strategy to various exit levels. Click “Change Target and Stop” to activate this option:

blank

Only the profit target and stop-loss can be changed with this option. Trade entry choice “Trade on” and exit type C (%, pts or NC) cannot be changed.

Strategies added to Signal Tracking can be back-tested by selecting a strategy from the list first, then clicking on View and following the process described above. 

The back-testing function is useful for determining past entry/exit days and other useful performance parameters of strategies. As more data is added to a historical data file, the back-testing function can be used to monitor the performance of strategies previously discovered. This can be done either from the original results file or from Signal Tracking.

Note: the back-testing function takes into account any open position in calculating the performance parameters. The scan function do not consider open positions and thus the performance parameter values may differ slightly in such case. The back-testing function skips any multiple signals.

Back-testing single strategies on a portfolio of securities

To back-test a strategy on a portfolio of securities select the strategy line from scan results by clicking on it and then select Back-test Portfolio.

blank

You may change the target directory to that of the data files of the portfolio. The original data file of the strategy is not necessary to be stored in the selected directory. The profit-target and stop-loss can be changed for studying the sensitivity of the strategy to various exit levels. Click “Change Target and Stop” to activate this option.

blank

Below is an example of a portfolio backtest of a single strategy for UNH on all Dow-30 stocks. The results show details for each security in the portfolio and the values of several important performance parameters along with an equity graph.

blank

The Win Rate on the top indicates the percentage of securities in the portfolio that generated a profit factor > 1 (equivalent to a positive expectation). The portfolio win rate is the number of all winning trades in all securities divided by the total number of trades. This parameter must be as high as possible for strategy significance.

The expectancy parameter for each security is equal the average trade and given by the equation: Expectancy = Average win x w – Average loss x (1 – w) = (Sum wins – Sum losses)/N, where w is the win rate and N the total number of trades for the particular security.

The payoff ratio is the ratio of average win divided by average loss. All other parameters have their usual interpretation. The Back-Test Portfolio results for single strategies are always based on a points test.

Warning

When using this test, all instruments in the results must have the same point value. If that is not the case, you can save the results for each instrument separately and repeat the test.

Portfolio Backtest

The Portfolio Backtest option offers a quick way of back-testing all strategies in the results on a portfolio of securities, instead of using the Back-test Portfolio tool for each one separately. The Portfolio Backtest results are based on a points test. The win rate P, the profit factor PF and the total number of trades of the portfolio backtest are displayed under P, PF and Trades columns. The portfolio expectancy is displayed under the Port E column which replaces the Last Date column of the original results and the Win Rate, which is the proportion of data files with positive profit factor in the portfolio, is displayed under the First Date column of the original results. Click on Portfolio Backtest from the scan results options and select the target directory where the portfolio data files are saved.

blank

The profit-target and stop-loss cannot be changed when using this tool. Click OK to back-test. The results will change for each security to those of the portfolio backtest results.

blank

In the above results, three strategies show a negative expectation and a profit factor less than 1. The best results are for UNH with portfolio win rate of 73.33%. These results must be interpreted in a proper context. Usually, several portfolio backtests results must be performed along with robustness analysis and tests on multiple symbols to minimize data-mining bias and curve-fitting.

Portfolio Backtest Sort

The sorting option is especially useful when there are many strategies in the results, hundreds or even thousands. To activate the option, mark “Portfolio backtest sort” and set the parameter values, as shown in the example below.

blank

Below are the results. Only those strategies that satisfy the sorting criteria are listed.

blank

Warnings

-The portfolio backtest results can be saved but the Trades column will reflect the portfolio backtest results. If you would like to save results from a portfolio backtest, you can use the Test Strategies tool to recover the results for the date range you desire and then save the marked strategies. To restore the original results, you can re-open the results form. If the results were from the last scan, you can use the Restore Last results option.
-When using this test, all instruments in the results must have the same point value. If that is not the case, you can save the results for each instrument and repeat the test.