Volume Based Indicator Analysis Part 4

This will be my final post on volume-based stock market indicators, at least for a little while.

If you recall, in my previous post I formed a weighted average of the previous 15 days of (daily volume), and used that to predict relative price performance over the next week.  The results were encouraging, but not great.  In this post I’m going look at some variations on the original.  I’ll put the original graph of results here for easy reference:

The first variation is to use an equal weighting of the most recent 6 days, rather than a decreasing weighting of the previous 15 days.

This really isn’t much different.  There’s a little more weight on positions 1 and 2 than previously, but position 0 had fewer occurrences.  It’s interesting that a drastic change like going from decreasing weight with age to constant weight has so little effect on results.

Next, we’ll go back to scaled weights, but put the maximum weight on the day prior to the most recent, rather than the most recent day.

What stands out in this graph isn’t so much the performance of ranks 0-2, but rather the performance of ranks 26-27.  They’ve been suppressed, leaving rank 28 with many occurrences all by itself.  Still, there isn’t much here to say this would make a good indicator.

The next graph is a difference between the 3 day average and the 10 day average.  I.e., each is a constant-weight average of the most recent N days, and we subtract them.

Now, that is an improvement!  Rank 0 occurrences improved from the 350-375 range to over 450.  Rank 28 occurrences improved from about 325 to over 400.

Those are pretty strong signals.  It seems that volume suddenly increasing or decreasing over a couple of  days is correlated with stock price moving up over the next week.

The correlation is probably strong enough that you could trade on it, but it’s also possible to use this as one metric of a more involved indicator, which is one of the things I’m working on.

Volume Based Indicator Analysis Part 3

This post continues my analysis of volume-based stock market indicators.

If you recall, in my previous posts I formed a weighted average of (daily volume * percent price change from previous day).  In this post I’m going to analyze a similar indicator, but instead use a weighted average of just (daily volume).  I.e., the percent price change from the previous day will not be factored into this indicator.

The methodology followed is also the same as that used before, which I’ll describe briefly here.

We want to know if the daily trading volume of a stock gives any indication of its price movement over the next five trading days.  For each of 29 stocks, I calculate the weighted average of the previous 15 days of trading volume.  The most recent trading day gets the most weight, trading volume from 15 days prior gets the least weight.  This weighted average is then divided by a simple average of the previous 15 days of trading volume.

The division by a simple average of the trading volume normalizes the indicator across stocks, some of which may have naturally high or low trading volumes.  The use of a weighted average allows us to determine if volume has been increasing or decreasing over the previous 15 trading days.

The 29 stocks are then ranked, each day, based on the volume indicator calculated above.  A rank of 0 means it had the highest indicator value, a rank of 28 means it had the lowest indicator value.  Finally, a count is kept for each rank as to how many days a stock with that rank had the best performance over the next five trading days.

By looking at a graph of these rank counts, we should be able to tell if this volume-based indicator has any probabilistic predictive value for stock price change over the next five trading days.  I.e., if there is no predictive value, each rank would be expected to have approximately the same number of best performance occurrences over the next five days (with a little randomness thrown in).  If there is some predictive value, one or more ranks should have unusually high (or low) counts.

A graph of this indicator is shown below:

That looks pretty random.  There does, however, seems to be a correlation between having a rank of 0 (increasing trading volume) and relative price performance over the next five trading days.  As before, with the indicator based on (daily volume * percent price change from previous day), the correlation isn’t strong, but there is one.

I do want to emphasize that what’s being tracked here is ‘relative’ price performance over the next five trading days, not absolute price performance.  That means if all of the stocks went down over the next five trading days, the best relative performance is the stock with the smallest price decrease.  But if one or more of the stocks went up, the best relative performance is the stock with the greatest price increase.

We’ll look at variations of this indicator in future posts to see if we can do better, but this is encouraging for a first attempt.

 

 

 

Volume Based Indicator Analysis Part 2

As I mentioned in my earlier post, there were several places where I could have taken one of a number of directions, but I chose just one and moved on. In this post I’m going to go over some of the other experiments I’ve performed since then.
Recall that I used a weighting factor, where the most recent date received a maximum weight (15), and the weight for each date prior to that was decremented by one per day. This choice of weights was arbitrary, so in this post I’m going to discuss the effect of choosing these weights differently.
The alternative weight schemes I’m going to cover are:

  1. Multiplying each weight by a constant for earlier dates
  2. Choosing a date other than the most recent one to have the maximum weight
  3. Use a constant weight for the most recent N dates, then multiply the weight by a factor for earlier dates
  4. Use a constant weight for the most recent N dates, and don’t use any earlier dates

I actually tested quite a few more, but so far these have the best results so I’ll only go over them.

 

This was the result of the original experiment that we’re trying to beat:

volume_based_indicator_nov_2016_

For the first experiment, the best result came from multiplying the weighting factor by 0.85 each day. So the most recent date was weighted 15, one day prior was 12.75, two days prior was 10.8375, etc. Here’s a graph of the results:

volume_based_indicator_dec_2016_g0-85

We’ll compare this directly to the earlier results later, but if you’re thinking it’s not much different, you’re right. There’s a slightly higher peak, but for the most part the results are very similar.
Moving on to the second experiment, choosing a date other than the most recent, it turns out that slightly better results are obtained by giving the largest weight to two days ago, rather than the most recent date:

volume_based_indicator_dec_2016_2nddaypeak

