home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / tas412.zip / PA1.TAS < prev    next >
Text File  |  1992-12-17  |  3KB  |  108 lines

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