home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / BASE-HI.TAS < prev    next >
Text File  |  1992-03-20  |  4KB  |  154 lines

  1. {
  2. This script is geared toward investors who like to buy stocks at or near
  3. new highs, as they emerge from basing patterns. It finds and graphs all
  4. stocks which are making new highs, and all stocks which are within 5%
  5. of their high AND have been in a narrow trading range for a period of time.
  6. The graph of the stock appears on the screen and any base found is
  7. defined with red lines. Stocks making new highs will not always show
  8. base lines. The "base" shown in the legend on top of the price graph
  9. tells how many days the stock has trading within 15%.
  10. The volume graph plots the 50 day moving average and tells how today's
  11. volume compares with the 50MA. The 5MA and 10MA comparisons are also
  12. shown. The 5MA and 10MA calculations do not include today, rather they
  13. end yesterday. They attempt to show how volume behaved immediately
  14. prior to today's action.
  15. Most data is displayed on the screen during processing, and it is saved
  16. in the output file "BASE-NH.LST".
  17. Written 3/18/92 by Tom Rategan.  Prodigy PMGV10A
  18. }
  19. #max_quotes 255
  20. #output_file 'BASE-NH.LST'
  21. if first_ticker then begin
  22. writeln(
  23. '      ********* New highs and possible near base breakouts. *********
  24. ');
  25. writeln(
  26. '                                         All Time |--Base--|');
  27. writeln(
  28. '    Name           Close    Change   %OH   High   %Rng  Days   Vol      %V'
  29. );
  30. writeln(
  31. '    ----           -----    ------   ---   ----   ----  ----   ---      --'
  32. );
  33. end;
  34. if quote_count < 65 then return;
  35. hiqc : array;
  36. qc = (quote_count-2);
  37. hiqc = hhv(c,qc);
  38. if c < (hiqc*.95) then return;
  39. hi30 : array;
  40. lo30 : array;
  41. hi30 = hhv(c,30);
  42. lo30 = llv(c,30);
  43. hi40 : array;
  44. lo40 : array;
  45. hi40 = hhv(c,40);
  46. lo40 = llv(c,40);
  47. hi60 : array;
  48. lo60 : array;
  49. hi60 = hhv(c,60);
  50. lo60 = llv(c,60);
  51. newhigh_switch = 0;
  52. r30 = (1-(lo30/hi30))*100;
  53. r40 = (1-(lo40/hi40))*100;
  54. r60 = (1-(lo60/hi60))*100;
  55. if r40 <= 5 then goto r40_less_5;
  56. if r30 <= 5 then goto r30_less_5;
  57. if r40 <= 10 then goto r40_less_10;
  58. if r30 <= 10 then goto r30_less_10;
  59. if r40 <= 15 then goto r40_less_15;
  60. if r30 <= 15 then goto r30_less_15;
  61. if r60 <= 20 then goto r60_less_20;
  62. if r40 <= 20 then goto r40_less_20;
  63. if r60 <= 25 then goto r60_less_25;
  64. if r30 <= 20 then goto r30_less_20;
  65. if c < hiqc then return else goto newhigh;
  66. :r40_less_5
  67. t = -39;
  68. rng = r40;
  69. goto count_days;
  70. :r30_less_5
  71. t = -30;
  72. rng = r30;
  73. goto count_days;
  74. :r40_less_10
  75. t = -39;
  76. rng = r40;
  77. goto count_days;
  78. :r30_less_10
  79. t = -30;
  80. rng = r30;
  81. goto count_days;
  82. :r40_less_15
  83. t = -39;
  84. rng = r40;
  85. goto count_days;
  86. :r30_less_15
  87. t = -30;
  88. rng = r30;
  89. goto count_days;
  90. :r40_less_20
  91. t = -39;
  92. rng = r40;
  93. goto count_days;
  94. :r60_less_20
  95. t = -59;
  96. rng = r60;
  97. goto count_days;
  98. :r60_less_25
  99. t = -59;
  100. rng = r60
  101. goto count_days;
  102. :r30_less_20
  103. t = -30;
  104. rng = r30;
  105. goto count_days;
  106. :newhigh
  107. newhigh_switch = 1;
  108. t = 0;
  109. rng = 15;
  110. :count_days
  111. gosub count;
  112. if t = -(qc) then goto stats;
  113. if ((1-(c[t]/hiqc))*100) > rng then goto stats else goto count_days;
  114. :count
  115. t = t-1;
  116. return;
  117. :stats
  118. t= -(t+1);
  119. hi_rng : array;
  120. lo_rng : array;
  121. hi_rng = hhv(c,t);
  122. lo_rng = llv(c,t);
  123. v50 : array;
  124. v50 = mov(v,50,'s');
  125. vv50 = ((v[0]/v50[0])*100);
  126. v5 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5])/5;
  127. v5v50 = ((v5/v50[0])*100);
  128. v10 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5]+v[-6]+v[-7]+v[-8]+v[-9]+v[-10])/10;
  129. v10v50 = ((v10/v50[0])*100);
  130. oh = 100-((c/hiqc)*100);
  131. chg = c[0]-c[-1];
  132. opengraph(2);
  133. sizegraph(4,2);
  134. graph(1,' '+format(c[0],'$%5.2f')+' is '+format(oh,'%2.1f%')
  135. +' off '+format(hiqc[0],'$%5.2f')+' high.   Change= '+format(chg,'$%2.2f')
  136. +'   Base less than '+
  137. format(rng,'%2.1f%')+' for '+format(t,'%2.f')+' days.');
  138. if newhigh_switch = 1 then goto graphvol;
  139. drawline(12,0,lo_rng[-1],0,lo_rng[-1],-t,-1);
  140. drawline(12,0,hi_rng[-1],0,hi_rng[-1],-t,-1);
  141. :graphvol
  142. graph(v,'Today='+format(v[0],'%5.f')+'    50MA='+format(v50[0],'%5.f')
  143. +'    %Today='+format(vv50,'%4.f%')+'    5MA='+format(v5v50,'%4.f%')
  144. +' of 50MA.  10MA='+format(v10v50,'%4.f%')+' of',v50,'50MA');
  145. closegraph();
  146. if newhigh_switch = 1 then goto write_nobase;
  147. writeln(fullname,' ',c[0],' ',chg,int(oh),'%',hiqc,int(rng),'%',
  148. int(t),'  ',v[0],int(vv50),'%');
  149. return;
  150. :write_nobase
  151. writeln(fullname,' ',c[0],' ',chg,int(oh),'%',hiqc,'    No Base  '
  152. ,v[0],int(vv50),'%');
  153. return;
  154.