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

  1.  {
  2.    SCRIPT : VOLBRK2.TAS
  3.    Output File => VOLBRK.LST
  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.  }
  23.  #MAX_QUOTES 262
  24.  #OUTPUT_FILE 'VOLBRK.LST+'
  25.  IF FIRST_TICKER THEN
  26.  begin
  27.  {**********************************************************}
  28.  {       Count the Total Tickers in your Directories        }
  29.  {**********************************************************}
  30.  TOTAL := 0;
  31.  WRITELN('                           Prev    Curr',
  32.         '  Price  Curr   OFF');
  33.  WRITELN('TICKER  NAME              CLOSE    CLOSE',
  34.         ' Change Vol %  HIGH');
  35.  WRITELN('------------------------ ------- -------',
  36.         ' ------ -----  ----');
  37.  end;
  38.  { #SCAN_DATE '920206' }
  39.  {**********************************************************}
  40.  { NOTE: STOCKS IN DATABASE WITH LESS THAN 262 QUOTES WILL  }
  41.  {                    NOT BE FLAGGED.                       }
  42.  {**********************************************************}
  43.  if quote_count < 262 then
  44.       GOSUB FINI;
  45.  {**********************************************************}
  46.  {              Parameter settings follow.                  }
  47.  {     These parameters can be changed to suit you.         }
  48.  {**********************************************************}
  49.  { Price breakout lookback period, Volume breakout lookback }
  50.  {      period, and Percentage for VOLUME BREAKOUT          }
  51.  {**********************************************************}
  52.   PRICE_BREAKOUT_PERIOD  = 30;
  53.   VOL_BREAKOUT_PERIOD    = 30;
  54.   VOL_PERCENT            = 150;
  55.  {**********************************************************}
  56.  { Declare various arrays to hold the results of indicators }
  57.  {**********************************************************}
  58.   HHV_A : ARRAY;    { Place to save HHV }
  59.   VOL_A : ARRAY;    { Place to save Volume Moving average }
  60.   OBV_A : ARRAY;    { Place to save On Balance Volume }
  61.   high_obv : array;
  62.  PRICE_BREAKOUT = 0;
  63.  VOL_BREAKOUT   = 0;
  64.  OBV_BREAKOUT   = 0;
  65.  {**********************************************************}
  66.  {   The next few lines find the % from the 52 week high.   }
  67.  {**********************************************************}
  68.  HHV_A           = HHV(C,PRICE_BREAKOUT_PERIOD);
  69.  VOL_A           = MOV(V,VOL_BREAKOUT_PERIOD,'S');
  70.  OBV_A           = OBV();
  71.  high_value      = HHV(h,52*5);
  72.  off_high_value  = ((high_value - c[0]) / high_value) * 100;
  73.  day_change      = roc(c,1,'%');
  74.  high_obv        = HHV(OBV_A,52*5);
  75.  off_obv_high    = ((high_obv - OBV_A) / high_obv) * 100;
  76.  IF CLOSE OF TODAY IS GREATER THAN HHV_A OF YESTERDAY THEN
  77.     begin
  78.       PRICE_BREAKOUT = 1;
  79.     end;
  80.  IF VOLUME OF TODAY IS GREATER THAN
  81.    VOL_PERCENT/100 * VOL_A OF YESTERDAY THEN
  82.     begin
  83.       VOL_BREAKOUT = (VOLUME OF TODAY/VOL_A OF YESTERDAY) * 100;
  84.     end;
  85.  IF OBV_A OF TODAY IS GREATER THAN high_obv OF YESTERDAY THEN
  86.     begin
  87.       OBV_BREAKOUT = 1;
  88.     end;
  89.  TOTAL := TOTAL + 1;
  90.  IF VOL_BREAKOUT AND OFF_HIGH_VALUE < 16
  91.    AND CLOSE OF TODAY >= CLOSE OF YESTERDAY
  92.    THEN
  93.      BEGIN
  94.         WRITE(ticker,fullname, close of yesterday,
  95.              close,INT(day_change),'%',
  96.              INT(((volume/VOL_A[-1]))*100),'% '
  97.              ,INT(off_high_value),'%',' ');
  98.      IF PRICE_BREAKOUT THEN
  99.         WRITE(INT(PRICE_BREAKOUT_PERIOD),'DAY HI');
  100.      IF OBV_BREAKOUT THEN
  101.         WRITE(' OB ');
  102.      IF high_value <= h then
  103.         write(' $ ');
  104.         ELSE
  105.         writeln();
  106.     GOSUB FINI;
  107.     END;
  108.  :FINI
  109.  IF LAST_TICKER THEN
  110.  BEGIN
  111.  WRITELN('Total Companies Processed','  ',INT(TOTAL));
  112.  WRITELN(' OB INDICATES NEW YEARLY ON BALANCE VOLUME HIGH');
  113.  WRITELN('  $ INDICATES NEW 52 WEEK HIGH PRICE');
  114.  END;
  115.  
  116.