Many traders think that price action analysis is the visual examination of charts for patterns of price and indicators. But the visual examination of charts mostly projects cognitive biases on price action and facilitates selection of conditions that support subjective views about market direction. There are many objective ways of analyzing price action and in this article I present one of them based on the identification of short-term price patterns. An analysis of recent price action in SPY is presented.
On the daily chart below, the most recent bar as of the close of last Friday will be called bar # 0 and the bar before that bar # 1 and so forth. The first part of this analysis is concerned with the price action of the 6 more recent bars on the charts, namely bar #0 to bar #5:
The price pattern of the last 6 days (bars) is enclosed in the shaded rectangle on the chart above. We would like to know if this pattern has a strong bias in either direction, long or short.
For the purpose of this analysis the scan function of Price Action Lab will be used. The scan workspace will use data from SPY inception to 05/31/2013 to analyze the price action of the last 6 bars. The workspace settings are shown below:
A small profit target and stop-loss of 2% were used for the analysis to avoid as much as possible fitting the price action patterns the program identifies to the historical data. On the workspace we basically instruct Price Action Lab to look for 6-bar patterns in SPY data that are profitable either for long or for short positions with the defined exit levels. The results are shown below:
In the screenshot above, P is the win rate, P1 is the 1-Bar win rate, Trades is the number of historical trades, CL is the maximum number of consecutive losers and Target and Stop the values of the profit target and stop-loss. C indicates the type of target and stop-loss, in this case it is a percentage added to the entry price, shown under Trade On as the open of next bar.
PAL identified 9 distinct 6-bar patterns in the data, 7 long and 2 short. The short patterns have only one trade each and they are outnumbered by the long patterns.
Portfolio backtest
A portfolio backtest on comparable securities will provide an indication of the significance of the above patterns. Below are the results from a portfolio backtest of each of the 9 patterns on all DOW-30 stocks:
The P1 column has been replaced by PF, the portfolio profit factor and the first and last day columns by the portfolio expectation and win rate (percentage of profitable tests). It may be seen that 5 of the long patterns maintain a positive expectation as opposed to none from the short patterns.
5-bar patterns
The same analysis may be repeated for 5-bar patterns. Below are the Price Action Lab results using the same workspace as above but marking 5-Bars in Pattern Length Selection Option:
In this case, 15 distinct patterns were found, 11 long and 4 short. The highlighted pattern with index 2 is interesting because it has a high win rate P equal to 70.91% on a sample of 55 trades. Below is a backtest of this pattern:
The backtest performance looks attractive. below is a robustness analysis of the same patterns for various target and stop-loss pairs (ratio of 1 is maintained):
The Robustness Index (RI) is much above 50% and that along with the shape of the two curved indicate a fairly robust pattern that was not fitted to the data. A portfolio backtest of this pattern only on all DOW-30 stocks with data since 01/2000 produced the following results:
It may be seen that this pattern was profitable in 22 out of the 30 DOW stocks but the portfolio profit factor of 1.05 is not very impressive.
An analysis for 4 and 3-bar patterns will confirm the results of the 6 and 5-bar patterns with long signals outnumbering short by a wide margin. The analysis stops when the trader is satisfied that he determined what not to do and in this case the message is that there is still a long bias. Very rarely one can decide what to do based on analysis. Traders who use technical analysis to decide what to do are mostly doomed to fail because only rarely the probability of rejecting the null hypothesis that the analysis provides no edge is high enough to guarantee success.
More information about using PAL for quant day and position trading can be found in this post.
Disclosure: no relevant position at the time of this post and no plans to initiate any positions within the next 72 hours..
Charting program: Amibroker (Charts created with AmiBroker – advanced charting and technical analysis software. http://www.amibroker.com/)