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

[Metastockusers] Re: need accurate Linear Regression code



PureBytes Links

Trading Reference Links

> (2 * Sum(Cum(1) * C,2) - Sum(Cum(1),2)* Sum(C,2)) / 
> (2 * Sum(Pwr(Cum(1),2),2) - Pwr(Sum(Cum(1),2),2)) * 
> Cum(1) + (Mov(C,2,S) - Mov(Cum(1),2,S) * 
> (2 * Sum(Cum(1) * C,2) - Sum(Cum(1),2) * Sum(C,2)) / 
> (2 * Sum(Pwr(Cum(1),2),2) - Pwr(Sum(Cum(1),2),2)))

Mine plots exactly the price. Check to see if you missed any of the 
variables. When I first posted this, I missed a couple of changes to 
the 2 period.







--- In Metastockusers@xxxxxxxxxxxxxxx, "Jose" <josesilva22@xxxx> 
wrote:
> --- In Metastockusers@xxxxxxxxxxxxxxx, "kelols" <kelols@xxxx> wrote:
> 
> > (2 * Sum(Cum(1) * C,2) - Sum(Cum(1),2)* Sum(C,2)) / 
> > (2 * Sum(Pwr(Cum(1),2),2) - Pwr(Sum(Cum(1),10),2)) * 
> > Cum(1) + (Mov(C,2,S) - Mov(Cum(1),2,S) * 
> > (2 * Sum(Cum(1) * C,2) - Sum(Cum(1),14) * Sum(C,2)) / 
> > (2 * Sum(Pwr(Cum(1),2),2) - Pwr(Sum(Cum(1),10),2)))
> 
> 
> Unfortunately the above doesn't plot an identical plot to the 
price, 
> even when adjusting all 10-period code to 2:
> 
> ---8<--------------------------------
> 
> pds:=Input("LinReg periods)",2,2520,2);
> x:=Input("use Open=1, High=2, Low=3, Close=4, Volume=5",1,5,4);
> x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=4,C,V))));
> 
> (pds*Sum(Cum(1)*x,pds) - Sum(Cum(1),pds)* Sum(x,pds)) /
> (pds*Sum(Pwr(Cum(1),2),pds) - Pwr(Sum(Cum(1),pds),2)) *
> Cum(1)+(Mov(x,pds,S)-Mov(Cum(1),pds,S) *
> (pds*Sum(Cum(1)*x,pds) - Sum(Cum(1),14)*Sum(x,pds)) /
> (pds*Sum(Pwr(Cum(1),2),pds) - Pwr(Sum(Cum(1),pds),2)))
> 
> ---8<--------------------------------
> 
> 
> The 2-period LinReg Indicator plot should be identical to the price 
> plot.
> 
> jose '-)


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Save up to 80% on top-quality inkjet cartridges and get your order fast!
FREE shipping on orders $50 or more to the US & Canada. Shop at Myinks.com!
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/v2G7ND/KfUGAA/ySSFAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/