home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / finance / tas206.zip / NHNL.TAS < prev    next >
Text File  |  1991-02-17  |  1KB  |  31 lines

  1. { NHNL.TAS-
  2.    This script example will show the 52 week high and low for each
  3.    ticker. If the current day's high is equal to the highest high
  4.    or the current low is equal to the lowest low, then we have a
  5.    probable new high or new low. It might also be the case that today's
  6.    high or low is just equal to the previous high or low.
  7.  
  8.    Just to make the script slightly more interesting, we will also
  9.    compute the "percentage off from high", a frequently used metric
  10.    seen in financial tables.
  11. }
  12. if first_ticker then 
  13. begin
  14.    writeln('              - CURRENT -       - 52 WEEK -     OFF');
  15.    writeln('TICKER       HIGH      LOW     HIGH      LOW    HIGH');
  16. end;
  17. high_value := HHV(h,52*5);        { compute high over 52 weeks }
  18. low_value  := LLV(L,52*5);        { compute low over 52 weeks }
  19.  
  20. off_high_value := ((high_value - c[0]) / high_value) * 100;
  21. write(TICKER,' ',h[0],' ',l[0],' ',high_value,' ',low_value,
  22.       '\t',INT(off_high_value),'%');
  23.  
  24. if high_value <= h then       { today's high is new high  }
  25.     write(' New High ');
  26.  
  27. if low_value >= l then        { today's low is new low }
  28.     write(' New Low  ');
  29.  
  30. writeln();             { end the line with a 'newline'}
  31.