Hi Howard: 'Tworks for multiple stocks. Give it a try. It works at the beach, too. Works like a peach. Works even for Friedrich Nietzsche.
Here's the very beginning of the output using 10 days (-9). This shows how many days the close was up out of the 10 days. You get multiple listings for each stock because the scan gets several hits for up days in the period. With the stock A, for example, the first up day during the 10-day period was on 6/19. The last up day was 7/01. The last hit gives the total number of up days for the period, because the "k" variable is cumulative. (The skies are looking a bit cumulous here, too, but no matter.)
A , 1, 06/19/1998 A , 2, 06/24/1998 A , 3, 06/25/1998 A , 4, 06/30/1998 A , 5, 07/01/1998 AA , 1, 06/19/1998 AA , 2, 06/23/1998 AA , 3, 06/26/1998 AA , 4, 06/29/1998 AA , 5, 07/01/1998 AAB , 1, 06/19/1998 AAB , 2, 06/22/1998 AAB , 3, 06/24/1998 AAB , 4, 06/26/1998 AAB , 5, 07/02/1998 AABC , 1, 06/19/1998 AABC , 2, 06/24/1998 AABC , 3, 06/26/1998 AAC , 1, 06/23/1998 AAC , 2, 06/24/1998 AACE , 1, 06/22/1998 AACE , 2, 06/23/1998 AACE , 3, 06/24/1998 AACE , 4, 06/29/1998 AACE , 5, 06/30/1998 AACE , 6, 07/02/1998 AAFG , 1, 06/22/1998 AAFG , 2, 06/25/1998 AAFG , 3, 06/26/1998 AAG , 1, 06/23/1998 AAG , 2, 06/24/1998 AAG , 3, 06/26/1998 AAG , 4, 06/29/1998 AAG , 5, 07/01/1998 AAGIY , 1, 06/19/1998 AAGIY , 2, 06/23/1998 AAGIY , 3, 06/29/1998 AAGIY , 4, 06/30/1998 AAGIY , 5, 07/02/1998 AAGP , 1, 06/23/1998 AAGP , 2, 06/25/1998 AAGP , 3, 06/26/1998 AAGP , 4, 07/01/1998 AAII , 1, 06/19/1998 AAII , 2, 06/23/1998 AAII , 3, 06/29/1998 AAII , 4, 06/30/1998 AAIR , 1, 06/19/1998 AAIR , 2, 06/22/1998 AAIR , 3, 06/23/1998 AAIR , 4, 06/24/1998 AAIR , 5, 06/26/1998 AAIR , 6, 06/30/1998 AAIR , 7, 07/02/1998 AALA , 1, 06/29/1998 AALA , 2, 07/01/1998 AAM , 1, 06/23/1998 AAM , 2, 06/24/1998 AAM , 3, 06/25/1998 AAME , 1, 06/19/1998 AAME , 2, 06/22/1998 AAME , 3, 06/24/1998 AAME , 4, 06/26/1998 AAME , 5, 07/02/1998 AAN , 1, 06/25/1998 AAN , 2, 06/29/1998 AAN , 3, 06/30/1998 AAN , 4, 07/01/1998 AANB , 1, 06/22/1998 AANB , 2, 06/29/1998 AAON , 1, 06/19/1998 AAON , 2, 06/23/1998 AAON , 3, 06/25/1998 AAON , 4, 07/01/1998 AAP , 1, 06/22/1998 AAP , 2, 06/24/1998 AAP , 3, 06/25/1998 AAP , 4, 06/30/1998 AAPL , 1, 06/22/1998 AAPL , 2, 06/23/1998 AAPL , 3, 06/24/1998 AAPL , 4, 06/25/1998 AAPL , 5, 06/29/1998 AAPL , 6, 07/01/1998
Here is the scan again:
output="nietzsche.lst";
integer j, k; k:=0; for j=-9 to 0 step 1 do if close(j)>close(j-1) then k:= 1 + k; println symbol , "," , k:3:0, ", ", date(j); endif; next j; |