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

Notification

Icon
Error

Options
Go to last post Go to first unread
Patrick  
#1 Posted : Friday, August 19, 2005 4:41:49 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
For interpretation refer to the article "Standard Error Bands", in the September 96 issue of TASC, written by Jon Anderson. 21 period Upper Band (smoothed): Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1) + (Mov(C,21,S) - Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2))) +2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21)) -((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))/ ((Sum(Power(Cum(1),2),21))-(Power(Sum(Cum(1),21),2)/21)) *((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S) 21 period Lower Band (smoothed): Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1) +(Mov(C,21,S) - Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2))) - 2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21)) -((Sum(Cum(1)*C,21))- ((Sum(Cum(1),21) * Sum(C,21)/21))) / ((Sum(Power(Cum (1),2),21))-(Power(Sum(Cum(1),21),2)/21))*((Sum(Cum(1)*C,21))- ((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S) 21 period R2 (smoothed): Mov((Pwr(Corr(Cum(1),C,21,0),2)),3,S) 21 period Regression Slope: (((Sum(Cum(1)*C,21))-(Sum(Cum(1),21)*Sum(C,21)/21)) / ((Sum(Power(Cum(1),2),21))-(Power(Sum(Cum(1),21),2)/21))) 21 period %A: ((C-Fml("21 period lower band (smoothed)")) / (Fml("21 period upper band(smoothed)") -Fml("21 period lower band (smoothed)"))) 21 period Regression (smoothed): Mov((21*Sum(Cum(1)*C,21)-Sum(Cum(1),21)*Sum(C,21))/ (21*Sum(Pwr(Cum(1),2),21)-Pwr(Sum(Cum(1),21),2))*Cum(1) +(Mov(C,21,S) - Mov(Cum(1),21,S) * (21*Sum(Cum(1) * C,21) - Sum(Cum(1),21)*Sum(C,21))/(21*Sum(Pwr(Cum(1),2),21) -Pwr(Sum(Cum(1),21),2))),3,S)
Jose  
#2 Posted : Saturday, August 20, 2005 7:50:10 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Also check out these related formulae: [code:1:87a52f2e14]MetaStock -> Tools -> Indicator Builder -> New Copy and paste formulae below. ====================================== Linear Regression Trendline & Channels ====================================== ---8<--------------------------------- { Linear Regression Trendline & Channels v4.0 } { ©Copyright 2004-2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User Inputs } pds:=Input("Linear Regression Trendline periods",2,2520,63); multi:=Input("Standard Deviations(+) / Errors(-)",-100,100,2); EnDay:=Input("end Day",1,31,31); EnMnth:=Input("end Month",1,12,12); EnYear:=Input("end Year",1800,2200,2010); x:=Input("use: Open=1 Hi=2 Lo=3 Close=4 WghtCl=5 Volume=6",1,6,4); x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,V,C))))); { End date point } end:=Year()>EnYear OR (Year()=EnYear AND (Month()>EnMnth OR Month()=EnMnth AND DayOfMonth()>=EnDay)); end:=end AND Alert(end=0,2); end:=If(LastValue(Cum(Ref(end,pds)))=0, LastValue(Cum(1))=Cum(1),end); { Linear Regression Trend/Slope end-points } lastValLRI:=LastValue(Highest( If(end,LinearReg(x,pds),0))); lastValLRS:=LastValue(Highest( If(end,LinRegSlope(x,pds),-10000))); adjust:=LastValue(LastValue(Cum(1)) -Highest(If(end,Cum(1),0))); countback:=LastValue(Cum(1))-Cum(1)-adjust; { Rem next line to extend plot to end of chart } countback:=Ref(Ref(countback,-adjust),adjust); { Lin Reg Trendline } LR:=lastValLRI-lastValLRS*countback; restrict:=adjust-(LastValue(Cum(1))-pds); LRT:=Ref(Ref(LR,-restrict),restrict); { Lin Reg StdDev/StdError channels } bandType:=If(multi>=0,Stdev(x,pds),STE(x,pds)); diff:=ValueWhen(1,Cum(IsDefined(LRT))=1, bandType*Abs(multi)); upLR:=LRT+diff; lwLR:=LRT-diff; { Plot on price chart } upLR;lwLR;LRT ---8<--------------------------------- =================================== Linear Regression Trendline & Bands =================================== ---8<------------------------------ { Linear Regression Trendline & Bands v4.0 } { ©Copyright 2004-2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User Inputs } pds:=Input("Linear Regression Trendline periods",2,2520,63); multi:=Input("Standard Deviations(+) / Errors(-)",-100,100,2); EnDay:=Input("end Day",1,31,31); EnMnth:=Input("end Month",1,12,12); EnYear:=Input("end Year",1800,2200,2010); x:=Input("use: Open=1 Hi=2 Lo=3 Close=4 WghtCl=5 Volume=6",1,6,4); x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,V,C))))); { End date point } end:=Year()>EnYear OR (Year()=EnYear AND (Month()>EnMnth OR Month()=EnMnth AND DayOfMonth()>=EnDay)); end:=end AND Alert(end=0,2); end:=If(LastValue(Cum(Ref(end,pds)))=0, LastValue(Cum(1))=Cum(1),end); { Linear Regression Trend/Slope end-points } lastValLRI:=LastValue(Highest( If(end,LinearReg(x,pds),0))); lastValLRS:=LastValue(Highest( If(end,LinRegSlope(x,pds),-10000))); adjust:=LastValue(LastValue(Cum(1)) -Highest(If(end,Cum(1),0))); countback:=LastValue(Cum(1))-Cum(1)-adjust; { Rem next line to extend plot to end of chart } countback:=Ref(Ref(countback,-adjust),adjust); { Lin Reg Trendline } LR:=lastValLRI-lastValLRS*countback; restrict:=adjust-(LastValue(Cum(1))-pds); LRT:=Ref(Ref(LR,-restrict),restrict); { Lin Reg StdDev/StdError bands } bandType:=If(multi>=0,Stdev(x,pds),STE(x,pds)); upLR:=LRT+bandType*Abs(multi); lwLR:=LRT-bandType*Abs(multi); { Plot on price chart } upLR;lwLR;LRT ---8<------------------------------ [/code:1:87a52f2e14] jose '-) http://www.metastocktools.com .
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.