To: Dale Wingo who wrote (7159 ) 10/11/1998 11:22:00 PM From: Bob Jagow Read Replies (2) | Respond to of 11149
Dale, This is the scan that says to buy Dell on 10/1 at 61.56 I printed the close because I didn't want to figure out which SAR to grab on the flipday. -Bob ___________________ --------------------- input = "30k+vol.lst"; output = "sar.lst"; float accdelta, accfac, SIP, SAR, SARp, xprice; integer j, count, buysell,firstday, flipday; accdelta := .02; accfac := accdelta; count := -100; buysell := 0; // 1-long, 0-short firstday := 1; SAR := high(count); SARp := SAR; SIP := SAR; xprice := high(count); for j = count-1 to 0 step 1 do if( buysell = 0 ) then // short position if( firstday = 1 ) then SAR := SIP; firstday := 0; else if( low(j) < xprice ) then xprice := low(j); if( accfac < .2 ) then accfac := accfac + accdelta; endif; endif; SAR := SARp - accfac * abs(xprice - SARp); endif; if( SAR <= high(j) or SAR <= high(j-1) ) then if( high(j) >= high(j-1)) then SAR := high(j); else SAR := high(j-1); endif; buysell := 1; flipday:= j; accfac := accdelta; SIP := xprice; firstday := 1; endif; endif; if( buysell = 1 ) then // long position if( firstday = 1 ) then SAR := SIP; firstday := 0; else if( high(j) > xprice ) then xprice := high(j); if( accfac < .2 ) then accfac := accfac + accdelta; endif; endif; SAR := SARp + accfac * abs(xprice - SARp); endif; if( SAR >= low(j) or SAR >= low(j-1) ) then if( low(j) <= low(j-1)) then SAR := low(j); else SAR := low(j-1); endif; buysell := 0; flipday:= j; accfac := accdelta; SIP := xprice; firstday := 1; endif; endif; SARp := SAR; next j; if buysell = 0 then println symbol," Buy on ", date(flipday),",",close(flipday):6:3; endif; if buysell = 1 then println symbol," Sell on ", date(flipday),",",close(flipday):6:3; endif;