home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / EXAMPLES.ZIP / TEI.TAS < prev    next >
Text File  |  1991-11-28  |  3KB  |  67 lines

  1.  { TEI.TAS, Version 1.0
  2.    *
  3.    Script to create graphs based on the "Trend Exhaustion Index",
  4.    as defined by the January, 1991 issue of TASC (Technical Analysis
  5.    of Stocks and Commidities).  It is used to give signals for
  6.    exiting the market prior to major market declines, and is based
  7.    on the NYSE new highs and advances.
  8.    *
  9.    The ticker file coming into those program need only have two
  10.    ticker symbols: UVDV and HI-LO.
  11.    *
  12.    Note the statement "#INCLUDE SCANDATE.SUB".  In order to run this
  13.    program, a file named SCANDATE.SUB must exist.  The default file
  14.    just contains a comment ("Subroutine for possible #SCAN_DATE").
  15.    This default does NOT affect the running of the program.  But, it
  16.    will allow you to run the program from a BATch file several times
  17.    using different #SCANDATE parameters.  For example:
  18.        REM ********************************************************
  19.        REM * pgmname.BAT
  20.        REM * Run pgmname.TAS for different days
  21.        REM ********************************************************
  22.        copy   scandate.sub scandate.bak
  23.        erase  pgmname.lst
  24.        echo   #SCAN_DATE 910923   >scandate.sub
  25.        tas    pgmname  tickerlist @variable=xxx
  26.        echo   #SCAN_DATE 910930   >scandate.sub
  27.        tas    pgmname  tickerlist @variable=xxx
  28.        REM ********************************************************
  29.        REM * Reset the SCANDATE.SUB file so it won't do anything
  30.        REM ********************************************************
  31.        copy   scandate.bak scandate.sub
  32.        erase  scandate.bak
  33.    *
  34.    Created 11/28/91 by Randy Harmelink
  35.    Changed 11/28/91 by Martin Moore to use standard symbols for 
  36.                        NYSE Advancing and NYSE New Highs
  37.    }
  38.  #INCLUDE SCANDATE.SUB           { Possible #SCAN_DATE parameter }
  39.  #MAX_QUOTES 600
  40.  #INDEX 'dj-30'
  41.  {**************************************************************}
  42.  { Define arrays used in program                                }
  43.  {**************************************************************}
  44.  TEI       : Array;
  45.  NewHighs  : Array;
  46.  AdvIssues : Array;
  47.  {**************************************************************}
  48.  { Save NYSE new highs and advancing issues                     }
  49.  {**************************************************************}
  50.  NewHighs = Load('NYNH','C');
  51.  AdvIssues = Load('NYAD','C');
  52.  {**************************************************************}
  53.  { Display results when all tickers have been processed         }
  54.  { ------------------------------------------------------------ }
  55.  { Sample of manual calculation as defined by TASC:             }
  56.  {    for i = -Quote_Count + 2; i <= 0; i = i + 1;              }
  57.  {        TEI[i] := 0.82 * TEI[i-1] +                           }
  58.  {                  0.18 * (NewHighs[i] / AdvIssues[i]);        }
  59.  {**************************************************************}
  60.  if Last_Ticker then begin
  61.     TEI := mov(div(NewHighs,AdvIssues),10,'E');
  62.     opengraph(2);
  63.     graph(Index,'DJIA closing prices');
  64.     graph(TEI,'Trend Exhaustion Index');
  65.     CloseGraph();
  66.     end;
  67.