logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
steve11  
#1 Posted : Sunday, August 5, 2007 7:45:05 PM(UTC)
steve11

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/4/2007(UTC)
Posts: 3

Hi All,

Can someone in this forum explain to me the main differences between moving average exponential and gaussian moving average? How to construct the gaussian moving average by using a basic component such as closing price.Are there any relationship between the component of exponential moving average and gaussian moving average?
EMA(current) = ( (Price(current) - EMA(prev) ) x Multiplier) + EMA(prev)


Regards


Steve
wabbit  
#2 Posted : Sunday, August 5, 2007 11:08:47 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Steve,

The Gaussian MA is simply an EMA of an EMA. Used mainly in digital signal processing, the concept of n-pole filters can be brought into play here. A four-pole filter applied to the close price can be surmised as:
Code:
prd:=21;

data:=CLOSE;
gema:=Mov(Mov(Mov(Mov(data,prd,E),prd,E),prd,E),prd,E);
{plot}
gema;


For some people who require a high degree of data smoothing, but consider the lag in this filter is too much use something more like:
Code:
prd:=21;


data:=CLOSE;

gema:=Mov(Mov(Mov(Mov(data,prd,E),2,E),2,E),2,E);

{plot}

gema;

and many other variations of the concept too!

--

On another note: although your algorithm for the EMA is correct, to write this for MS:
Code:
prd:=21;
data:=CLOSE;
m:=2/(prd+1);
ema:=((data-PREV)*m)+PREV;
{plot}
ema;

requires two recursive PREV functions which are notoriously slow, but the same results can be achieved using:
Code:
prd:=21;

data:=CLOSE;

m:=2/(prd+1);
ema:=If(Cum(IsDefined(data))=1,data,(m*data)+((1-m)*PREV));

{plot}

ema;

which has only one recursive function.

Also note how the function is seeded on the first bar the data is valid to avoid any NA after the data bars have been defined. The first function (gema) will have a large gap of NA bars at the very left hand side of the chart, the only way to overcome this is with an external function. (It might not be the only but it is certainly the best and fastest!)


Hope this helps.

wabbit [:D]

steve11  
#3 Posted : Sunday, August 5, 2007 11:31:41 PM(UTC)
steve11

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/4/2007(UTC)
Posts: 3

thanks wabbit
Users browsing this topic
Guest (Hidden)
Similar Topics
RMO Exploration to catch Buy/Sell signal - coding help needed (Formula Assistance)
by PTJim 5/31/2019 6:17:43 PM(UTC)
Coding Help - MId Point between two fractals (Formula Assistance)
by gauravudani 3/30/2011 12:17:41 AM(UTC)
Simple Coding Help required (Formula Assistance)
by gauravudani 11/30/2009 1:19:44 AM(UTC)
i need a little coding help please!! (MetaStock)
by roryh 11/23/2009 8:55:13 PM(UTC)
EasyLanguage to Metastock Coding Help Required (Formula Assistance)
by Colin2655 3/4/2008 8:40:03 AM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.