home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / NDXCOMPA.TAS < prev    next >
Text File  |  1992-12-26  |  1KB  |  48 lines

  1. {
  2.  NDXCOMP.TAS => NDXCOMP.LST
  3.  This script looks at the performance of your stocks and
  4.  chosen index.
  5.  You may change the time of the performance by changing the
  6.  MAX_QUOTES line to the time you prefer, it is set for 10
  7.  days.
  8.  You may also change the index by changing the INDEX line to
  9.  the ticker you want to compare with.  SP-500 is suggested
  10.  for all round performance, it is now on the DOW 30.
  11.  This script has changed a lot because the power of TAS has
  12.  grown allowing smaller scripts and greater speed.
  13.  Jerry Green 12/26/92
  14. }
  15. #MAX_QUOTES 10
  16. #INDEX 'DJ-30'
  17. #OUTPUT_FILE 'NDXCOMP.LST+' n
  18. if first_ticker then
  19. writeln(DATE);
  20. IPF : ARRAY;
  21. TPF : ARRAY;
  22. IPF = PER1(INDEX);{ Calculate performance of index}
  23. TPF = PER();      { Calculate performance of ticker}
  24. qc = QUOTE_COUNT;
  25. SORTOUT(TICKER,C,TPF);
  26. if last_ticker then
  27. BEGIN
  28.   SORTON(3,'d');
  29.     writeln('These are the 5 best performers.');
  30.     gosub CONCLUDE;
  31.   SORTON(3,'a');
  32.     writeln();
  33.     writeln('These are the 5 worst performers.');
  34.     gosub CONCLUDE;
  35.     goto FINI;
  36. :CONCLUDE
  37.    writeln('NAME   LAST CLOSE   '+format(qc,'%3.0f'),
  38.           ' DAY PERFORMANCE');
  39.    for i = 1; i <= 5; i = i + 1;
  40.      begin
  41.      SORTGET(NAM,CLE,PRF);
  42.      writeln(NAM,CLE,'       ',PRF);
  43.      end;
  44. RETURN;
  45. END;
  46. :FINI
  47. END;
  48.