home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tas501.zip / PA1.TAS < prev    next >
Text File  |  1993-02-25  |  3KB  |  109 lines

  1. #TITLE Rate of change of price and volume performance report          
  2. { PA1.TAS
  3.     Script to create Performance Analytics report 1
  4.                     The Week in Review
  5.         Top Ten Positive % Change   Top Ten Negative % Change
  6.         Top Ten $ Gainers             Top Ten $ Losers
  7.         Top Ten Volume % Gainers for Week
  8.         Top Ten Technical Improvement   Top Ten Technically Deteriorating
  9. }
  10. #output_file pa1.lst N
  11. #max_quotes 100
  12. if quote_count < 100 Then Goto notEnough;
  13. customer = '****Your Name Here****';
  14. if period = 0 then
  15.     period = 5;     { use a 5 day period by default}
  16. gosub BinaryWave;
  17. pctchg = roc(c,period,'%');
  18. dolchg = roc(c,period,'$');
  19. volchg = roc(sum(v,period),period,'%');
  20. sortout(ticker,fullname,pctchg,dolchg,volchg,c,t_bwave,y_bwave,
  21. {         1      2        3      4      5    6    7       8   }
  22.         t_bwave-y_bwave);
  23. {          9            }
  24. :NotEnough
  25. if last_ticker = 0 then return;
  26. page = 1;
  27. gosub heading0;
  28. rpttype = 'Positive % Change';
  29. gosub heading1;
  30. gosub heading2;
  31. sorton(3,'D');
  32. gosub listline;
  33. rpttype = 'Negative % Change';
  34. gosub heading1;
  35. gosub heading2;
  36. sorton(3,'A');
  37. gosub listline;
  38.  
  39. gosub newpage;
  40. rpttype = 'Dollar Gainers';
  41. gosub heading1;
  42. gosub heading2;
  43. sorton(4,'D');
  44. gosub listline;
  45. rpttype = 'Dollar Losers';
  46. gosub heading1;
  47. gosub heading2;
  48. sorton(4,'A');
  49. gosub listline;
  50. rpttype = '% Volume Gainers';
  51. gosub heading1;
  52. gosub heading2;
  53. sorton(5,'D');
  54. gosub listline;
  55.  
  56. gosub newpage;
  57. rpttype = 'Technical Improvement';
  58. gosub heading1;
  59. gosub heading2;
  60. sorton(9,'D');
  61. gosub listline;
  62.  
  63. rpttype = 'Technical Deterioration';
  64. gosub heading1;
  65. gosub heading2;
  66. sorton(9,'A');
  67. gosub listline;
  68. return;
  69. :listline
  70. for i=1; i <= 10; i = i+1;
  71. begin
  72.     sortget(tickname,compname,pctchg,dolchg,volchg,currcls,
  73.         t_bwave,y_bwave,diff);
  74.     writeln(tickname,' ',compname,' ',
  75.            format(pctchg,' %6.2f%%'),
  76.            dolchg,
  77.            format(volchg,' %5.0f%%'),
  78.            currcls,
  79.            format(t_bwave,' %5.0f'),
  80.            format(y_bwave,' %5.0f'),
  81.            format(diff,' %5.0f'));
  82. end;
  83. return;
  84. :newpage
  85. writeln('\p');
  86. page = page+1;
  87. gosub heading0;
  88. return;
  89. :heading0
  90. write('Performance Analytics - Report ID PA1');
  91. writeln('\t\t\t\t\t\t\t\tPage ',format(page,'%2.0f'));
  92. writeln('Prepared for ',customer,' on ',date);
  93. writeln();
  94. return;
  95. :heading1
  96. writeln();
  97. writeln('\t\t\t\t\t\tTop Ten ',rpttype);
  98. writeln('\t\t\t\t\t\tFor Week Ending ',datestr(dates[0]));
  99. writeln();
  100. return;
  101. :heading2
  102. writeln('\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t--Performance--');
  103. writeln('Ticker   Company or        Percent  Dollar  Volume Current        Week');
  104. writeln('Symbol   Security Name      Change  Change  Change  Close   Today  Ago Change');
  105. writeln('-------- ----------------- ------- -------  ------ -------  ----- ----- -----');
  106. writeln();
  107. return;
  108. #INCLUDE PA1A.INC
  109.