Wednesday, September 24, 2014

Stock Trends RSI +/- pattern analysis

Stock Trends Reports new Profile tab now also includes a pattern analysis of the RSI +/- indicator. This analysis looks to answer questions about a stock's volatility in particular price trends and how weekly price movement provides an indication of probable outcomes for the coming week.

The Stock Trends RSI +/- indicator is a simple binary marker of weekly price performance relative to the benchmark market index. If a stock (all North American trading issues and indexes covered by the Stock Trends analysis) outperforms the benchmark (the S&P 500 for U.S. stocks, the S&P/TSX Composite index for Canadian stocks) the stock is assigned a (+). If it underperforms, it is assigned a (-).

This binary notation of price performance can be a useful framework for an event sample space and inference model. From this we can derive probabilities of certain outcomes and estimate one week returns (%).

Binary events are always interesting. They provide a simple modeled sample space of possible outcomes. The most common example is the flipping of a coin. We know when we flip a fair coin that there is a 50% chance that the outcome will be heads, and an equal 50% chance the outcome will be tails. How does this kind of random event compare to the binary RSI +/- event?

Indeed, there is no surprise when the Stock Trends data reveals that almost all stocks have a near-50% chance of turning up an RSI +/- on any given week. But that is for a sample space that includes all the data. For instance, for IBM the Stock Trends weekly data shows that of the 1,800 weeks covered, 49.5% of observations show an RSI (+) as the weekly indicator. Although some stocks like INTC show a 51.6% probability of a (+) over their history, the mean value across all stocks tends to 50%.

A question that comes from this random-like event becomes quite apparent: how does this probability change under different market characteristics? For example, if a stock is in a Stock Trends Bullish trend, what is the probability of an RSI (+) indicator? We can also ask what is the probability we will see an RSI (+) in the upcoming week if the previous week was also a (+) while the stock is in a Bullish trend?

Using the samples of the stock's data history that match certain patterns of market performance and underperformance we can also derive similar probability statements. Although this analysis operates under the assumption of randomness in market returns, we are looking at the pattern of past performance and estimate the probability of an outcome derived from the event sample space.

In short, like a gambler looking for evidence of an 'unfair' coin that can be capitalized on, we are looking for evidence of a pattern that provides us with better probabilities of a desired outcome than the base probability - which is 50%.

Introduced in last week's editorial, the Stock Trends Reports Profile section is the first element of the Stock Trends Inference Model - the implied population parameters and distribution of like Stock Trends indicator combinations. Also presented was a heatmap that ranks the estimated returns of stocks in an industry group. These elements of the inference model focus on homogeneous patterns across markets and estimates 4-week, 13-week, and 40-week returns for individual stocks. The RSI +/- pattern analysis differs by focusing on patterns with the stock itself, estimating returns based on these internal samples.

Last week AAPL was presented as an example, so we'll use it again for illustrating the RSI +/- pattern analysis. Below we can see the most recent history of the weekly Stock Trends indicators for AAPL.

The current RSI +/- indicator is (-). In this analysis two categorical variables - the Stock Trends trend indicator and the RSI +/- indicator - are inputs. The output is the returns, or percentage change in price, in the week following the observation. What kind of returns (%) do the data show after the observation of a particular pattern of RSI +/- indicators when a stock is labeled in a specific trend?

Here is the current RSI +/- pattern analysis of AAPL:

To repeat, only weeks of the AAPL data showing the same trend indicator as the current trend indicator (strong Bullish) of AAPL are evaluated. Here we are looking to find how the binary RSI +/- probabilities differs from the probabilities we already understand about the aggregate for this and most stocks - a near 50% chance of either a (+) or a (-).

Is the coin somehow biased in a particular trend? If so, to what degree? In this case, given the current RSI +/- patterns for AAPL, what does the data history tell us about how the stock performed subsequently to these patterns when the stock was in the same Bullish trend?

The length of the longest pattern of RSI +/- indicators for each stock analyzed depends on the data available. Here the longest pattern measured is 6-weeks long. However, practical usage of the analysis probably lends itself best to periods of three or four weeks.

