SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Jan Robert Wolansky who wrote (5184)7/5/1998 3:13:00 PM
From: TechTrader42  Read Replies (1) of 11149
 
Jan: I'm on my way out (in more ways than one), so I'll just give you a scan that does part of what you wanted. I hope this part is right, since it's a quick effort. This gives stocks whose 21-day slope was higher today than the day before. I'll be back later to do it for the past 10 days, if you haven't figured that out by then. (You'd have to do a back testing version that moved "i" back 1 day at a time for 10 days. You could add another variable to the scan to do this -- one that moved back 10 days).

But here it is without the 10-day back-testing. This gives the slope yesterday and today (I hope):

output = "linregslope.lst";

issuetype common;
Daystoload = 50; //needed for R2 bug!!!

integer i, S, Sx, Sxx;
float b, Sxy, Sy, Syb, Sxyb, bb;
S := 21;
Sx := 0;
Sxx := 0;
Sxy := 0;
Sxyb := 0;
Sy := 0;
Syb := 0;
for i = 1 - S to 0 do
Sx := Sx + i;
Sy := Sy + close(i); //kills println wo d2ld
Syb := Syb + close(i-1); //kills println wo d2ld
Sxx := Sxx + i*i;
Sxy := Sxy + i*close(i); //kills println wo d2ld
Sxyb := Sxyb + i*close(i-1); //kills println wo d2ld
//Sxy := Sxy + i*close(0);
next i;
b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);//Today's slope
bb := (S*Sxyb - Sx*Syb)/(S*Sxx - Sx*Sx);//Yesterday's slope
if b > bb then
println symbol,",",close(0):8:2,",",b:8:4,",", bb:8:4;
endif;

Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext