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 (5205)7/6/1998 3:51:00 PM
From: TechTrader42  Respond to of 11149
 
Roy: Thanks! You've done it. The values match those in Metastock -- however, there's just one discrepancy that's easily fixed.

The values appear to be one day off. The scan gives values for July 2 that I get in Metastock for July 1. This can be fixed by changing date(i) to date(j) in the output:

In other words, change:

println symbol,",", date(i),",",close(0):8:2,",",b:8:4;

to:

println symbol,",", date(j),",",close(0):8:2,",",b:8:4;

Is that OK with you?

Thanks so much for doing the scan. I'm filled with admiration for your work.

Brooke



To: Roy Yorgensen who wrote (5205)7/6/1998 4:01:00 PM
From: TechTrader42  Read Replies (1) | Respond to of 11149
 
Roy: One other thing: If you eliminate this line from the if statement:

j<0 and // eliminate first pass thru loop

you can get the moves up in slope for the final day (the last trading day).

I took it out with slashes:

//j<0 and // eliminate first pass thru loop

With j in date(j), do you need it now? The scan appears to work fine without it, and the values match those in Metastock.

So your scan is now:

//Slope formula by Bob Jagow
//Back-testing version by Roy Yorgensen
output = "linregslope.lst";

issuetype common;
Daystoload = 50;
integer i,j, S, Sx, Sxx;
float b,b1, Sxy, Sy;
b1:=0; // only initialized first time
for j = 0 to -10 step -1 do
// reset all variables at stat of next loop
S := 21;
Sx := 0;
Sxx := 0;
Sxy := 0;
Sy := 0;
for i = j+(1 - S) to j do
Sx := Sx + i;
Sy := Sy + close(i); //kills println wo d2ld
Sxx := Sxx + i*i;
Sxy := Sxy + i*close(i); //kills println wo d2ld
//Sxy := Sxy + i*close(0);
next i;
b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);
if
//j<=0 and // eliminate first pass thru loop
b< b1 then
println symbol,",", date(j),",",close(0):8:2,",",b:8:4;
b1:=b; // save current for next test
else
b1:=b; // must alway set ot last day's val
endif;
next j;



To: Roy Yorgensen who wrote (5205)7/6/1998 9:57:00 PM
From: RICHARD LOCKIE  Read Replies (2) | Respond to of 11149
 
ROY: Thanks for the scan. I'm using it to select 45 to 60 degree slope stocks. The one that quote plus provided is my original thought in version one. I'm using version 2 with some additional filters to select strong stocks.

Richard Lockie