home *** CD-ROM | disk | FTP | other *** search
- #output_file 'nhnl.lst'
- { NHNL.TAS-
- This script example will show the 52 week high and low for each
- ticker. If the current day's high is equal to the highest high
- or the current low is equal to the lowest low, then we have a
- probable new high or new low. It might also be the case that today's
- high or low is just equal to the previous high or low.
-
- Just to make the script slightly more interesting, we will also
- compute the "percentage off from high", a frequently used metric
- seen in financial tables.
- }
- if first_ticker then
- begin
- writeln(' - CURRENT - - 52 WEEK - OFF');
- writeln('TICKER HIGH LOW HIGH LOW HIGH');
- end;
- high_value := HHV(h,52*5); { compute high over 52 weeks }
- low_value := LLV(L,52*5); { compute low over 52 weeks }
-
- off_high_value := ((high_value - c[0]) / high_value) * 100;
- write(TICKER,' ',h[0],' ',l[0],' ',high_value,' ',low_value,
- '\t',INT(off_high_value),'%');
-
- if high_value <= h then { today's high is new high }
- write(' New High ');
-
- if low_value >= l then { today's low is new low }
- write(' New Low ');
-
- writeln(); { end the line with a 'newline'}
-