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

Notification

Icon
Error

Options
Go to last post Go to first unread
KTP2  
#1 Posted : Tuesday, May 4, 2010 4:37:51 PM(UTC)
KTP2

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/2/2007(UTC)
Posts: 367

Was thanked: 1 time(s) in 1 post(s)
Regularization

Chris Satchwell's article, "Regularization" included the calculation method for two indicators; a Regularized Exponential Moving Average and a Regularized Momentum. The MetaStock formulas below prompt for the number of periods in the moving average and for the regularization constant. Since the article did not include a range for the regularization constant, the formulas allows for any values between 0 and 20.

To create a formula in MetaStock, select Indicator Builder from the Tools menu. Click New and then enter the formula below. When finished click OK. Repeat for the second formula.

Name: Regularized EMA
Formula:
x:=Input("number of periods in moving average",1,500,21);
d:=Input("regularization constant",0,20,.5);
a:=2/(x+1);
(PREV*(1+(2*d))+(a*(C-PREV))-(d*Ref(PREV,-1)))/(1+d)

Name: Regularized Momentum
Formula:
x:=Input("number of periods in moving average",1,500,21);
d:=Input("regularization constant",0,20,.5);
a:=2/(x+1);
f:=(PREV*(1+(2*d))+(a*(C-PREV))-(d*Ref(PREV,-1)))/(1+d);
(f-Ref(f,-1))/f
Users browsing this topic
Guest (Hidden)
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.