In any event, the probabilities for binary outcomes as the pattern extends is of interest in evaluating the quality of the probabilities of the shorter term patterns. In the current AAPL example, the patterns all suggest that the current market underperformance indicated by the (-) will most probably be followed by a market outperformance (+).

Of course, with a given probability of market outperformance we would like to know the returns expectations. If AAPL does outperform the market next week, what is the expected change in price in the coming week? The analysis above defines intervals for the returns expectations for AAPL for each length of the pattern - here from one to six weeks.

This type of short-term price movement analysis can be used in tandem with the longer-term analysis provided by the Stock Trends Inference Model and detailed above the RSI +/- Pattern Analysis on the Profile tab of each Stock Trends Report. It can also be profitably used in short-term options trade setups, something Stock Trends will be able to advise about in the future.

Monday, September 15, 2014

The new Stock Trends Report Profile section

A much longer time in coming than originally planned, the new Stock Trends Report 'Profile' section is installed on the Stock Trends website. Available for most common stocks and exchange traded funds, the Profile report now features the Stock Trends Inference Model introduced in the past year. This analysis attempts to answer the very important question: what return expectations do the Stock Trends Reports imply? 

If you were lucky (?) enough to take statistics in your previous studies, you are probably reasonably versed in statistical inference methodology. You will know about measurements of central tendency and variability. You will know about the 'mean' and 'standard deviation' - both as descriptive statistics of a sample and estimated parameters of a population. And you will also know about sample spaces and probabilities. The Stock Trends Inference Model is an application of these basic statistical methods. 
If you were lucky enough to have avoided a statistics course in school, be assured this model can be explained in very simple and clear language. I've tried to do that in the editorials I have already written about this analysis, but let's summarize here. First, though, a description of methodology  should always be preceded by a statement of the research question and the biases of that question. 
Because the departure point for any model is the assumptions that underlie it, it's important to fully understand the fundamental premises of the Stock Trends Inference Model. The primary assumption is a core tenet of technical analysis - that price patterns repeat themselves. In order to illustrate this and display empirical observations of patterns market technicians must assert that these market price and volume patterns are homogeneous across markets.
What does that mean? It means that a price pattern observed in one market can be meaningfully applied to another market. A moving average crossover, for example, carries significance as much in AAPL as it does in ZNGA. A head-and-shoulders pattern found in the chart of IBM in 1980 a template for one in BAC in 2010 (please note: not factual dates for this example). 
If the application of technical patterns depends upon the premise that these patterns repeat themselves, what use is the observation of an historical pattern if it does not offer some predicative accuracy? It is not enough to be doctrinaire in our answer and provide anecdotal evidence of positive outcomes. We must provide a larger number of outcomes as evidence. 
Of course, no matter how large the sample size of the outcomes we present, the evidence will always be just a portion of the total number of possible outcomes across markets and across time. When we look at possible outcomes we must understand that these outcomes are not based on the market conditions of a particular moment. That would be unsatisfactory and biased. Because we cannot possibly know what will happen in any particular market, we must instead look at the estimating the character of all markets in a given condition. 
In the Stock Trends Inference Model the given condition is represented by the Stock Trends indicator combination. That combination is the aggregate of the Stock Trends trend indicator, the length of time the current trend category (BULLISH or BEARISH), the length of time of the current trend indicator, the 13-week Relative Strength (RSI) indicator value, the 1-week RSI +/- indicator, and the volume indicator. These indicators quantify and categorize market condition in terms of trend and price momentum. Distinct combinations of these indicators qualify particular trends by price momentum and volume characteristics. 
If we look at the current Stock Trends indicator combination of AAPL, for example, we can see that this stock is in the 31st week of being labeled with a (strong) Bullish indicator and that it has been in a BULLISH trend category for 52-weeks. Its 13-week Relative Strength indicator (RSI) value is 109, indicating AAPL has outperformed the S&P 500 index by approximately 9% over the past 13-week period. The current RSI +/- indicator is (+) , indicating the stock outperformed the benchmark market index in the past week. Finally, there is no Unusual Volume indicator, indicating that last week's trading volume was not high or low enough to be assigned either a high or low volume indicator. 
Taken as a composite, these indicators tell us that AAPL is in a relatively solid long-term trend. Given these characteristics of a stock's trend and its length of trend, as well as its price momentum, what does this particular categorization imply about future price movement? 
Of course, we cannot precisely know what is to happen in the future. All we can do is look upon what has happened in the past and make some kind of estimation of what will happen in the future. Using statistical methods we can translate past observations of what has happened into a probability statement about what will happen in the future. The Stock Trends Inference Model attempts to do this. 
Below is the current Stock Trends Inference Model report found under the Profile tab of AAPL-Q. 
The first section shows the Sample distribution plot and estimated returns distribution for three different periods - 4-week, 13-week, and 40-week. In this case the sample - derived from the 30-year history of Stock Trends data - is 616 records of stocks which sported similar Stock Trends Report indicator combinations to the current indicator combination of AAPL. From this sample we are measuring the subsequent price performance over the three different periods. 
Return(%) expectations for Apple $AAPL
Here we ask of this sample: what kind of returns (%) did other stocks have which previously exhibited similar trend and momentum characteristics as defined by the Stock Trends indicator combination? 
The green density plot for each of the three periods is displayed. Each shows how the returns were distributed. This plot shows where most of the returns tended toward (central tendency) as well as the variability of the returns (variance). We are interested in measuring central tendency and variance of the sample because with those statistics we can estimate the average return and variance of the population of all returns associated with this Stock Trends indicator combination. Remember, the population of all returns is much large than this sample size - it includes returns not in this database. It includes future returns - the returns investors are most interested in! 
Using statistical inference methods we can estimate the mean of a population within a certain range, or interval, and we can be certain of that interval to a defined degree. Here our model is 95% certain of the mean intervals. Since we are most concerned about the lowest estimate of the interval, we know that there is only a 2.5% chance that the mean of the population is less than the low end of the interval. 
For the investor it is more meaningful to interpret the mean interval of the population as the estimated return of a portfolio of stocks that have the same Stock Trends indicator combination.  From this theoretical portfolio we can make another important assumption: that returns of randomly chosen samples, when estimated as the portfolio population, will have a normal, bell-shaped distribution. This assumption is an extension of a well-understood probability theory rule: the central limit theorem. 
This assumption - and evidence - of randomness in market returns provides us with a very useful framework for making probability statements about the expected return of a stock. With an estimated population mean, an estimated standard deviation of the distributions we can derive probability statements about observing a return above specific values from a normally distributed sample space. 
In short, the Stock Trends Inference Model translates our samples into an estimated return and gives us the probability that a return will better a given, benchmark return. 
What should that benchmark return be? It's not difficult to see that the base return we should measure against is the return of a randomly selected stock. If we are measuring returns based on the randomness of outcomes of a categorized sample (our Stock Trends indicator combinations), the base return should be the return we would expect if we randomly picked a stock across the broad market. Indeed, any trading system results should be measured against the results of a randomly selected portfolio.  If you can't beat the monkey, why bother? 
The base period random return benchmarks are as follows: 4-week (0%), 13-week (2.19%), and 40-week (6.45%). Each of these returns are the return means of over 500,000 samples taken at random over a 30-year period. Not surprisingly, the annualized return of randomly selected stocks is basically equivalent to long-term market returns - 8%. This sobering fact should remind market timing traders that no matter what analytical framework used, the returns generated by a buy-and-hold approach must be discounted, regardless of what the market actually provided during a particular period. 
I'll be looking at Stock Trends Inference Model analysis in the future, and pointing out ways to turn this analysis into profitable managed trades. Also, I'll be introducing an additional new analysis under the Profile section. It is a pattern recognition analysis that also employs statistical inference. Expect this content addition very soon.  
Another recent content addition to the Stock Trends Reports on the website is the charting application. This is a third-party application provided by Tradingview. For subscribers interested in marking up a chart of a given stock, Try it out! It also provides additional content including current intra-day pricing (15-minute delay), recent news headlines, social media comments from StockTwits, as well as technical and fundamental data.