home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / VOLBRK3A.TAS < prev    next >
Text File  |  1992-04-15  |  7KB  |  162 lines

  1.  {
  2.    SCRIPT : VOLBRK3A.TAS
  3.    Output File => VOLBRK.LST  Or Printer LPT1
  4.    Author : Peter Ross
  5.      Date : 12/12/91
  6. This script will SCREEN for volume breakouts of stocks that closed
  7. at the same or higher than yesterday, and are 15% or less from their 52
  8. week high.
  9.  In addition, it will ALERT you to those stocks that have had a 30
  10. day price breakout, and when a new high has been reached.
  11.    Modifications: Frank Wolynski
  12.      Date : 02/09/92
  13.    Modifications were made to Peter's TAS file to allow single line
  14.    printouts of the security. Also rearranged prior close & current close
  15.    and included percentage change for the day. Since only securities
  16.    exhibiting the necessary volume breakout percentages were allowed
  17.    through the test, it was not necessary to identify the securities
  18.    as having done so.
  19.    Modifications: Jerry Green
  20.      Date : 03/11/92
  21.    Modified to show OBV yearly high. Plus some comment changes.
  22.    Modifications: Domenic Bianco
  23.      Date : 04/15/92
  24.    Changed Output for Megatech users delete Full_Name
  25.    Changed Calculation of Break Out Volume to agree with Investors Business
  26.     Daily Calculation and default to 50 day moving average of volume.
  27.    Changed definition of a Volume Breakout.
  28.  }
  29.  #MAX_QUOTES 262
  30. {#OUTPUT_FILE 'VOLBRK.LST+'}     {Change brackets for Alternate Output}
  31.  #output_file 'lpt1'
  32.  #INDEX 'sp-500'  {Ticker must exist. Used for Relative Strength IBD type}
  33.  IF FIRST_TICKER THEN
  34.  begin
  35.  {**********************************************************}
  36.  {       Count the Total Tickers in your Directories        }
  37.  {**********************************************************}
  38.  TOTAL := 0;
  39.  WRITELN('            Prev    Curr',
  40.         '  Price  Curr   OFF');
  41.  WRITELN('TICKER     CLOSE   CLOSE',
  42.         ' Change Vol %  HIGH');
  43.  WRITELN('-------- ------- -------',
  44.         ' ------ -----  ----');
  45.  end;
  46.  { #SCAN_DATE '920206' }
  47.  {**********************************************************}
  48.  { NOTE: STOCKS IN DATABASE WITH LESS THAN 262 QUOTES WILL  }
  49.  {                    NOT BE FLAGGED.                       }
  50.  {**********************************************************}
  51.  if quote_count < 262 then
  52.       GOSUB FINI;
  53.  {**********************************************************}
  54.  {    Following changes made by Jim Camenos 3/15/92         }
  55.  {    Add graphics to program                               }
  56.  C50: ARRAY;             { Area for 50 day sma     }
  57.  C200: ARRAY;             { Area for 200 day sma    }
  58.  C50= mov(c,50,'s');     { Compute the 50 day sma  }
  59.  C200= mov(c,200,'s');    { Compute the 200 day sma }
  60.  NCHG = (C[0]-C[-1]);    { Net Price Change }
  61.  {**********************************************************}
  62.  {              Parameter settings follow.                  }
  63.  {     These parameters can be changed to suit you.         }
  64.  {**********************************************************}
  65.  { Price breakout lookback period, Volume breakout lookback }
  66.  {      period, and Percentage for VOLUME BREAKOUT          }
  67.  {**********************************************************}
  68.   PRICE_BREAKOUT_PERIOD  = 30;
  69.   VOL_BREAKOUT_PERIOD    = 50;
  70.   VOL_PERCENT            = 49;
  71.  {**********************************************************}
  72.  { Declare various arrays to hold the results of indicators }
  73.  {**********************************************************}
  74.   HHV_A : ARRAY;    { Place to save HHV }
  75.   VOL_A : ARRAY;    { Place to save Volume Moving average }
  76.   OBV_A : ARRAY;    { Place to save On Balance Volume }
  77.   RS    : ARRAY;    { Save Relative Strength to SP-500 Index }
  78.   OFS   : ARRAY;    {Initial Offset Array for RS}
  79.   high_obv : array;
  80.  PRICE_BREAKOUT = 0;
  81.  VOL_BREAKOUT   = 0;
  82.  OBV_BREAKOUT   = 0;
  83.  RELST_BREAK    = 0;
  84.  {******   CALCULATE RELATIVE STRENGTH ARRAY AND FIND HIGH VALUE ******}
  85.  RS = mulby(div(c,index),100)
  86.  set(ofs,rs[1]);
  87.  rs=sub(rs,ofs);
  88.  HIRS =HHV(rs,52*5);
  89.  {**********************************************************}
  90.  {   The next few lines find the % from the 52 week high.   }
  91.  {**********************************************************}
  92.  HHV_A           = HHV(C,PRICE_BREAKOUT_PERIOD);
  93.  VOL_A           = MOV(V,VOL_BREAKOUT_PERIOD,'S');
  94.  OBV_A           = OBV();
  95.  high_value      = HHV(h,52*5);
  96.  off_high_value  = ((high_value - c[0]) / high_value) * 100;
  97.  day_change      = roc(c,1,'%');
  98.  high_obv        = HHV(OBV_A,52*5);
  99.  off_obv_high    = ((high_obv - OBV_A) / high_obv) * 100;
  100.  IF CLOSE OF TODAY IS GREATER THAN HHV_A OF YESTERDAY THEN
  101.     begin
  102.       PRICE_BREAKOUT = 1;
  103.     end;
  104.  IF ((V-VOL_A)/VOL_A) >
  105.    VOL_PERCENT/100   THEN
  106.     begin
  107.       VOL_BREAKOUT = 1;
  108.     end;
  109.  IF OBV_A OF TODAY IS GREATER THAN high_obv OF YESTERDAY THEN
  110.     begin
  111.       OBV_BREAKOUT = 1;
  112.     end;
  113.  IF RS >= HIRS
  114.     begin
  115.       RELST_BREAK =1;
  116.     end;
  117.  TOTAL := TOTAL + 1;
  118.  IF VOL_BREAKOUT =1 AND OFF_HIGH_VALUE < 16
  119.    AND CLOSE OF TODAY >= CLOSE OF YESTERDAY
  120.    THEN
  121.      BEGIN
  122.         WRITE(ticker, close of yesterday,
  123.              close,INT(day_change),'%',
  124.              INT(((V-VOL_A)/VOL_A) *100),'% '
  125.              ,INT(off_high_value),'%',' ');
  126.      IF PRICE_BREAKOUT THEN
  127.         WRITE(' 30HI');
  128.      IF OBV_BREAKOUT THEN
  129.         WRITE(' OB ');
  130.      IF high_value <= h then
  131.         write(' $ ');
  132.      IF RELST_BREAK =1 then
  133.         write(' RSHI');
  134.         writeln();
  135. {*****************************************************************}
  136.  { Graphic additions made by Jim Camenos 3/15/92 }
  137.  { Graphic additions modified by Domenic Bianco 4/14/92 }
  138.      OPENGRAPH(3);
  139.      SIZEGRAPH(7,5,3); {Play with these to make it look personal}
  140.      GRAPH(1,'High :  '+format(h[0],'%7.3f')+
  141. '  Low : '+format(l[0],'%7.3f')+'  Close : '+format(l[0],'%7.3f')+
  142. '  Chg : '+format(NCHG,'%6.3f'),c50,'50 day MA',c200,'200 day MA');
  143.      GRAPH(RS,'Rel St vs SP-500');
  144.      GRAPH(vol_a,'50 day Avg : '+format(vol_a*100,'%6.0f')+
  145. '     Volume : '+format(v[0]*100,'%6.0f')+'    '
  146.                 +format(((v-vol_a)/vol_a)*100,'%6.0f')+
  147.                 '% of 50 Day Avg Vol',v,' -- Volume');
  148.      CLOSEGRAPH();
  149.  GOSUB FINI;
  150.     END;
  151.  :FINI
  152.  IF LAST_TICKER THEN
  153.  BEGIN
  154.  writeln('');
  155.  writeln('');
  156.  WRITELN('Total Companies Processed','  ',INT(TOTAL));
  157.  WRITELN(' OB INDICATES NEW YEARLY ON BALANCE VOLUME HIGH');
  158.  WRITELN('  $ INDICATES NEW 52 WEEK HIGH PRICE');
  159.  WRITELN(' RSHI Indicates New Relative Strength VS SP-500 High');
  160.  writeln('\p');
  161.  END;
  162.