[Top][All Lists]

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

Re: exponential moving average from MOVAVG not correct?

From: Ben Abbott
Subject: Re: exponential moving average from MOVAVG not correct?
Date: Tue, 23 Feb 2010 19:35:26 -0500

On Feb 23, 2010, at 2:33 PM, Tim Rueth wrote:

> 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?

The movavg() function is part of the financial package and not part of octave's 
core. Please email the list associated with Octave-Forge.


reply via email to

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