Hi there!
I know we have the VWMA (volume weighted moving average), but I haven't seen the exponential version of it (so VWMA is simple, i guess).
I found this code here but I can't say if this is indeed the right formula of a EVWMA:
Volume-weighted Exponential Moving Average (V-EMA)
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