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 -- Ignore unavailable to you. Want to Upgrade?


To: Roy Yorgensen who wrote (5282)7/9/1998 12:58:00 AM
From: TechTrader42  Read Replies (1) | Respond to of 11149
 
You solved the problem of how to do back-testing with Bob's slope scan -- solved it beautifully, too, with a minimun of coding. And Bob worked some more of his magic on your solution. Jan and Mike asked all the right questions. My role was bumping into walls. Now the five of us will have to incorporate and issue our IPO, Scans Inc. -- the one remaining undervalued Internet company.

Here's the scan again:

// Slope by Bob Jagow
//Back-testing version by Roy Yorgensen
output = "linregslope.lst";
input="portfoli.lst";
issuetype common;
integer i,j, S, Sx;
float b,lastB, Sxx, Sxy, Sy, pctgain;
S := 21;
daystoload = 50 + S ;
daysrequired = 2 + 10 + S; //may need for newish issues
lastB:= 9999; // large first time flag won't require testing
for j = -10 to 0 do // reset all variables at start of i loop
Sx := 0; Sxx := 0; Sxy := 0; Sy := 0;
for i = j+(1 - S) to j do
Sx := Sx + i;
Sy := Sy + close(i);
Sxx := Sxx + i*i;
Sxy := Sxy + i*close(i);
next i;
b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);
pctgain:= (b -lastb)/abs(lastb+.0000001)*100;
if pctgain > 25 then
println symbol,",", date(j),",",close(j):6:3,","," B: ",
b:4:3,","," LastB: ", lastb:4:3,","," Pctgain: ", pctgain:4:2;
endif;
lastb:=b; // save current for pctgain
next j;

Brooke