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

  1.  {
  2.    SCRIPT : VOLBRK3.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.  {    Following changes made by Jim Camenos 3/15/92         }
  47.  {    Add graphics to program                               }
  48.  C5 : ARRAY;             { Area for 21 day ema     }
  49.  C35: ARRAY;             { Area for 34 day ema    }
  50.  C5 = mov(c,21,'e');     { Compute the 21 day ema  }
  51.  C35 = mov(c,34,'e');    { Compute the 34 day ema }
  52.  NCHG = (C[0]-C[-1]);    { Net Price Change }
  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    = 30;
  62.   VOL_PERCENT            = 150;
  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.   high_obv : array;
  70.  PRICE_BREAKOUT = 0;
  71.  VOL_BREAKOUT   = 0;
  72.  OBV_BREAKOUT   = 0;
  73.  {**********************************************************}
  74.  {   The next few lines find the % from the 52 week high.   }
  75.  {**********************************************************}
  76.  HHV_A           = HHV(C,PRICE_BREAKOUT_PERIOD);
  77.  VOL_A           = MOV(V,VOL_BREAKOUT_PERIOD,'S');
  78.  OBV_A           = OBV();
  79.  high_value      = HHV(h,52*5);
  80.  off_high_value  = ((high_value - c[0]) / high_value) * 100;
  81.  day_change      = roc(c,1,'%');
  82.  high_obv        = HHV(OBV_A,52*5);
  83.  off_obv_high    = ((high_obv - OBV_A) / high_obv) * 100;
  84.  IF CLOSE OF TODAY IS GREATER THAN HHV_A OF YESTERDAY THEN
  85.     begin
  86.       PRICE_BREAKOUT = 1;
  87.     end;
  88.  IF VOLUME OF TODAY IS GREATER THAN
  89.    VOL_PERCENT/100 * VOL_A OF YESTERDAY THEN
  90.     begin
  91.       VOL_BREAKOUT = (VOLUME OF TODAY/VOL_A OF YESTERDAY) * 100;
  92.     end;
  93.  IF OBV_A OF TODAY IS GREATER THAN high_obv OF YESTERDAY THEN
  94.     begin
  95.       OBV_BREAKOUT = 1;
  96.     end;
  97.  TOTAL := TOTAL + 1;
  98.  IF VOL_BREAKOUT AND OFF_HIGH_VALUE < 16
  99.    AND CLOSE OF TODAY >= CLOSE OF YESTERDAY
  100.    THEN
  101.      BEGIN
  102.         WRITE(ticker,fullname, close of yesterday,
  103.              close,INT(day_change),'%',
  104.              INT(((volume/VOL_A[-1]))*100),'% '
  105.              ,INT(off_high_value),'%',' ');
  106.      IF PRICE_BREAKOUT THEN
  107.         WRITE(INT(PRICE_BREAKOUT_PERIOD),'DAY HI');
  108.      IF OBV_BREAKOUT THEN
  109.         WRITE(' OB ');
  110.      IF high_value <= h then
  111.         write(' $ ');
  112.         ELSE
  113.         writeln();
  114.  {*****************************************************************}
  115.  { Graphic additions made by Jim Camenos 3/15/92 }
  116.      OPENGRAPH(2);
  117.      SIZEGRAPH(6,2);
  118.      GRAPH(1,'High :  '+format(h[0],'%7.3f')+
  119. '  Low : '+format(l[0],'%7.3f')+'  Close : '+format(l[0],'%7.3f')+
  120. '  Chg : '+format(NCHG,'%6.3f'),
  121. C5,C35);
  122.      GRAPH(v,'Volume');
  123.      CLOSEGRAPH();
  124.  {*****************************************************************}
  125.     GOSUB FINI;
  126.     END;
  127.  :FINI
  128.  IF LAST_TICKER THEN
  129.  BEGIN
  130.  WRITELN('Total Companies Processed','  ',INT(TOTAL));
  131.  WRITELN(' OB INDICATES NEW YEARLY ON BALANCE VOLUME HIGH');
  132.  WRITELN('  $ INDICATES NEW 52 WEEK HIGH PRICE');
  133.  END;
  134.