Volume-weighted Exponential Moving Average (V-EMA) and the Directional Movement Indicator

We collect Price and Volume data for some stock (or mutual fund), for the past N days, namely:
(P1, V1), (P2, V2), (P3, V3), ... (PN, VN)
and compute, with this info:

Num(Now) = EMA of last N values of (Volume)*(Price)
and
Den(Now) = EMA of last N values of (Volume)

>That doesn't explain how to calculate them!
Patience. Tomorrow, once we've got the Price, PN+1, and Volume, VN+1, we calculate:

 Magic Formula : V-EMA(Next) = Num(Next)/Den(Next) where Num(Next) = α Num(Now) + (1 - α) VN+1 PN+1 and Den(Next) = α Den(Now) + (1 - α) VN+1
and "Num" and "Den" stand for Numerator and Denominator, respectively
and α = 1 - 2/(N + 1) so, for N = 14 (a 14-day V-EMA) we'd have α = 1 - 2/15 = 0.867

(See Technical Analysis stuff.)

To start this procedure (before we've got a bunch of Prices and Volumes) we just use

Num(Now) = (1 - α) Volume x Price   and   Den(Now) = (1 - α) Volume

Thereafter, we use the Magic Formula.

>Example?
Okay, suppose the closing Price and Volume are \$23.50 and 5,250.9, in thousands of shares traded. Suppose, further, that we're working with a 14-day moving average, so

α = 0.867.
and
Num(Now) = (1-0.867) (5,250.9) (23.50) = 16,412
and
Den(Now) = (1-0.867) (5,250.9) = 698.37
so
V-EMA(Now) = Num(Now)/Den(Now) = 16412/698.37 = \$23.50 hence ...

>But that's just today's price!
I'm glad you noticed. However, we need to have a starting value for Num and Den. Tomorrow, we suppose that our Price and Volume are \$24.50 and 1,477.8 kilo-shares, so now we use Magic Formula :

Num(Next) = α Num(Now) + (1 - α) VN+1 PN+1 = 0.867(16412)+(1-0.867)(1477.8)(24.50) = 19044.6
and
Den(Next) = α Den(Now) + (1 - α) VN+1 = 0.867(698.37)+(1-0.867)(1477.8) = 802.03
so
V-EMA = 19044.6/802.03 = \$23.74

>And so on ... and so on.
Right. As we continue, we generate a Volume-weighted Exponential Moving Average and ..

>Is that what you're after? A Volume-weighted ...?
Well ... uh ... not exactly. We're really after a Volume-weighted Directional Movement Indicator (DMI).

>I've forgotten what that is.
Then go back and read the Technical Analysis stuff. However, in a nutshell, we calculate a sequence of Bull Points and Bear Points (depending upon the increases in the daily highs compared to the decreases in daily lows) and we then compute the Exponential Moving Averages (EMA) of these two sequences of Bull and Bear points, calling these EMAs DMI+ and DMI- and we get excited when DMI+ rises above DMI- because we then expect the stock to take off ... so we look at their difference:
ADX = (DMI+) - (DMI-) so that ...

We want to consider the difference between the ordinary, garden-variety DMI and the Volume-weighted version, which we'll call VDI. Consider the following charts, where we're doing the DMI thing ... ignoring the volume of trades:

Notice that the ADX dipped negative in mid-May. Maybe that's the start of a decline. Maybe we should sell. Maybe we should worry. However, this dip follows a period of low volume (see upper left chart). Had we included the Volume in our calculations ...

>You mean, use VDI+ and VDI- and VDX = (VDI+) - (VDI-) instead of ...
Don't interrupt. If we include Volume ... we find the following:

... and now, if we own the stock, we're happy. The stock, we think, will quickly recover.
 >But it could go the other way. I mean ... Yes, it could go the other way. Including the Volume might make you very nervous. For example, here's another stock. Without using the Volume weighting (but just the standard DMI), the ADX doesn't go negative in early May. However, if we include the Volume, the VDX goes negative ... for a week or so. >So what's the moral of this story? The moral? I guess we should think about buying (or selling) only when the VDX goes positive (or negative) by a significant amount. >What's significant? Hmmm ... good question. I'd suggest using VDX = 100 { (VDI+)-(VDI-)} /{ (VDI+)+(VDI-)} then we'd get a "percentage" and we'd relax unless the VDX rose above, say, 30% or fell below, say, -30%: >So if I see the VDX drop to -15%, as in the above chart, I just go back to sleep. Exactly.
There's a spreadsheet you can play with. You can choose ADX or the Volume-weighted VDX. It looks like this:

In the meantime, here's a few VDXs (as opposed to ADXs) to ponder:

 And, for a change of pace (because there ain't no Volume figures for this Index), the ADX for the Nasdaq, below: >But what about the big drop in the NAZ, last year? Okay, here's a picture for that: >So, it looks like ADX anticipated the drop ...sorta ... if we get excited about a 30% drop. Do you believe in this technical analysis stuff? >Well ... uh ... not really.
 >For example, would this ADX stuff have kept you out of the Nasdaq, for all of the year 2000? Good question ... let's see. Suppose we have \$1,000 invested in the Nasdaq, in January, 2000 and we watch the ADX. When it drops below -30% we sell everything, put the money under a pillow and wait. When the ADX goes above 30% we buy back in ... and stay in until it drops below -30% again. >Looks like you made 12.9% for the year while the NAZ dropped ... what? Over 40%. Yes, but notice that I sold in March and held the cash until the end of May. I also bought back in, sometime near the end of August, and got out later when the ADX dropped from +30% to -30% in about a week or so ... and I lost money! >So, do you believe in this technical analysis stuff? Well ... uh ... not really.
 So, guess what stock we should worry about, now, on May 27, 2001? >How many guesses do I get? Just one. >Pfizer? Are you sure? Ask me again in a week or three.
 ... here's a more recent Pfizer: >Aha! So your prediction is lousy! Ya win some.Ya lose some.

>But is VDX, the volume-weighted stuff, really better than ADX??
Uh ... let's try it on some stock that's been around for a while, like maybe ...

>How about General Electric. It's been around since the DOW had only a dozen stocks and I'd say that ...
Okay, here's what we'll do:
 At the end of each week we note the Open, High, Low and Closing prices for that week. Using the average of these four prices, (Open+High+Low+Close)/4, we calculate the 4-week VDX. If the VDX rises above +30% we buy the stock at next week's Opening price. If the VDX drops below -30% we sell the stock at next week's Opening price and stick the money into money market, at 2% per year. On the right, the final result (from Jan/85 to Jun/01)
Below, some close-ups, where the wee dots indicate switches between the stock and Money Market:

>So what was the annualized gain for the ...?
For GE, the annualized gain from Jan/85 to Jun/01 was 20.0% and for VDX it was 23.1%.

>Big deal!
Aah ... but if you had \$100K invested for those years, it'd make a difference of over \$100,000 in your final portfolio - if you used VDX instead of ADX - from about \$2.9M to \$3.0M and that's significant, eh? And if we just did a buy-and-hold with the GE stock, we'd have about \$2M by June/01.

>That 4-week averaging. Is that the best number? And that 30% figure - what about ...?
The 30% is up to you. I call it the tranquility parameter.
You want tranquility? Choose +/- 100%, relax, do nothing.
You need the adrenaline rush? Choose +/- 5%.

>Aha! So you looked at the historical data and picked the parameters, like 4-week and 30%, so as to make VDX look good!
Well ... uh, one must use historical data for each stock in order to gauge the appropriate parameters for that particular stock. I mean, not all stocks behave in the same way. Some are more volatile. Some are ...

>Mumbo Jumbo. Besides, you ignore the cost of trading and what about longer time spans and ...?

>And if you ignored the volume and just used ADX?
The annualized gain would have been ... uh ... 17.0%, but I must say that it makes more sense to include the volume. After all, share prices associated with a higher volume surely are more important than the share price when just a few shares trade. There are usually more people involved. Volume-weighted prices give us an estimate of the average price paid for a stock. Using the price, alone, is like saying the size of a car - ignoring the weight of the car - that just its size alone will determine how much force is required to move the car. It's like saying that ...

>zzzZZZZ

for part II.

For gyrfalcon and other Nortel- and XIU-watchers:

See Part II

NOTE: There's a simple spreadsheet available. You just type in the Stock Symbol, click a button (while you're connected to the Net!) and it downloads the pertinent data and plots the VDX (thanx to Ron M!). The spreadsheet looks like this.