CSS Bar Classification Scheme
This idea was originally inspired by Jeff Pietsch-now hailing from the great new site ETF Prophet http://etfprophet.com/-who showed me an early variant of a “pattern-match” to predict SPY returns. I have also learned some of the nuances of specific technical pattern classification from Rob Hanna’s Quantifiable Edges newsletter who is the expert on this subject matter: http://quantifiableedges.blogspot.com/ . One of the weaknesses (and also a strength) of technical indicators is that they fail to account for unique patterns. They effectively treat situations as broad “concepts”- a good point made by Michael at MarketSci:http://marketsci.wordpress.com/2010/08/03/indicators-as-concepts/ . An RSI2 for example classifies the last 2 days as either being “overbought” or “oversold” by looking at the closing price changes only. But this fails to capture some valuable information: 1) what were the highs and lows over the past few days and where is the close in relation to these points? 2) what was the return today versus yesterday? 3) is today’s range large or smaller than yesterday? Using an indicator like DV2 which considers the close in relation to the high to low range helps to complement the RSI2 in this sense, but it does not permit the full range of permutations to be analyzed.
What we need to do is to analyze the bar pattern–or pattern of the daily high, low, and close to dig deeper into more accurate classification. That said, overly specific classification amounts to walking a fine line—the more specific we are about given setup the more rare the condition, and the less likely it will repeat out of sample. However, we may end up finding some truly strong edges that will add value to a more general framework or to indicators like RSI2. Many traders like to look at candlesticks which tend to carry strange names and specific patterns have a near mythical status with traders. I prefer to classify things as objectively as possible, and I believe that it is possible to construct a simpler and more robust framework. For this first version, we will keep things extremely simple. Every bar can be classified as having the following three qualities:
1) Bar Size: the size of a bar can be considered as the High minus the Low in relation to past measures of the high minus the low. This can be normalized using a ranking over the past 252 days: a) big bar- when the high minus low is in the 75th percentile or greater b) normal bar- when the high minus low is in the 26th to 74th percentile c) small bar- the high minus low is in the 25th percentile or lower. In total there are 3 different bar size types.
2) Range: the range of the bar can be measured two different ways– as the close in relation to the high to low range or the open in relation to the high to low range. to avoid complexity in our first examples, and also because the close is more important we will only consider the closing range. The closing range can be measured using a stochastic formula- (close- low)/(high-low). This closing range can be normalized using a ranking over the past 252 days: a) top of range- when the close relative to the high to low range is in the 90th percentile or greater b) upper range-when the close relative to the high to low range is in the 50th to 90th percentile c) lower range- when the close relative to the high to low range is in the11th to 49th percentile d) bottom of range- when the close relative to the high to low range is in the 10th percentile. There are 4 possible range patterns.
3) Price Change: This is the change in price from the current close to yesterday’s close. This can be normalized using a ranking over the past 252 days. For the price change we will use four quartiles: a) big up- when the price change is in the top quartile (>75th) b) up- when the price change is in the 2nd quartile (50th -74th) c) down- when the price change is in the 3rd quartile (26th to 49th) c) big down- when the price change is in the bottom quartile (<25th). There are 4 possible price change patterns.
The following classification scheme is simple and objective, and the process of normalization makes for easy comparisons across time. Counting the number of combinations leaves us with 3x4x4= 48 different possible bar patterns. This is manageable enough on its own, but tends to get dicey as you look at multiple days, for example a 3-day patter can have 48x48x48= 110,592 patterns! In practice, there are strong correlations between pattern components- a big price change, a high or low closing range and big bar size are often related, which accounts for the correlation between mean-reversion indicators. This will limit the number of practical combinations. However, there are distinctions and divergence here that make sense and thus it is worth considering all possible combinations. Nonetheless, this method is best handle by genetic algorithm. We will post an example soon.