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: Roy Yorgensen who wrote (5251)7/7/1998 8:36:00 PM
From: TechTrader42  Read Replies (3) of 11149
 
Bob Jagow suggests changing "date(j)" to "date(j+1)" if you want the date to be the day when the slope moved up (not the day before). I'm not channeling Bob or reading his mind -- he's been answering some of my probing e-mail inquiries (such as "Huh?" or "Duh?"). Here's the whole scan again (for positively the last time, as that indefatigable troupe in "Nicholas Nickleby" said):

//Slope formula by Bob Jagow
//Back-testing version by Roy Yorgensen output = "linregslope.lst";
input="portfoli.lst";
//issuetype common;
integer first, i, j, S, Sx;
float b,b1, Sxx, Sxy, Sy, pctgain;
first:= -10;
Daystoload = 50 -first;
DaysRequired = 22 - first;
S := 21; // set here
b1 := 0; // only initialized first time
for j = 0 to first step -1 do //why 0 to -10?
// reset all variables at start of 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 := .000001+(S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);
if b = 0 then print symbol,"b was zero with j: ",j; endif;
pctgain := abs((b1/b) -1); //gives div by 0 -- strange?
if j < 0 // eliminate first pass thru loop -- clumsy
and b < b1 then
//pctgain := abs((b1/b)-1); // not % and constrained to be > 0 ;)
if pctgain > 1 then
println symbol,",", date(j+1),",",close(0):6:3,","," B: ",
b:4:3,","," B1: ", b1:4:3,","," Percent gain: ", pctgain:4:2;
endif; endif;
b1:=b; // must alway set to last day's val
next j;
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext