Thursday, April 30, 2009

Building a Stock Market Indicator of Momentum and Strength

Over the years, I've developed quite a few indicators, some of which (such as my volatility-adjusted pivot/target levels and the Demand/Supply measure) I post daily to Twitter.

The process of developing an indicator generally begins with an idea and then proceeds with various riffs on that idea. Sometimes this playing with data leads to something unique; most of the time, it doesn't.

I thought I'd share my first approximation of an indicator. This tracks the 20-day average of the number of "strong days" in the S&P 500 Index (SPY). To qualify as a strong day, a day must close in the top half of its daily trading range.

So this is a kind of oscillator to see if stocks tend to finish the day above, below, or at the day's estimate of value (average trading price).

When the number of strong days is above 10 and rising, we have a market in which traders are tending to buy intraday weakness. When we have the number of strong days below 10 and falling, we have a market in which traders are tending to sell intraday strength.

My hypothesis is that momentum leads price: the proportion of strong days should peak and trough ahead of price, as rising and falling markets lose steam and, as moves age, fail to pick up intraday buyers/sellers.

In future posts, we'll take a look at tweaking this very simple measure.

5/1/09 - Thanks to the Total Negative Slack blog for programming the above indicator.


Daniel said...

Quick thoughts, Brett..

What if a market closes at the high of the day, or the low of the day. Very extreme. Is that still just a 1? Is that one Strong day? Or one Weak day? And would a day that closed just above the mid-line (marginal) also count as 1? One strong or weak day?

You see what I'm getting at. The raw # of strong vs. weak days might disguise a preponderance of marginal days in one total and a preponderance of very pronounced days in the other.

Also, should such an indicator be weighted? Older strength or weakness is less significant.

Lastly, isnt this what the crude but useful Chaikin Money Flow (CMF) Indicator tries to measure?

Momentum definitely leads price-- ah yes, but how to quantify this great truth w precision? In other words, how does one attain the Holy Grail?


Matthew C. said...

"Momentum leads price".


Definitely food for thought. And I agree with it. For myself, I look for high $TICK and strong "power moves" up to tell me when the market is likely to continue to move upwards.

dgroch said...

I like the sound of this indicator.

Sounds like it will simply show the relatationship between the number of buying or selling "composite" days over a moving sample size.

Taking into account "composite" days is something Dalton talks about in Mind Over Markets.

Peter said...

Hi Dr. Brett. Long time reader, first comment... For what it's worth I built your "strong day" indicator using an open source trading system called genius trader. You can see it over at:

I'm not sure how much I like the GT stuff but thought I'd give it a try since it's free and accessible.

Thanks for all you do.

hcarstens said...

Great idea!

You might combine w/ your pivots to augment their predictive power at extremes.


Joshua said...

Dr. Brett,

This looks very similar to an indicator used on Sentiment Trader. Here is the formula in excel:

=If( High - Low <> 0 ; ((High-Open)+(Close-Low))/(2*(High-Low)) ; 0 ) * 100

Substitute the appropriate columns for High, Low, etc. and then create whatever length average you want. So a doji day that opened and closed at 850 with a 900 high and 800 low would be neutral with a score of 50.


Daniel said...

Thanks Peter! A great chart! I like the vertical latticework which enables one to quickly and easily run the eye up from the indicator to the time period of the market, above it.

Your chart reveals two serious flaws in the indicator, and perhaps flaws in the inherent concept as well.

It may be mildly useful, as more of an accumulation and distribution type indicator, rather than a leading and lagging momentum indicator-- such as MACD.

If I were Dr. Brett I would abandon the idea. I think Chaikin Money Flow plus MACD already cover this ground very well.

You rock, Peter! What magical times we live in-- that Dr. B could posit an idea, throw out some parameters-- and within a DAY someone builds a Test Kit for it. Wow.

Stop tinkering, Dr. B! You already have the ultimate, in your demand and supply metrics.


ken long said...

i use something similar, measuring the difference between the close today and what yesterday's prediction of today's pivot point data are.

i consider the difference to be "surprise", because we can "expect the PP to be consensus value.

so differences between close and PP are information about forward price levels.

how significant is the move? here are 3 levels of granularity i have been trying:
yes/no (like the good doctor's strong/weak)

1,2 or 3 points based on where the close was with respect to R1,R2,R3 or -1,-2,-3 with respect to S1, S2, S3

z-scores based on stdev of the difference over the last 30 days (probebly goes too deep :P )

by looking at 10 day and 3 day lookback periods there seems to be some measure of how psychology has been playing out around the "maypole" of the PP or "true value".

extreme conditions of difference seem important as an alert of something important abot to happen, either violent retracement or continuation of a new trend

good hunting!

Brett Steenbarger, Ph.D. said...

Good points, Daniel; I'll be addressing some of them in future posts/iterations of the indicator--


Brett Steenbarger, Ph.D. said...

Thanks, Peter; I appreciate your programming the indicator. Do pass along URLs when you post material that would be of interest to TraderFeed readers--


Brett Steenbarger, Ph.D. said...

Thanks; you're always one step ahead of me, Henry... :-)


Brett Steenbarger, Ph.D. said...

Thanks, Joshua; that sounds like a good implementation--


Brett Steenbarger, Ph.D. said...

Hi Daniel,

Thanks for the feedback. I do abandon many ideas, but not without considerable investigation. The first approximations of most things I do end up in the circular filing cabinet... :-)


Brett Steenbarger, Ph.D. said...

Thanks Ken; you're one step ahead of me with the idea of scoring moves based on closing above pivot-derived target levels--