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

Notification

Icon
Error

Options
Go to last post Go to first unread
aksh  
#1 Posted : Saturday, July 12, 2008 3:28:21 AM(UTC)
aksh

Rank: Member

Groups: Registered, Registered Users
Joined: 1/20/2007(UTC)
Posts: 15

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

Am I doing something wrong? Have I made a mistake somewhere?

I plotted a 5-period Linear Regression Indicator of Closing Price { LinearReg(C,5) } and then plotted a 5-period Modified Moving Average of Close and they plot exactly alike, showing the same values on the bar. 5-period Modified Moving Average of Close formula is as under:

{ n:=5;
tn:=Mov(C,n,S);
s1:=((n-1)/2)*C + ((n-3)/2)*Ref(C,-1) + ((n-5)/2)*Ref(C,-2)
+ ((n-7)/2)*Ref(C,-3) + ((n-9)/2)*Ref(C,-4);
y:=tn+(6*s1)/((n+1)*n);
y
}

The same is the case with 10-period or any other period. Are they the same indicators?

Regards

aksh

wabbit  
#2 Posted : Saturday, July 12, 2008 11:15:16 AM(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)
aksh wrote:

n:=5;
tn:=Mov(C,n,S);
s1:=((n-1)/2)*C + ((n-3)/2)*Ref(C,-1) + ((n-5)/2)*Ref(C,-2)
+ ((n-7)/2)*Ref(C,-3) + ((n-9)/2)*Ref(C,-4);
y:=tn+(6*s1)/((n+1)*n);


When you grind out all the numbers, for n=5 this expression simplifies to:

Code:
(3*C+2*Ref(C,-1)+Ref(C,-2)-Ref(C,-4))/5;


Whether this is the same as LinearReg(C,5), I don't know? If it is raining tomorrow, I might see if I can solve this part of the puzzle? It is interesting to see how there are often different ways to show the same numbers.


wabbit [:D]

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.