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

  1.  {
  2.    SCRIPT : VOLBRK2A.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.  {              Parameter settings follow.                  }
  55.  {     These parameters can be changed to suit you.         }
  56.  {**********************************************************}
  57.  { Price breakout lookback period, Volume breakout lookback }
  58.  {      period, and Percentage for VOLUME BREAKOUT          }
  59.  {**********************************************************}
  60.   PRICE_BREAKOUT_PERIOD  = 30;
  61.   VOL_BREAKOUT_PERIOD    = 50;
  62.   VOL_PERCENT            = 49;
  63.  {**********************************************************}
  64.  { Declare various arrays to hold the results of indicators }
  65.  {**********************************************************}
  66.   HHV_A : ARRAY;    { Place to save HHV }
  67.   VOL_A : ARRAY;    { Place to save Volume Moving average }
  68.   OBV_A : ARRAY;    { Place to save On Balance Volume }
  69.   RS    : ARRAY;    { Save Relative Strength to SP-500 Index }
  70.   OFS   : ARRAY;    {Initial Offset Array for RS}
  71.   high_obv : array;
  72.  PRICE_BREAKOUT = 0;
  73.  VOL_BREAKOUT   = 0;
  74.  OBV_BREAKOUT   = 0;
  75.  RELST_BREAK    = 0;
  76.  {******   CALCULATE RELATIVE STRENGTH ARRAY AND FIND HIGH VALUE ******}
  77.  RS = mulby(div(c,index),100)
  78.  set(ofs,rs[1]);
  79.  rs=sub(rs,ofs);
  80.  HIRS =HHV(rs,52*5);
  81.  {**********************************************************}
  82.  {   The next few lines find the % from the 52 week high.   }
  83.  {**********************************************************}
  84.  HHV_A           = HHV(C,PRICE_BREAKOUT_PERIOD);
  85.  VOL_A           = MOV(V,VOL_BREAKOUT_PERIOD,'S');
  86.  OBV_A           = OBV();
  87.  high_value      = HHV(h,52*5);
  88.  off_high_value  = ((high_value - c[0]) / high_value) * 100;
  89.  day_change      = roc(c,1,'%');
  90.  high_obv        = HHV(OBV_A,52*5);
  91.  off_obv_high    = ((high_obv - OBV_A) / high_obv) * 100;
  92.  IF CLOSE OF TODAY IS GREATER THAN HHV_A OF YESTERDAY THEN
  93.     begin
  94.       PRICE_BREAKOUT = 1;
  95.     end;
  96.  IF ((V-VOL_A)/VOL_A) >
  97.    VOL_PERCENT/100   THEN
  98.     begin
  99.       VOL_BREAKOUT = 1;
  100.     end;
  101.  IF OBV_A OF TODAY IS GREATER THAN high_obv OF YESTERDAY THEN
  102.     begin
  103.       OBV_BREAKOUT = 1;
  104.     end;
  105.  IF RS >= HIRS
  106.     begin
  107.       RELST_BREAK =1;
  108.     end;
  109.  TOTAL := TOTAL + 1;
  110.  IF VOL_BREAKOUT =1 AND OFF_HIGH_VALUE < 16
  111.    AND CLOSE OF TODAY >= CLOSE OF YESTERDAY
  112.    THEN
  113.      BEGIN
  114.         WRITE(ticker, close of yesterday,
  115.              close,INT(day_change),'%',
  116.              INT(((V-VOL_A)/VOL_A) *100),'% '
  117.              ,INT(off_high_value),'%',' ');
  118.      IF PRICE_BREAKOUT THEN
  119.         WRITE(' 30HI');
  120.      IF OBV_BREAKOUT THEN
  121.         WRITE(' OB ');
  122.      IF high_value <= h then
  123.         write(' $ ');
  124.      IF RELST_BREAK =1 then
  125.         write(' RSHI');
  126.         writeln();
  127.     GOSUB FINI;
  128.     END;
  129.  :FINI
  130.  IF LAST_TICKER THEN
  131.  BEGIN
  132.  writeln('');
  133.  writeln('');
  134.  WRITELN('Total Companies Processed','  ',INT(TOTAL));
  135.  WRITELN(' OB INDICATES NEW YEARLY ON BALANCE VOLUME HIGH');
  136.  WRITELN('  $ INDICATES NEW 52 WEEK HIGH PRICE');
  137.  WRITELN(' RSHI Indicates New Relative Strength VS SP-500 High');
  138.  writeln('\p');
  139.  END;
  140.