For the third experiment, we’ll use the same maximum weight for the most recent three days, then apply a multiplication factor of 0.7 for each day prior to that:

volume_based_indicator_dec_2016_const3days

Finally, for the fourth experiment, we’ll weight the four most recent days equally, and assign a zero weight to all days prior to that:

volume_based_indicator_dec_2016_4days

And now for the denouement, we’ll look at all five of them together:

volume_based_indicator_dec_2016_all

The most surprising thing to me about the above graph is how consistent it is. I spent a lot of time tweaking each of these and kept just the one that did the best. And they each have pretty much the same distribution.
I’ll probably spend time looking for other ways to tweak this to see if I can find significantly better results, but it’s possible this is all the stock prediction information content there is in the combination of trading volume multiplied by percentage change.

Volume Based Indicator Analysis

In this post I’ll share part of an analysis I’m doing on a volume based indicator.

I wanted to examine the correlation between a stock’s volume and its price movement.  From published research (e.g. this paper) I knew there should be a relationship.  Before using it in a model though I do my own analysis to understand not only what the relationship is, but also how reliably it holds up over time.

There are many ways to construct a volume based indicator, for this post I’m only going to cover one.

For a given stock, the indicator is based on the past 15 days’ worth of trading data.  For each day, the stock’s trading volume is multiplied by the percentage change in its closing price from the previous day.  E.g., if 10,000 shares of the stock was traded on a given day, and it’s price went down 1% that day, the contribution from that day would be 10,000 * -0.01 = -100.  If 10,000 shares of the stock were traded on a given day, and it went up 0.5% that day, the contribution from that day would be 10,000 * 0.005 = 50.  This value is calculated for each of the past 15 trading days.

We now have 15 values for the stock.  Each value is multiplied by a weighting factor.  The weighting factor is 15 for the prior day’s value, 14 for two days prior, etc.  The weighting factor for 15 days prior is simply 1.  We then take all of the weighted values that are positive (i.e., values from days the stock went up) and sum them together.  We do the same for all of the values that are negative (i.e., values from days the stock went down).

We’re down to two values, a positive value (from days the stock closed up) and a negative value (from days the stock closed down).  Either value could also be zero, of course, if the stock went up or down all 15 days.  The indicator for this stock on this particular day is the sum of these two values divided by the difference between these two values:

indicator = (positive value + negative value) / (positive value – negative value)

Don’t forget that the ‘negative value’ is, indeed, negative, so the above equation corresponds to the difference between two numbers divided by the sum of the same two numbers.  Thus, the indicator as constructed will always have a value between -1 (if the stock went down all 15 days) and +1 (if the stock went up all 15 days).

There are multiple ways to use an indicator, for this post I’ll examine how it’s related to the relative change in stock price over the next 5 trading days.

I chose 29 dow stocks for this analysis, for the years 2005 – 2015.  To be precise, I used the stocks that were members of the Dow Jones Industrial Average at the beginning of 2016, excluding Visa (which wasn’t publicly traded for the entire time frame).

We want to see if high or low values of the indicator, relative to the other stocks, are correlated with outperforming those other stocks over the next five trading days.

For each day over the study period, we rank the 29 stocks according to their indicator values (0 through 28, with 0 being the stock with the highest indicator value).  We then find the three stocks that had the best performance over the following five days.  We look up the indicator rank of those three stocks, and increment counters corresponding to their ranks.  For example, if the three stocks that did the best over the next five days have ranks 0, 26, and 28, we increment counters corresponding to ranks 0, 26, and 28.  There are a total of 29 counters, one for each rank position.

The above process is repeated for every day over the eleven year period.  A graph of the results is below:

volume_based_indicator_nov_2016_

The correlation between volume indicator rank and stock price change over the following five days certainly doesn’t look strong from this graph. It appears to be random numbers centered on 275.  In fact, if the samples were evenly distributed each rank would have occurred 286 times.

If you look carefully, though, you’ll see that ranks 24 through 28 are all above 300 occurrences.  It turns out that, over this study period, stocks that had one of the five lowest indicator ranks were 14% more likely to be among the best three performers over the following five trading days.  I.e., more down volume is somewhat correlated with a greater likelihood of the stock outperforming over the following week.

That isn’t a very strong indicator.  There are better indicators out there, and it’s possible that with different parameters there’s a volume based indicator better than this one, too.  There’s a good enough correlation with this indicator though that it’s worth investigating further.

An important question is whether or not this is a reliable indicator.  I won’t put the details here, but it turns out that over the study period this indicator was correlated to stock price change about 50% of the years.  I.e., in five of the years this volume indicator was correlated to a rise in the stock price over the next five trading days (2005, 2007, 2008, 2009, 2013), and in the other six years it was not.  Again, that isn’t great, but with some research it may be possible to find a better version of this indicator.  It’s interesting to note that it was not correlated to outperformance in most of the bull market years after the 2008 crash.

There were a lot of places in this post where I said I would include results from just one of many possible ways to analyze volume / stock price change correlation.  In future posts I’ll analyze variations of the volume indicator presented here.

 

Model A Indicator Output Meanings

A couple of people have asked me what the Model A outputs (‘Positive’ and ‘Negative’), mean.

A ‘Positive’ output means that in the past, under similar conditions, there was a greater than average chance that the market would be higher in 4 weeks than it was when the output was made.

A ‘Negative’ output means that in the past, under similar conditions, the model did not provide any statistically useful information about market direction over the next 4 weeks.