home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / NDXCOMP.TAS < prev    next >
Text File  |  1991-06-25  |  3KB  |  134 lines

  1. {
  2.      This script looks at short term performance of your stocks, only
  3.      5 days, and compares that performance to an index.  In this script
  4.      the index is the SP-500.  You can change the time of perfomance by
  5.      changing the Max_Quotes feild and you can change the index to any
  6.      index or stock you want by changing SP-500 in the index feild.  At
  7.      the summary you will see the 5 and worst perfomers in your ticker
  8.      Written by Jerry Green on a suggestion by Martin Moore.  Any errors
  9.      in the script are mine.  April 1991.
  10. }
  11. #MAX_QUOTES 5
  12. #INDEX 'SP-500'
  13. #OUTPUT_FILE 'NDXCOMP.LST+'
  14. tk_total : number;
  15. sg_stks : number;
  16. IPF := ((INDEX/INDEX[1])-1)*100;
  17. TPF := ((C/C[1])-1)*100;          { Calculate perfomance of ticker}
  18. begin
  19. if TPF > IPF then
  20.     sg_stks = sg_stks +1;
  21. tk_total = tk_total +1;
  22. end
  23. if TPF < zs then                  { search for poor performers}
  24. begin
  25.     vs = ws;
  26.     vst = wst;
  27.     ws = xs;
  28.     wst = xst;
  29.     xs = ys;
  30.     xst = yst;
  31.     ys = zs;
  32.     yst = zst;
  33.     zs = TPF;
  34.     zst = ticker;
  35. end
  36. if TPF > zs and TPF < ys then
  37. begin
  38.     vs = ws;
  39.     vst = wst;
  40.     ws = xs;
  41.     wst = xst;
  42.     xs = ys;
  43.     xst = yst;
  44.     ys = TPF;
  45.     yst = ticker;
  46. end
  47. if TPF > ys and TPF < xs then
  48. begin
  49.     vs = ws;
  50.     vst = wst;
  51.     ws = xs;
  52.     wst = xst;
  53.     xs = TPF;
  54.     xst = ticker;
  55. end
  56. if TPF > xs and TPF < ws then
  57. begin
  58.     vs = ws;
  59.     vst = wst;
  60.     ws = TPF;
  61.     wst = ticker;
  62. end
  63. if TPF > ws and TPF < vs then
  64. begin
  65.     vs = TPF;
  66.     vst = ticker;
  67. end                                { end poor performers search}
  68. if TPF > as then                   { search for good performers}
  69. begin
  70.     es = ds;
  71.     est = dst;
  72.     ds = cs;
  73.     dst = cst;
  74.     cs = bs;
  75.     cst = bst;
  76.     bs = as;
  77.     bst = ast;
  78.     as = TPF;
  79.     ast = ticker;
  80. end
  81. if TPF < as and TPF > bs then
  82. begin
  83.     es = ds;
  84.     est = dst;
  85.     ds = cs;
  86.     dst = cst;
  87.     cs = bs;
  88.     cst = bst;
  89.     bs = TPF;
  90.     bst = ticker;
  91. end
  92. if TPF < bs and TPF > cs then
  93. begin
  94.     es = ds;
  95.     est = dst;
  96.     ds = cs;
  97.     dst = cst;
  98.     cs = TPF;
  99.     cst = ticker;
  100. end
  101. if TPF < cs and TPF > ds then
  102. begin
  103.     es = ds;
  104.     est = dst;
  105.     ds = TPF;
  106.     dst = ticker;
  107. end
  108. if TPF < ds and TPF > es then
  109. begin
  110.     es = TPF;
  111.     est = ticker;
  112. end
  113. if last_ticker then
  114. begin
  115. t = (int(tk_total));
  116. s = (int(sg_stks));
  117. px = (s/t)*100;
  118. writeln('\n\n----------------------SUMMARY----------------------');
  119. writeln(t,' Tickers with ',s,' > than index  at ',px,'%');
  120. writeln(  )
  121. writeln('    Ticker       %')
  122. writeln('***',' ',zst,' ',zs,'%','   These are the five worst')
  123. writeln('***',' ',yst,' ',ys,'%','   performers in your list.')
  124. writeln('***',' ',xst,' ',xs,'%','   This is based on how they')
  125. writeln('***',' ',wst,' ',ws,'%','   have performed in the last')
  126. writeln('***',' ',vst,' ',vs,'%','   five days.')
  127. writeln(' ')
  128. writeln('***',' ',ast,' ',as,'%','   These are the five best      ')
  129. writeln('***',' ',bst,' ',bs,'%','   performers in your list.     ')
  130. writeln('***',' ',cst,' ',cs,'%','   Please check the stock       ')
  131. writeln('***',' ',dst,' ',ds,'%','   and data for stock splits    ')
  132. writeln('***',' ',est,' ',es,'%','   and/or errors before action. ')
  133. end;
  134.