DLPAL software allows systematic and also discretionary position traders to analyze historical price series and determine the best lookback period in the context of price patterns. In this article the best lookback period is determined in the case of three major ETFs based on the out-of-sample performance of patterns.
Both discretionary and systematic traders would like to know the best lookback period for technical indicators and for specific markets. The lookback period is a free parameter and the performance of indicators depends on its value. For example, the performance of an RSI indicator with a lookback period of 14 days is much different from that with a lookback period of 2 days. Actually, the lookback period usually determines the behavior of the indicator. In the case of the RSI example, for a period equal to 2 days, this indicator works best in mean-reverting markets and for period equal to 14, it works best in trending markets as a momentum indicator.
DLPAL S software offers options for searching for OHLC price patterns with lookback periods between 2 and 9 bars. In this article the search is performed in the in-sample that starts on 01/2000, or on ETF inception if it occurs later, and ends on 12/31/2010. Then, the performance of the patterns is analyzed in the out-of-sample from 01/03/2011 to 12/31/2015. DLPAL generated system code for Amibroker is used and all backtests are done in the platform. All backtests are based on $100K starting capital, fully invested equity and $0.01 per share commission.
Below is a screenshot of the DLPAL S workspace for SPY price patterns in the in-sample.
The option for patterns with lookback periods 2 to 9 bars is marked on the above screenshot by the red rectangle under Search Type. The selection is shown under Type in Search Lines. All other parameters are set as shown. To look for patterns with a different lookback period/ETF, either a new workspace is created or the previous one is edited by removing the search line, selecting a new ETF and/or a new lookback period from Search Types and then creating a new search line.
The in-sample results are usually good by design. It is the out-of-sample performance that matters and also provides useful information about the effect of lookback period.
In this analysis we include results for three ETFs: SPY, TLT and EEM. The last one was included because its out-of-sample price action is more random as opposed to the trending behavior of SPY and TLT. As a result, in-sample patterns in EEM have higher probability of failing in the out-of-sample than those from the other two ETFs. The out-of-sample charts are shown below. Click on a chart to enlarge.
Below is a table of out-of-sample Sharpe values of the price pattern systems with different lookback periods that were identified by DLPAL S in the three ETFs. You may use the horizontal scroll to see all the results.
|ETF||2 Bars||3 Bars||4 Bars||5 Bars||6 Bars||7 Bars||8 Bars||9 Bars||B&H|
Note that the out-of-sample performance of TLT patterns for 5 bars lookback period is higher than that of B&H, with a Sharpe ratio equal to 0.87 versus 0.56. Out-of-sample EEM Sharpe performance is about flat for a 5 bar lookback period versus -0.26 for buy and hold.
The conclusion is that for these particular examples and market conditions, a lookback period of 5 days appears to be the best choice across all three ETFs. Note that the results cannot be generalized from limited observations. However, DLPAL S software provides a framework for performing this type of analysis for different markets and results may offer an edge to both discretionary and systematic traders.
Subscribe via RSS or Email, or follow us on Twitter.
Charting and backtesting program: Amibroker