help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

exponential moving average from MOVAVG not correct?


From: Tim Rueth
Subject: exponential moving average from MOVAVG not correct?
Date: Tue, 23 Feb 2010 11:33:07 -0800

Does anyone else have experience using the MOVAVG function with exponential weighting ('e')?  If I don't specify the 'e' weighting, then I correctly get a simple moving average.  But when I specify 'e' I get numbers that don't seem correct.  I'm curious if the exponential weighting used here is somehow different from what is commonly assumed.  For example, to calculate stock price trends, one typically computes MACD (moving average convergence divergence) by doing:
 
MACD = (12-day exponential moving average) minus (26-day exponential moving average)
 
So in Octave, I did the following:
 
[Short_ma, Long_ma] = movavg(data(:,Price),12,26,'e');
MACD = Short_ma - Long_ma;
For a typical stock, the MACD value is usually in the single-digits.  But both my Short_ma and Long_ma track Price very closely, and hence MACD stays in the range of +/-10^-4, which clearly is incorrect.  Help please?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]