home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / finance / tas206.zip / TAS.TXT < prev    next >
Text File  |  1991-02-17  |  79KB  |  1,824 lines

  1. 1 Introduction
  2.  
  3. "Technical Analysis Scanner(tm)" (TAS) is a software program that gives
  4. you control of your MetaStock (or ChartPro) data base using Technical
  5. Analysis Indicators and conditional relationships to "scan" all, or a
  6. portion, of your data files. TAS also contains an optional Profit Testing
  7. Facility (referred to as TAS/PT).
  8.  
  9. TAS is a generalized Technical Analysis scanning tool. It is not a "black
  10. box" system. You have complete control over the indicators chosen, their
  11. interpretation, and the output format for your reports.
  12.  
  13. With TAS, you can combine many Technical Indicators, compare their values
  14. against other indicators or values, make decisions based on the result of
  15. those comparisons, and ultimately, create a report which shows you what
  16. you want to see.
  17.  
  18. TAS is designed to enable you to go beyond the MetaStock Pro "Custom
  19. Formulas" by applying similar analysis to all or any part of the data in
  20. your Metastock (or ChartPro) Data Base. If you have a profit formula you
  21. believe is appropriate, but you do not have the time to chart all of your
  22. stocks everyday, then TAS is the tool you need. It runs your customized
  23. formula on selected groups of your stocks, and can be used to notify if
  24. your buy or sell trigger is "crossed".
  25.  
  26. TAS can also be used to create custom reports on your stocks. For example,
  27. you can use it to notify you when a particular stock has reached a certain
  28. price, volume or Technical Indicator value.
  29.  
  30. When the optional Profit Tester feature (TAS/PT) is enabled, you can
  31. confirm the profitability of your system using TAS/PT.
  32.  
  33. 2 Taking Care of Business
  34.  
  35.    2.1 Registration
  36.  
  37.    TAS is distributed as a TRIAL version. The TRIAL version of TAS has the
  38.    following restrictions:
  39.  
  40.         1)      Only 20 TICKER symbols will be accessed from a "TICKER
  41.                 LIST"
  42.  
  43.         2)      TAS cannot be run from a batch file as a DOS command
  44.  
  45.         3)      You cannot redirect the output from the TAS reports into a
  46.                 file or to the printer.
  47.  
  48.         4)      Only one TICKER will be allowed to be used with the Profit
  49.                 Test feature (TAS/PT).
  50.  
  51.         5)      The functions listed below may not be available in the
  52.                 TRIAL version.
  53.  
  54.                   Directional Movement - PDI, MDI, DX, ADX, ADXR
  55.  
  56.                   Linear Regression - LINREG, CORRCOEF, ANGLE, SLOPE
  57.  
  58.                   Intersection    - OVER, ISECT
  59.  
  60.                   Profit Tester   - BUY, SELL, STOP, TOTAL
  61.  
  62.                   Miscellaneous   - MACD, MACDTRIGGER, CCI, VOL(atility)
  63.  
  64.    When you register TAS, you will receive a "REGISTRATION CODE" that will
  65.    enable the full set of TAS features. If you register TAS/PT, there is
  66.    no limit on the number of TICKERs on which you can run the Profit Test
  67.    feature.
  68.  
  69.    You will find that running TAS from a batch file and placing the
  70.    reports into a file for inspection is more convenient on a day-to-day
  71.    basis than running the program interactively. This particular feature,
  72.    as well as the ability to scan up to 2000 stocks in one run, should
  73.    encourage you to register your version of TAS.
  74.  
  75.    Your registration entitles you to continuous updates for new TAS
  76.    features, support for TAS problems, questions and requests for new
  77.    indicators.
  78.  
  79.       2.1.1 How to Register
  80.  
  81.       In order to become a registered user of TAS or TAS/PT, please send a
  82.       check (made out to FlexSoft) for the amount of the registration fee
  83.       to:
  84.           FlexSoft
  85.           7172 Regional St, #276
  86.           Dublin, CA 94568
  87.  
  88.       2.1.2 Registration Fee
  89.  
  90.       If you register TAS alone, the registration cost is $45. If you want
  91.       TAS to include the Profit Testing support, the cost is $75.
  92.  
  93.       If you have registered PML (another product of the author's)
  94.       directly through the author (rather than in a co-sponsored package),
  95.       your TAS registration cost is $35 and the cost for TAS/PT is $60.
  96.  
  97.       If you wish to register PML and TAS together, the cost for both is
  98.       $60. Finally, the cost for PML and TAS/PT is $85.
  99.  
  100.       TAS/PT is the TAS program with the Profit Test feature enabled.
  101.       There is no separate program for TAS/PT. I could have created a
  102.       separate program for the Profit tester feature, in which case, there
  103.       would have been a separate registration required for it. For the
  104.       convenience of everyone, I chose to include the Profit Tester in TAS
  105.       with a different Registration Code to enable it. This means you
  106.       don't have to download multiple files to get both features. Also,
  107.       you can upgrade your TAS to TAS/PT by just sending me the difference
  108.       in the Registration Cost. If you do not want the Profit Tester
  109.       feature, then the price for TAS is the same as it always has been.
  110.  
  111.       The following table summarizes the registration pricing for TAS and
  112.       TAS/PT according to the discussion above.
  113.  
  114.                       TAS             TAS/PT (profit tester)
  115.                       -----           ------
  116.       Non-PML User    $45             $75
  117.       PML User        $35             $60
  118.       plus PML        $60             $85
  119.  
  120.    2.2 Support
  121.  
  122.    You can get support for TAS problems or questions by contacting me at
  123.    my mailing address (above) or by Email on the following services:
  124.        GEnie       : M.MOORE41
  125.        Prodigy     : JBMD65A
  126.        Compuserve  : 76447,2367
  127.        MCI         : M.MOORE
  128.  
  129.    If you need a new version of TAS, it will be available on the FlexSoft
  130.    BBS at 415-829-2293 (HOURS 4-7 a.m. and 3:30-7 p.m. Pacific Time or by
  131.    special arrangement). You are entitled to free updates to TAS from this
  132.    BBS or by U.S. Mail (not including shipping and handling). If you need
  133.    an update by U.S. Mail, please send $5 for shipping and handling.
  134.  
  135.    2.3 Redistribution of TAS
  136.  
  137.    You may (and are encouraged to) re-distribute TAS to other BBS systems
  138.    as long as you redistribute the entire unmodified package as you
  139.    received it. You may not redistribute your registration code along with
  140.    the package, nor may you give it away as long as you are currently
  141.    using it.
  142.  
  143.    2.4 Credits
  144.  
  145.    MetaStock Professional is a stock charting program from Equis Inc.
  146.  
  147.    ChartPro is a stock charting program written by David Rettger.
  148.  
  149.    2.5 Disclaimers
  150.  
  151.    The author claims no responsibility for any damages caused by the use
  152.    or misuse of this product.  This product is distributed "as is" with no
  153.    warranty expressed or implied.  The author will not be responsible for
  154.    any losses incurred, either directly or indirectly, by the use of this
  155.    product.  The author reserves the right to make modifications at any
  156.    time.  Prices are subject to change without notice.
  157.  
  158. 3 Installation
  159.  
  160. TAS is distributed as a .ZIP format collection of files. The name of the
  161. .ZIP file will be based on the version and release level of TAS. For
  162. version 1, release 1, the name will be 'TAS101.ZIP', and in general, the
  163. name will be 'TASvrr.ZIP' where 'v' is the Version and 'r' is the Release.
  164.  
  165.  
  166.    3.1 Quick Start Installation
  167.  
  168.    The following "quick start" documentation shows how to get TAS up and
  169.    running on your system initially. The file name for the TAS ZIP file is
  170.    referred to as "TASvrr.ZIP".
  171.  
  172.    In order to install TAS, you should perform the following steps
  173.  
  174.    1) Create a directory to contain TAS software. It can be any name you
  175.    choose. The following instructions assume the subdirectory name is
  176.    "\TAS".
  177.  
  178.    2) PKUNZIP TASvrr.ZIP into directory \TAS
  179.  
  180.    3) CD \TAS
  181.  
  182.    4) Type TAS
  183.  
  184.    5) You will be presented with a menu.
  185.  
  186.    6) Select "Configure TAS"
  187.  
  188.         Fill in the MSP directory names you want to scan. You can enter up
  189.         to 5 subdirectories
  190.  
  191.         Hit F3
  192.  
  193.    7)   Go to the "Define Ticker List" Menu
  194.         Select "Create New Ticker List"
  195.         Give the name "MYTICKS"
  196.         Move the cursor to each ticker symbol you want to run a script
  197.         against.
  198.         Hit the SPACE bar on the symbol.
  199.         It should highlight (indicating it is selected).
  200.         Hit F3 when all desired symbols are selected.
  201.  
  202.    8)  At the Main Menu, select Build or Run Selection by typing "B"
  203.  
  204.    9)  Reply to the New/Old prompt by typing "O" (for 'old').
  205.       Pick the selection MSURANK.SEL (by typing "M" or moving the
  206.        cursor to it) and hitting ENTER.
  207.        Pick the ticker list you just created "MYTICKS.TCK"
  208.  
  209.    10) You will see the MSURANK selection values. This particular
  210.       selection  will create a report like the one Metastock Utility (MSU)
  211.       creates when you select "Rank" using a 26 day Rate of Change and a
  212.       10 day Moving Average.
  213.  
  214.    11) Hit the F4 Key to run the selection. As each ticker is processed,
  215.       you will see a line in the "run" window. Once all tickers are
  216.       processed, the report will be presented on the screen, sorted by
  217.       ticker.
  218.  
  219.    12) Hit F1 now to see the choices you have. By hitting F1, you can read
  220.       the help and see what you can do from here. You can sort your
  221.       tickers on the value of any column shown, either ascending or
  222.       descending order. To sort on the values in the second column, press
  223.       the key sequence "Alt-2" (hold the ALT key and hit the number 2).
  224.  
  225.    13) To exit from the report screen, hit the ESC key.
  226.  
  227.    The documentation for the system is currently in the online help file
  228.    available by hitting the F1 key at any time.
  229.  
  230. 4 TAS Invocation
  231.  
  232. You can start TAS in "MENU MODE" by simply typing "TAS" by itself. TAS has
  233. switches available which you can specify on the command line. They are:
  234.  
  235.      -c   Eliminate CGA "snow"
  236.  
  237.      -b   Use BIOS to write to video screen. This may be necessary on some
  238.           systems which are not 100% compatible.
  239.  
  240.      -m   Use Monochrome color scheme
  241.  
  242. If you are a registered user of TAS, you can also start TAS in "batch
  243. mode" by specifying the name of a SCRIPT and the Ticker file on the
  244. command line. So, if you had a TAS script named "SELECT.TAS" and a Ticker
  245. List named "MYSTOCK.TCK", you could run the SELECT script against the
  246. stocks in the list MYSTOCK by typing:
  247.  
  248.                                TAS SELECT MYSTOCK
  249.  
  250. If you wanted TAS to process all of the stock symbols (Tickers) in your
  251. data base, you can omit the Ticker List name.
  252.  
  253. If you need to use the video flags mentioned above, they should be
  254. specified prior to the name of the script file.
  255.  
  256. 5 TAS Menu Functions
  257.  
  258. The TAS Main Menu contains a screen which has all the options you can choose
  259. when you work with TAS. The Main Menu looks like this:
  260.  
  261.  ╔════════Technical Analysis Scanner (TAS 2.5) Copyright 1990, FlexSoft══════╗
  262.  ║                               TRIAL VERSION                               ║
  263.  ║                                                                           ║
  264.  ║                                                                           ║
  265.  ║                  ┌───────────────Main Menu───────────────┐                ║
  266.  ║                  │                                       │                ║
  267.  ║                  │                                       │                ║
  268.  ║                  │    Configure TAS                      │                ║
  269.  ║                  │                                       │                ║
  270.  ║                  │    Define Ticker List                 │                ║
  271.  ║                  │                                       │                ║
  272.  ║                  │    Build or Run Selection             │                ║
  273.  ║                  │                                       │                ║
  274.  ║                  │    Edit A TAS Script                  │                ║
  275.  ║                  │                                       │                ║
  276.  ║                  │    Run TAS Script                     │                ║
  277.  ║                  │                                       │                ║
  278.  ║                  │    Quit                               │                ║
  279.  ║                  │                                       │                ║
  280.  ║                  └───────────────────────────────────────┘                ║
  281.  ║                                                                           ║
  282.  ║                                                                           ║
  283.  ╚═══════════════════════════════════════════════════════════════════════════╝
  284. ░[F1]=Help░░░░░░░░░░░░░░░░░░░░░Select Choice░░░░░░░░░░░░░░░░░[ESC]=Quit░░░
  285.  
  286.  
  287. The following sections will describe each of the options accessible from the
  288. Main Menu.
  289.  
  290.    5.1 Configuration
  291.  
  292.    The Configuration Menu is the place where you tell TAS the location of
  293.    your Metastock or ChartPro Data Directory(ies). Up to five directories
  294.    can be processed at one time.
  295.  
  296.    The configuration menu looks like this:
  297.  
  298.                    TAS Configuration and Setup
  299.    |
  300.    |
  301.    |    1st Data DIRECTORY  \MSPTEST\DATA
  302.    |    2nd Data DIRECTORY
  303.    |    3rd Data DIRECTORY
  304.    |    4th Data DIRECTORY
  305.    |    5th Data DIRECTORY
  306.    |
  307.    |    Symbol Table Size  9000  Quotes per Symbol    150
  308.    |
  309.    |    Your Name          Martin Moore
  310.    |    Registration Code  xxxxx
  311.  
  312.  
  313.    You should fill in the names of your Metastock or ChartPro Directories,
  314.    one per line above. Be sure to include the full path name, including
  315.    the first backslash character. If you have more than one directory of
  316.    data files, you can enter the other directory names on the second thru
  317.    fifth lines.
  318.  
  319.    Note that you cannot intermix directories across products. In other
  320.    words, all your directories must be either Metastock format or ChartPro
  321.    format. TAS determines the type of directory by first looking for a
  322.    file named "MASTER". If found, it assumes the directory is Metastock
  323.    format. If not found, it looks for files ending with ".PRO". If these
  324.    are found, it assumes that the directory is ChartPro data. If neither
  325.    search is satisfied, TAS issues an error message and requests that you
  326.    change the directory name.
  327.  
  328.    The SYMBOL TABLE SIZE parameter is a "tuning" value which determines
  329.    the size of the internal tables for TAS. You may need to increase the
  330.    value if you write a particularly long or complex selection script.
  331.  
  332.    The QUOTES PER SYMBOL parameter specifies how many quotes you want TAS
  333.    to read into memory when performing the selection. The higher this
  334.    number, the longer the selection will take.
  335.  
  336.    NOTE : This parameter has a very significant impact on the processing
  337.    time that TAS uses for each symbol. It should be set to as low a value
  338.    as possible (based on the time periods you use in your indicators) so
  339.    that the TAS processing is minimized.
  340.  
  341.    When you register TAS or TAS/PT, you will receive a REGISTRATION CODE
  342.    based on your Name. Whatever name you include in the file REGISTER.DOC
  343.    will be used to form an encryption code. Use the same form of your name
  344.    as sent to me in your REGISTER.DOC file. Place the REGISTRATION CODE
  345.    sent to you in the appropriate field.
  346.  
  347.    5.2 Creating TICKER Lists
  348.  
  349.    You can create "ticker lists" with TAS. A "ticker list" is a list of
  350.    stock or ticker symbols which you can name as a group. This allows you
  351.    to create individualized lists of symbols against which you can run
  352.    your TAS scripts. As an example, you could create a ticker list
  353.    containing the Dow Jones 30 Industrials, or a list containing only
  354.    stocks you hold.
  355.  
  356.    When you choose the TICKER LIST menu, you are asked if you want to
  357.    create an new list or modify an existing one.
  358.  
  359.    When you select this menu item, you will be asked if you want to create
  360.    a New Ticker List or Modify an Old Ticker List.
  361.  
  362.    If you request a new Ticker List, you will be prompted for the Ticker
  363.    List name. Enter only the filename portion, not the .TCK extension. The
  364.    file will be created in the \TAS directory.
  365.  
  366.    If you want to modify an old Ticker List, a File Name Selection Screen
  367.    will appear which contains the names of all the files in the current
  368.    directory ending with ".TCK". Move the cursor or mouse over to the
  369.    correct file name and press Enter (or double-click).
  370.  
  371.    The Ticker List screen will then appear with all the ticker symbols
  372.    contained in the MSP directories you have configured. Each symbol that
  373.    is highlighted in YELLOW has been "selected" for inclusion in the
  374.    ticker list. To select or unselect a symbol, move the cursor to the
  375.    symbol and hit the SPACE Bar. If the symbol is selected, it becomes
  376.    unselected or vice versa.
  377.  
  378.    If you want to SELECT ALL TICKERS, hit the F9 (SELECT ALL) Key. To
  379.    UNSELECT ALL TICKERS, hit the F8 (UnSELECT ALL) Key.
  380.  
  381.    Once you have created the ticker list, hit the F3 (Save) Key to save
  382.    it. If you do not want to save the list, hit the ESC (Abort) Key.
  383.  
  384.    If you want to run a TAS script against all of your data, create a new
  385.    Ticker List called "ALL". Hit the F9 Key to select all symbols. Then
  386.    hit the F3 Key to save the list.
  387.  
  388.    5.3 Build or Run Selection
  389.  
  390.    Using the BUILD SELECTION screen of TAS, you can create your own report
  391.    containing up to 7 columns of calculated formulas or data values. In
  392.    addition, you can use the Condition entry areas (below the Formulas) to
  393.    specify which conditions must be satisfied for a ticker to be included in
  394.    the report output.
  395.  
  396.    The figure below shows the equivalent of the MetaStock Utility "Rank"
  397.    option where the first formula is the Current Price ("C" is the Closing
  398.    Price), the second formula is the 26 day Rate of Change (ROC). The
  399.    third formula is the 10 day Simple Moving Average of the price. The
  400.    fourth is the 10 day Simple Moving Average of "F2", where "F2" is the
  401.    26 day ROC. Finally, the last formula F5 is the percentage by which the
  402.    Price is above or below the moving average contained in F3.
  403.  
  404.    ┌──────────────────────────TAS Selection Creation──────────────────────────┐
  405.    │                                                             Column       │
  406.    │              Enter Formulas Below, e.g. CCI(14)              Title       │
  407.    │ Formula F1  C                                               CURR PRC     │
  408.    │ Formula F2  ROC(C,26,'%')                                   %ROC/PRC     │
  409.    │ Formula F3  MOV(C,10,'S')                                   MOV AVG      │
  410.    │ Formula F4  MOV(F2,10,'S')                                  MA %ROC      │
  411.    │ Formula F5  (F1/F3-1)*100                                   %PRC MA      │
  412.    │ Formula F6                                                               │
  413.    │ Formula F7                                                               │
  414.    │                                                                          │
  415.    │                   Enter Conditions Below, e.g. F1 > F2                   │
  416.    │ Condition 1                                                              │
  417.    │ Condition 2                                                              │
  418.    │ Condition 3                                                              │
  419.    │ Condition 4                                                              │
  420.    │ Condition 5                                                              │
  421.    │ Condition 6                                                              │
  422.    │                                                                          │
  423.    │                                                                          │
  424.    │                                                                          │
  425.    └──────────────────────────────────────────────────────────────────────────┘
  426.    F1]=Help░░░[F3]=Save░░░[F4]=Run Selection░░[F7]=Formula Builder░░[ESC]=Quit░
  427.  
  428.  
  429.    You can place any formulas or data value in each of the Formula areas.
  430.    If you hit the "F7" key, a list of functions included in TAS will be
  431.    shown on the screen and you will be prompted for the parameters of the
  432.    function.
  433.  
  434.    The CONDITION entries are used to "select" only those tickers that
  435.    match the condition. The conditions are specified in terms of the
  436.    formulas given above. In the example above, if you only wanted to see
  437.    tickers whose ROC (Formula 'F2') was greater than 50, then you could
  438.    set
  439.        CONDITION 1    F2 > 50
  440.  
  441.    Also, if you had another condition, for example the current price of
  442.    the ticker is greater than $5, you could place that condition as
  443.    follows
  444.        CONDITION 2    C > 5
  445.  
  446.    and that would now select only tickers whose ROC is greater than 50 and
  447.    whose price is greater than $5.
  448.  
  449.    5.4 Editing TAS Scripts
  450.  
  451.    TAS has a built-in text editor which can be used to create and modify
  452.    TAS script files. All TAS script files end with the suffix ".TAS".
  453.  
  454.    When you select this menu item, you will be asked if you want to create
  455.    a New Script or Modify an Old Script.
  456.  
  457.    If you request a new script, you will be prompted for the script name.
  458.    Enter only the filename portion, not the .TAS extension. The file will
  459.    be created in the \TAS directory.
  460.  
  461.    If you want to modify an old script, a File Name Selection Screen will
  462.    appear which contains the names of all the files in the current
  463.    directory ending with ".TAS". Move the cursor or mouse over to the
  464.    correct file name and press Enter (or double-click).
  465.  
  466.    The editor screen will then appear with the contents of the file
  467.    displayed.
  468.  
  469.    If you need help with the editor, hit the F1 (Help) Key. You will see a
  470.    list of editor commands.
  471.  
  472.    One key available in the editor is the F7 (Formula Builder) Key. This
  473.    key will bring up a list of Technical Indicator functions and
  474.    Pre-defined Data Arrays. If you select one of the functions or arrays,
  475.    the subsequent parameters of the function (e.g. MOV "Moving Average"
  476.    requires 3 additional parameters) will be prompted. Enter each
  477.    parameter. When you are done, the formula and parameters will be placed
  478.    into your script file at the location of the cursor when you hit F7.
  479.  
  480.    When you are done with your editing, you can save the file by hitting
  481.    the F3 (Save) Key. If you do not want to save the file, hit the ESC
  482.    (Abort) Key.
  483.  
  484.    5.5 Running TAS Scripts
  485.  
  486.    If you have created a script (or are using one of the example scripts)
  487.    and you want to run it against a specific Ticker List, you should
  488.    choose the "RUN TAS Scripts" option from the Main Menu. (You must have
  489.    created at least one Ticker List before you can run TAS)
  490.  
  491.    When this option is chosen, you will be asked for the TAS script name
  492.    and the Ticker List name. Each choice will be from a list of filenames
  493.    ending with the appropriate extension (".TAS" or ".TCK"). Move the
  494.    cursor to the correct file name for each choice and hit ENTER.
  495.  
  496. 6 TAS Selection Scripts -  Description
  497.  
  498. TAS Selection reads each ticker in the TICKER LIST from the MSP data file.
  499. It reads the quotes for the file into the pre-defined data arrays up to
  500. the lower of either (1) the number specified in the QUOTES PER SYMBOL (in
  501. the Configure TAS Menu) (2) the number specified in #MAX_QUOTES in the
  502. script file itself, or (3) all the quotes in the file.
  503.  
  504. Once all the price history has been read into the data arrays, TAS
  505. "executes" the statements in the TAS script file. Once all statements in
  506. the file have been executed, TAS moves on to the next ticker symbol in the
  507. TICKER LIST.
  508.  
  509. This process continues until all the symbols in the TICKER LIST have been
  510. read or until an error is encountered in the script file.
  511.  
  512. 7 TAS Script Language
  513.  
  514. The TAS package contains numerous examples of TAS Scripts. You should
  515. print them and look at them while reading the next section. The sample
  516. scripts contain "comments" which explain what the script is doing at each
  517. point of the script.
  518.  
  519.    7.1 Syntax
  520.  
  521.    TAS Script Language (TASSL) syntax is similar to the programming
  522.    language "PASCAL". If you are fortunate enough to already know PASCAL,
  523.    then the language should be familiar to you. However, if you don't, the
  524.    following topics will give an explanation of the language.
  525.  
  526.    In the subsequent discussion, the word "statement" is used. A
  527.    "statement" is like a sentence in English. Like a sentence, it is
  528.    composed of "words" ("tokens" in computereze). There are only two kinds
  529.    of statement in TASSL, the "assignment statement" and the "IF
  530.    statement".
  531.  
  532.    A semi-colon (;) is used to tell TAS that the statement you just
  533.    entered is done. Every statement must be concluded with a semi-colon.
  534.  
  535.    Also, in the syntax descriptions below, words you must use are in UPPER
  536.    CASE, and parts of the statement that are up to you are in lower case.
  537.  
  538.       7.1.1 Building Blocks
  539.  
  540.       The "Building Blocks" of TASSL are the following types of items:
  541.  
  542.       1)      "VARIABLES". Variables are where you put values or, in the
  543.               case of "pre-defined" variables, where you get them. The
  544.               names are anything you choose, but they have to start with a
  545.               letter of the alphabet.
  546.  
  547.       2)      "ASSIGNMENT STATEMENT". The ASSIGNMENT statement (":=") is
  548.               how you can move a value from one place to another.
  549.  
  550.       3)      "ARITHMETIC Operators". These are the usual ADD(+), SUBTRACT
  551.               (-), MULTIPLY(*) and DIVIDE(/).
  552.  
  553.       4)      "FUNCTIONS". A "function" is a built-in Technical Indicator
  554.               or "output" function which usually returns a value.
  555.  
  556.       5)      IF statements. An "IF" statement is used to test a condition
  557.               or value. Once the condition is tested, you can perform
  558.               certain actions "if" it is TRUE or "if" it is false.
  559.  
  560.       6)      "BEGIN-END Blocks". A "BEGIN-END" block is a way to "group"
  561.               several statements into one. For example, the IF statement
  562.               only allows you to execute the following "statement".
  563.               However, if you use a BEGIN followed by multiple statements,
  564.               followed by an END, the whole series of statements from the
  565.               BEGIN through the END is considered to be ONE statement. It
  566.               is similar to putting parentheses around an arithmetic
  567.               expression.
  568.  
  569.       7)      "Logical AND". The AND word takes a left-hand side and a
  570.               right-hand side. If both are TRUE, the whole is TRUE.
  571.  
  572.       8)      "Logical OR". The OR word also has a left and right side. If
  573.               either is TRUE, the whole is TRUE.
  574.  
  575.       9)      "RELATION Operator". These are how you test the "relation"
  576.               between two values. The operators are:
  577.  
  578.                   EQUAL                       =
  579.                   GREATER THAN                >
  580.                   GREATER THAN OR EQUAL       >=
  581.                   LESS THAN                   <
  582.                   LESS THAN OR EQUAL          <=
  583.                   NOT EQUAL                   <>
  584.  
  585.       10)     Comments. These are used to "document" the TASSL script.
  586.               They perform no function, but only help to understand what
  587.               is going on in the general area of the script. They are good
  588.               to use and should be included in the script to make it
  589.               easier to understand.
  590.  
  591.       7.1.2 Variables
  592.  
  593.       The concept of a "variable" is difficult to communicate to anyone
  594.       who hasn't programmed before. Loosely speaking, it is a name given
  595.       to a "place" to put a "value". Think of it as a "name for a value".
  596.       Except for "pre-defined" variables (see below) you can make up the
  597.       names for the variables in your script.
  598.  
  599.       A variable name must start with an alphabetic letter, contain only
  600.       letters, numbers and underscores ("_"). Some valid names are:
  601.  
  602.           my_stuff, my_122999, my999, m9, M32_togo, Beethoven, etc
  603.  
  604.       Generally, you first use variables in "assignment statements", that
  605.       is, you first "put" something into them. Subsequently, you can use
  606.       them as values passed to functions or in an IF statement.
  607.  
  608.       7.1.3 TAS Variable Types
  609.  
  610.          7.1.3.1 "String" Variables -
  611.  
  612.          These are variables to hold text information, like "IBM", or
  613.          "THIS IS A STICK-UP".
  614.  
  615.          7.1.3.2 "Numeric" Variables
  616.  
  617.          These are variables that hold numbers, like 32, or -75.69, or
  618.          10000034.
  619.  
  620.          7.1.3.3 "Numeric Array" Variables
  621.  
  622.          These are variables that hold many numbers in an "array". All of
  623.          the numbers in the array have the same variable name; however,
  624.          you cannot "look" at them all at once.
  625.  
  626.          You must pick out one of the numbers of the array by specifying
  627.          its location in the array. The pre-defined data arrays, like H,
  628.          L, C, V (for High Price, Low Price, Closing Price and Volume) are
  629.          examples of arrays.
  630.  
  631.          If you want to refer to a closing price 10 days ago, you need to
  632.          say C[-10]. Each time you refer to an "element" of an array, you
  633.          must provide the "subscript" in square brackets, e.g. [-10],
  634.          which means "subscript minus ten".
  635.  
  636.          You can define your own variable array by "declaring" it (prior
  637.          to first using it) as follows:
  638.  
  639.                  variable_name : ARRAY;
  640.  
  641.          where 'variable_name' is the name by which you want to refer to
  642.          the array.
  643.  
  644.       7.1.4 Assignment Statement
  645.  
  646.       The Assignment Statement is used to set the contents of a variable
  647.       to the result of an "expression". An "expression" is another of
  648.       those computereze terms, but it means sequence of mathematical
  649.       operations and/or the result of a "function".
  650.  
  651.       It might help to give some examples of assignment operations:
  652.  
  653.               a := b + 3 / 4;
  654.  
  655.       The ":=" (colon-equal) is the operator that says "assign to". So,
  656.       reading the above assignment, in English, it says "add the contents
  657.       of variable 'b' to the result of dividing 3 by 4. Place this result
  658.       in variable 'a'". If variable 'b' contained 6 when this statement
  659.       was encountered, then variable 'a' would contain 6.75 (6 + 3/4).
  660.  
  661.       Another example is:
  662.  
  663.               a := (c[-1] + c[0]) / 2;
  664.  
  665.       In this example, the array 'c' is pre-defined as the "closing price
  666.       array". So, the statement is adding the closing price yesterday
  667.       (c[-1]) to the closing price today (c[0]). It is then dividing the
  668.       total of this addition by 2 and placing the result in variable 'a'.
  669.       Note the use of the parentheses to "group" the addition so that it
  670.       would be done before the division by 2. If there were no
  671.       parentheses, the result would have been considerably different.
  672.       Instead, it would have divided today's closing price by 2, added it
  673.       to yesterday's closing price, and placed the result in 'a'.
  674.  
  675.       Another example of an assignment is the result of a "function" call.
  676.       All Technical Indicators available in TAS are created by making a
  677.       "function" call. In other words, the Technical Indicator is referred
  678.       to by its name (the "function"). So, for example,
  679.  
  680.               a := mov(c,21,'E');
  681.  
  682.       calculates the 21 day exponential moving average ("mov" function) of
  683.       the closing price array. If variable 'a' has been declared to be an
  684.       ARRAY prior to this point, then 'a' contains all the moving average
  685.       "points". If 'a' has not been declared as an ARRAY, then 'a' will
  686.       contain the value of the moving average AT THE LAST POINT of the
  687.       range, i.e., today's value.
  688.  
  689.       7.1.5 Arithmetic Operators
  690.  
  691.       Arithmetic Operators are addition (plus sign '+'), subtraction
  692.       (minus sign '-'), multiplication (asterisk '*') and division (slash
  693.       '/'). When you write an arithmetic expression, you should use
  694.       parentheses to guarantee the order in which the operations are
  695.       performed. In general, division and multiplication are performed
  696.       first, then addition and subtraction.
  697.  
  698.       7.1.6 Functions
  699.  
  700.       A "function" is a reference to a "built-in" Technical Indicator
  701.       function (like "MOV(...)"), an output function (like WRITE or
  702.       WRITELN), or an array manipulation function (like DIVBY). See the
  703.       individual descriptions of each function in the MSP User's Guide for
  704.       a more complete definition of the meaning of the various Technical
  705.       Indicators.
  706.  
  707.       7.1.7 IF Statements
  708.  
  709.       The IF statement is the most powerful scanning feature of TAS. It
  710.       enables you to create complex relationships between indicators based
  711.       on their relationship with other indicators and values.
  712.  
  713.       An IF statement is written as follows:
  714.  
  715.               IF expression THEN
  716.                   statement to execute if the 'expression' is true
  717.               ELSE
  718.                   statement to execute if the 'expression' is false;
  719.  
  720.       The ELSE part of the IF statement is optional, but sometimes it is
  721.       convenient to make a two way decision about something. You could
  722.       alternatively say:
  723.  
  724.               IF expression THEN
  725.                   statement to execute if the 'expression' is true;
  726.  
  727.       The TAS language does not require you to include the word THEN after
  728.       the IF part of the statement. You must terminate each IF statement
  729.       with a semi-colon. Note, however, that IF statements containing an
  730.       ELSE part are terminated __after__ the ELSE part. For example,
  731.  
  732.               IF a > b THEN
  733.                   WRITELN('a is greater than b, hurray!')
  734.               ELSE
  735.                   WRITELN('a is not greater than b, sorry.');
  736.  
  737.       Note how there is a semi-colon on the last line, but not after the
  738.       first WRITELN. However, if you wanted to print a message only if "a"
  739.       is greater than "b", then you would say
  740.  
  741.               IF a > b THEN
  742.                   WRITELN('a is greater than b, hurray!');
  743.  
  744.       Note the semi-colon after the last line.
  745.  
  746.       7.1.8 BEGIN..END Statement
  747.  
  748.       Suppose you want to do more than one thing if the condition "a is
  749.       greater than b" is true. In that case, you would need to use a BEGIN
  750.       .. END block. A "BEGIN..END" block "groups" all statements between
  751.       the BEGIN and the END so that the entire "group" is treated as if it
  752.       were one statement.
  753.  
  754.       This is useful in the case of the IF statement, because the action
  755.       to be taken following the THEN or ELSE part of the IF can only be
  756.       one statement. But if you use the BEGIN..END block to group several
  757.       statements, the entire block is treated as a "single" statement.
  758.       Think of BEGIN..END blocks in the same way you would think of
  759.       parenthesized arithmetic expressions. You use parentheses to "group"
  760.       some operations so that they are treated as a group.
  761.  
  762.       An example of the use of the BEGIN..END block in an IF statement is
  763.       shown below:
  764.  
  765.               IF a > b THEN
  766.               BEGIN
  767.                   a := a - 1;
  768.                   b := mov(c,21,'E');
  769.                   WRITELN('New values for a and b are: ',a,' ',b);
  770.               END;
  771.  
  772.       All three statements following the BEGIN will be executed (acted
  773.       upon) if the value of "a" is greater than the value of "b". If you
  774.       had left out the BEGIN..END section, only the first statement ("a :=
  775.       a - 1") would have been done if "a > b" was true. The following two
  776.       statements would have ALWAYS been done, since they were not part of
  777.       the IF.
  778.  
  779.       7.1.9 Profit Test Statements
  780.  
  781.       Profit Test Statements are used to:
  782.  
  783.           1) Define which Technical Indicators are to be computed.
  784.  
  785.           2) Define BUY conditions
  786.  
  787.           3) Define SELL conditions
  788.  
  789.           4) Define STOP conditions
  790.  
  791.       The statments used to describe the situations above are described in
  792.       the next 4 sections.
  793.  
  794.          7.1.9.1 PLOT statement: Define Technical Indicators
  795.  
  796.          The PLOT statement is used to create the formulas or indicators which
  797.          will be used in the subsequent profit test. The PLOT statement is
  798.          executed once per ticker symbol, and must be placed prior to any of
  799.          the BUY/SELL/STOP WHEN conditions.
  800.  
  801.          The format of the PLOT statment is:
  802.  
  803.                      PLOT stmt;
  804.  
  805.          where 'stmt' can be a single statement or a BEGIN..END block. For
  806.          example, if your profit test is to test the Commodity Channel Index
  807.          (CCI) for 14 days, you could say:
  808.  
  809.                      CCI_ARRAY : ARRAY;    { Define the cci array}
  810.                      PLOT CCI_ARRAY := CCI(14);
  811.  
  812.          In the example, only one indicator is computed, so there was no need
  813.          to use the BEGIN..END block. Suppose, however, that we want to
  814.          incorporate Wilder's RSI in the profit test as well. Then we would
  815.          say:
  816.  
  817.                      CCI_ARRAY : ARRAY;    { Define the cci array}
  818.                      RSI_ARRAY : ARRAY;    { Define the rsi array}
  819.                      PLOT BEGIN
  820.                          CCI_ARRAY := CCI(14);
  821.                          RSI_ARRAY := RSI(14);
  822.                      END;   { of PLOT statement}
  823.  
  824.          7.1.9.2 BUY WHEN - Define BUY Conditions
  825.  
  826.          The BUY WHEN condition causes the profit tester to 'buy' the stock if
  827.          the condition is true.
  828.  
  829.                      BUY WHEN expression;
  830.  
  831.          where 'expression' can be any combination of logical or relational
  832.          operators.
  833.  
  834.          For example, using the last PLOT statement in the previous example, we
  835.          will issue a BUY signal when the CCI rises above -100 and the RSI is
  836.          less than 40:
  837.  
  838.                      BUY WHEN cci_array[-1] < -100
  839.                           AND cci_array[0] > -100
  840.                           AND rsi_array < 40;
  841.  
  842.          7.1.9.3 SELL WHEN - Define SELL Conditions
  843.  
  844.          The SELL WHEN condition causes the profit tester to 'sell' the stock
  845.          if the condition is true.
  846.  
  847.                      SELL WHEN expression;
  848.  
  849.          where 'expression' can be any combination of logical or relational
  850.          operators.
  851.  
  852.          For example, using the last PLOT statement in the previous example, we
  853.          will issue a SELL signal when the CCI drops below 100 and the RSI is
  854.          greater than 60:
  855.  
  856.                      SELL WHEN cci_array[-1] > 100
  857.                           AND cci_array[0] < 100
  858.                           AND rsi_array > 60;
  859.  
  860.          7.1.9.4 STOP (LONG or SHORT) Condition
  861.  
  862.          The STOP LONG and STOP SHORT statements close a "long" position or a
  863.          "short" position, respectively, but either selling or buying to cover
  864.          an open position.
  865.  
  866.          To close out a long position (by selling), the statement is:
  867.  
  868.                      STOP LONG WHEN expression;
  869.  
  870.          where 'expression' can be any combination of logical or relational
  871.          operators.
  872.  
  873.          To close out a short position (by buying), the statement is:
  874.  
  875.                      STOP SHORT WHEN expression;
  876.  
  877.          where 'expression' can be any combination of logical or relational
  878.          operators.
  879.  
  880.          Adding a long stop to the example built in the prior sections, we
  881.          could say that we want to issue a stop if, after having gone long, the
  882.          CCI drops below -100 again. In that case, we could say:
  883.  
  884.                      STOP LONG WHEN cci_array < -100;
  885.  
  886.       7.1.10 Logical Operators
  887.  
  888.       You can combine relations by using the words "AND" and "OR". They
  889.       have the same sense as in English. Whenever you use AND and OR, you
  890.       can use parentheses to group your relations to be sure they are
  891.       computed the way you want them to be understood. For example:
  892.  
  893.               IF a > b AND b = 1 THEN
  894.                   WRITELN('a is greater than b and b is equal to 1');
  895.  
  896.       This example compares "a" to "b". If "a" is greater than "b", then
  897.       it compares "b" to the number 1. If "b" is equal to 1, then the
  898.       message
  899.           a is greater than b and b is equal to 1
  900.       will be printed. If either of the "relations" (a in "relation" to b
  901.       AND b in "relation" to 1) is not true, then the WRITELN will not be
  902.       done.
  903.  
  904.       On the other hand, suppose we want to print the message if either of
  905.       the conditions is true. Then we would say:
  906.  
  907.               IF a > b OR b = 1 THEN
  908.                   WRITELN('a is greater than b OR b is equal to 1');
  909.  
  910.       In this case, it would print the message if "a" were greater than
  911.       "b" or if "b" were equal to 1.
  912.  
  913.       7.1.11 Relational Operators
  914.  
  915.       Relational Operators describe a "relationship" between the
  916.       expression on the left of the operator and the expression on the
  917.       right of the operator. For example, "a > b". 'a' is on the left
  918.       side, 'b' is on the right side, and the operator is '>' which means
  919.       "greater than".
  920.  
  921.       The operators you can use in your TASSL script are shown on the
  922.       right below:
  923.  
  924.           EQUAL                       =
  925.           GREATER THAN                >
  926.           GREATER THAN OR EQUAL       >=
  927.           LESS THAN                   <
  928.           LESS THAN OR EQUAL          <=
  929.           NOT EQUAL                   <>
  930.  
  931.       7.1.12 Comments
  932.  
  933.       Comments are surrounded on both sides by "curly braces". These are
  934.       the characters at the right of your keyboard. They look like this:
  935.           {           - Left "curly brace"
  936.           }           - Right "curly brace"
  937.  
  938.       You can place these "curly braces" around any thing in your script
  939.       file that you do not want TAS see. It is only for your eyes and the
  940.       eyes of other humans.
  941.  
  942.    7.2 Pre-Defined Variables
  943.  
  944.    Predefined Variables are variables that are "filled in" when each MSP
  945.    TICKER is processed or at specific times during the processing of
  946.    ticker files.
  947.  
  948.         TICKER            The 'ticker' symbol, e.g., AXP
  949.  
  950.         FULLNAME          The 'full name', e.g., AMERICAN EXPRESS
  951.  
  952.         QUOTE_COUNT       The number of quotes in the file
  953.  
  954.         FIRST_TICKER      Variable, which, if equal to 1 (one), indicates
  955.                           this ticker is the first to be processed.
  956.  
  957.         LAST_TICKER       Variable, which, if equal to 1 (one), indicates
  958.                           this ticker is  the last to be processed.
  959.  
  960.         DATE              The date of the latest quote in the file
  961.                           in the format YYMMDD.
  962.  
  963.         O                 The OPEN "data array"
  964.  
  965.         H                 The HIGH "data array"
  966.  
  967.         L                 The LOW  "data array"
  968.  
  969.         C                 The CLOSE "data array"
  970.  
  971.         V                 The VOLUME "data array"
  972.  
  973.         OI                The OPEN INTEREST "data array"
  974.  
  975.         P                 The "last computed" array. For example,
  976.                           X := MOV(C,30,'E')
  977.                           places the last day's 30day EMA in 'X' and
  978.                           the entire EMA array is in 'P' until another
  979.                           function is called.
  980.  
  981.         PLOT_PHASE        Variable which is set to 1 when the Profit Test
  982.                           Script is entered for the first time for a
  983.                           ticker. (TAS/PT only).
  984.  
  985.         TEST_PHASE        Variable which is set to 1 when the Profit Test
  986.                           Script is entered for the EACH quote for a
  987.                           ticker. (TAS/PT only).
  988.  
  989.         END_PHASE         Variable which is set to 1 when the Profit Test
  990.                           Script is entered for the last quote for a
  991.                           ticker. (TAS/PT only).
  992.  
  993.    7.3 Pre-defined Functions
  994.  
  995.    TAS functions which are also available in MetaStock have the same names
  996.    and (nearly the same) parameters as those documented in the MSP Custom
  997.    Formulas Section of the MSP "User's Manual".
  998.  
  999.    Functions which are unique to TAS (not shared by MetaStock) are
  1000.    described in detail in this document. The MetaStock functions are only
  1001.    summarized. Please refer to the Metastock documentation for a complete
  1002.    description of the functions and their parameters.
  1003.  
  1004.    In some instances, the parameter to an MetaStock named function has to
  1005.    have single quotes around it. This is the case with any function that
  1006.    passes a single character as a parameter, such as the last parameter in
  1007.    the "mov" (Moving Average) function.
  1008.  
  1009.       7.3.1 MSP Technical Indicators
  1010.  
  1011.       ad()         Accumulation/Distribution Array
  1012.  
  1013.       adx(p)       Average Directional Movement
  1014.  
  1015.       adxr(p)      Average Directional Movement Rating
  1016.  
  1017.       add(a,b)     Add each element of array "a"
  1018.                    to the corresponding element of
  1019.                    array "b".
  1020.  
  1021.       cci(p)       Commodity Channel Index Array
  1022.                      p = number of periods
  1023.  
  1024.       co()         Chaikin's Oscillator Array
  1025.  
  1026.       cum(a)       Cumulative Sum of Array "a"
  1027.  
  1028.       div(a,b)     Divide each element of array "a"
  1029.                    by an element of array "b".
  1030.  
  1031.       dx(p)        Directional Movement Index
  1032.  
  1033.       macd()       Moving Average Convergence/
  1034.                    Divergence
  1035.  
  1036.       mdi(p)       Minus Directional Movement
  1037.                    Indicator
  1038.  
  1039.       mo(p)        Momentum Array
  1040.                      p = number of periods
  1041.  
  1042.       mov(d,p,t)   Moving Average Array
  1043.                      d = Data Array
  1044.                      p = number of periods
  1045.                      t = Moving Average Type
  1046.                           'E' - Exponential
  1047.                           'S' - Simple
  1048.                           'W' - Weighted
  1049.  
  1050.       mul(a,b)     Multiply each element of array "a"
  1051.                    by the corresponding element of
  1052.                    array "b".
  1053.  
  1054.       neg(a)       Negative of Array "a"
  1055.  
  1056.       nvi()        Negative Volume Indicator
  1057.  
  1058.       obv()        On Balance Volume
  1059.  
  1060.       pdi(p)       Positive Directional Movement
  1061.                    Indicator
  1062.  
  1063.       pvi()        Positive Volume Indicator
  1064.  
  1065.       rsi(p)       Wilder's Relative Strength Indicator
  1066.                      p = number of periods
  1067.  
  1068.       roc(d,p,r)   Rate Of Change Array
  1069.                      d = Data Array
  1070.                      p = number of periods
  1071.                      r = ROC Type
  1072.                           '%' - percentage ROC
  1073.                           '$' - Unit ROC
  1074.  
  1075.       stoch(p,s)   Stochastic Oscillator
  1076.                      p = number of periods
  1077.                      s = k slowing periods
  1078.  
  1079.       sub(a,b)     Subtract each element of array "b"
  1080.                    from the corresponding element of
  1081.                    array "a".
  1082.  
  1083.       vol(pm,pr)   Volatility Indicator. This is the 'pr' day Rate Of
  1084.                    Change Oscillator of a 'pm' day exponential Moving
  1085.                    Average of the difference between each day's high and
  1086.                    low price.
  1087.  
  1088.       7.3.2 TAS Functions
  1089.  
  1090.       divby(a,x)    Divide each element of array "a" by the value of "x".
  1091.                     In this case, "x" is a single number.
  1092.  
  1093.       mulby(a,x)  - Multiply each element of array "a" by the value of
  1094.                     "x". In this case, "x" is a single number.
  1095.  
  1096.       int(x)        Turns the number "x" into the nearest "integer". An
  1097.                     integer is a number without a fractional part (the
  1098.                     part after the decimal). The maximum number that you
  1099.                     can turn into an integer is 32,767.
  1100.  
  1101.       isect(a,b)    Find the latest intersecting point of the two arrays
  1102.                     "a" and "b". Returns the number of days since the two
  1103.                     arrays intersected or -1 (negative one) if they have
  1104.                     never intersected.
  1105.  
  1106.                     NOTE:
  1107.                     Since the graph of the two arrays actually crosses
  1108.                     BETWEEN two days, the value returned will be the later
  1109.                     day AFTER the crossing. For example, if the arrays
  1110.                     crossed between yesterday and today, the value
  1111.                     returned will be zero. If they crossed between two
  1112.                     days ago and yesterday, the value returned will be 1,
  1113.                     and so forth.
  1114.  
  1115.       over(a,b)     If array "a" is "over" array "b", this function
  1116.                     returns the number of days since array "a" crossed
  1117.                     above array "b".  See the note under the "isect"
  1118.                     function.
  1119.  
  1120.       linreg(a,s,e) Create a linear regression line using "least-squares"
  1121.                     method to find the mathematical average of the values
  1122.                     in the array "a" starting at entry "s" and ending at
  1123.                     entry "e". If "s" is zero, it refers to the first
  1124.                     value in the array. If "e" is zero, it refers to the
  1125.                     last value in the array. Positive values for "s" or
  1126.                     "e" refer to the appropriate array entries (counting
  1127.                     from 0).
  1128.                     A negative number in the "s" or "e" index is
  1129.                     subtracted from the total number of entries in the
  1130.                     array to get the appropriate positive array index.
  1131.                     For example,
  1132.                       x : array;
  1133.                       x := linreg(c,-50,-10);
  1134.                     will find the line passing most closely through the
  1135.                     closing prices from 50 days before the last day in the
  1136.                     file to 10 days before the last day in the file.
  1137.  
  1138.       slope(a)      will return the mathematical "slope" of the line whose
  1139.                     points are contained in array "a". This array must
  1140.                     have been created with the "linreg" function.
  1141.  
  1142.       corrcoef()    returns the "correlation coefficient" of the last
  1143.                     linear regression performed. This value ranges from
  1144.                     -100 to +100. If the data points match the points in
  1145.                     the linear regression approximation, the correlation
  1146.                     coefficient will be 100. If the points show no
  1147.                     correlation with the approximation, the correlation
  1148.                     coefficient will be zero.
  1149.  
  1150.       angle(a)      returns the angle in degrees of the line described by
  1151.                     the array 'a'.
  1152.  
  1153.       7.3.3 TAS Profit Tester Functions
  1154.  
  1155.       The Profit Tester feature of TAS uses the following functions to
  1156.       indicate the buy/sell transactions controlled by a Profit Testing
  1157.       script. Refer to the script 'RSIPT.TAS' for an example of the use of
  1158.       the Profit Test functions.
  1159.  
  1160.       pt_init(m,t)  Initializes the Profit Test Feature. Clears all
  1161.                     counters to zero, prints the heading for the report.
  1162.                     The first parameter, 'm', is the amount of Money to
  1163.                     start the test with. The second parameter, 't', is the
  1164.                     type of test, 'L' = Long, 'S' = Short, 'B' = Both Long
  1165.                     and Short. This function should be called when the
  1166.                     variable PLOT_PHASE is true (1).
  1167.  
  1168.       pt_buy()      Profit Tester - Buy the stock at the current closing
  1169.                     price if not already held. If testing Short positions,
  1170.                     buy to 'cover' the short sale.
  1171.  
  1172.       pt_sell()     Profit Tester - Sell the stock at the current closing
  1173.                     price if it has been bought. If testing Short
  1174.                     positions, sell the stock short.
  1175.  
  1176.       pt_stop(t)    Profit Tester - Issue either a Long Stop or a Short
  1177.                     Stop. The parameter 't' is either 'L' for a Long Stop,
  1178.                     or 'S' for a Short Stop.
  1179.  
  1180.       pt_total()    Profit Tester - Closes out all open positions,
  1181.                     produces a Summary Report for the equity. This
  1182.                     function should be called when the variable END_PHASE
  1183.                     is true.
  1184.  
  1185.       7.3.4 Output Functions
  1186.  
  1187.       There are two output functions, WRITE and WRITELN. The WRITELN
  1188.       function is identical to the WRITE function, except that WRITELN
  1189.       causes a NEW LINE to be added at the end of the last field.
  1190.  
  1191.       The parameters to WRITE (and WRITELN) are either text strings, like
  1192.       'this is a text string', surrounded by single quotes ('), or
  1193.       "variable values". A variable value is a value that you have
  1194.       assigned to a name by use of a formula or constant setting. There
  1195.       are "pre-defined" variables, such as H, L, C, V, O, TICKER,
  1196.       FULLNAME. These pre-defined variables are "filled in" when TAS reads
  1197.       the data values for each symbol.
  1198.  
  1199.       You can control the formatting of your output to some extent by
  1200.       using the characters sequence "\t" (backslash tee) in your text
  1201.       string. This will place a "tab" character in the output. TAS places
  1202.       "tab stops" every 4 columns of the output line.
  1203.  
  1204.       In addition, the sizes of the two types of "numbers", are constant.
  1205.       If you are printing an INTEGER value, it is five characters wide,
  1206.       left-justified. If you are printing a number with a decimal point,
  1207.       it is eight characters wide (99999.999). This will allow you to line
  1208.       up the output with column headings.
  1209.  
  1210.       7.3.5 Column Headings
  1211.  
  1212.       For an example of controlling the printing of 'headings' in your TAS
  1213.       output, go to the section describing the pre-defined variable
  1214.       FIRST_TICKER. Using this variable, you can determine when to print a
  1215.       heading initially in your report.
  1216.  
  1217.       In addition, since all variables are initially set to zero before
  1218.       the first TICKER file is processed, you can use a variable to
  1219.       accumulate a "line count". You can test this variable and generate a
  1220.       new heading each time it is greater than the number of lines on your
  1221.       page (e.g. 66). An example of how to place a heading on each page of
  1222.       the report follows:
  1223.  
  1224.            IF FIRST_TICKER OR (LINE_COUNT > 65) THEN
  1225.            BEGIN
  1226.               LINE_COUNT := 0;
  1227.               WRITELN('YOUR REPORT HEADING WOULD GO HERE');
  1228.            END;
  1229.  
  1230.  
  1231.       Then, each time you wrote a line in your script you would execute
  1232.       the statement: LINE_COUNT := LINE_COUNT + 1;
  1233.  
  1234.    7.4 Putting Them Together
  1235.  
  1236.    If the script has the statements:
  1237.  
  1238.              todays_ma := mov(c,21,'E');
  1239.              diff  := c[0] - todays_ma;
  1240.              if diff > 0 then
  1241.                  writeln(TICKER, ' IS ABOVE 21 DAY EMA BY ',diff);
  1242.              else
  1243.                  writeln(TICKER, ' IS BELOW 21 DAY EMA BY ',diff);
  1244.  
  1245.    The script will print out the ticker name followed by the message
  1246.    indicating whether the latest close is above or below the 21 day EMA,
  1247.    and by how much.
  1248.  
  1249.    In this particular example, let's take a closer look at what is going
  1250.    on. In the first line,
  1251.  
  1252.        todays_ma := mov(c,21,'E');
  1253.  
  1254.    we are computing the 21 day Exponential Moving Average of the Closing
  1255.    Price Array. Once computed, we are assigning the latest value of this
  1256.    moving average to the "variable" named 'todays_ma'. You could call it
  1257.    anything you want, but giving it a name that reminds you of what it
  1258.    contains is useful.
  1259.  
  1260.    If you wanted to keep the 21-day EMA in its own array. You could
  1261.    declare the variable as follows (before using it the first time):
  1262.                big_ma_array : ARRAY;
  1263.    This tells TAS that "big_ma_array" is an array of values, not just one
  1264.    value. So, if you now said:
  1265.                big_ma_array := mov(c,21,'E');
  1266.    the contents of big_ma_array would be ALL of the Moving Average values
  1267.    up to the latest day. To refer to the value of the 21 day EMA
  1268.    yesterday, we would write "big_ma_array[-1]" where the "[-1]" refers to
  1269.    the contents of the array "-1" days from now (in other words, one day
  1270.    ago). If you wanted to refer to the 21 day EMA 10 days ago, it would be
  1271.    "big_ma_array[-10]". If you wanted to refer to the latest day's 21 day
  1272.    EMA, it would be "big_ma_array[0]" (zero days ago).
  1273.  
  1274.    The next statement in the example is:
  1275.                diff  := c[0] - todays_ma;
  1276.    which assigns to the variable "diff" the value of the latest closing
  1277.    price, "c[0]", minus the latest 21 day EMA as computed and assigned to
  1278.    the variable "todays_ma" in the previous statement.
  1279.  
  1280.  
  1281.    7.5 Pre-defined Data Arrays
  1282.  
  1283.    The Data Array field is one of the fields within
  1284.    the quote for a symbol. The names of the fields are:
  1285.        Name    Description
  1286.         H      High Price
  1287.         L      Low Price
  1288.         C      Closing Price
  1289.         V      Volume
  1290.         OI     Open Interest
  1291.         O      Open
  1292.  
  1293.    7.6 Pre-defined Values
  1294.  
  1295.       7.6.1 TICKER
  1296.  
  1297.       This is the TICKER name, left justified and padded with blanks to be
  1298.       8 characters long.
  1299.  
  1300.       7.6.2 FULLNAME
  1301.  
  1302.       This is the long name of the symbol, left justified and padded with
  1303.       blanks to be 16 characters long.
  1304.  
  1305.       7.6.3 QUOTE_COUNT
  1306.  
  1307.       This is a pre-defined value which contains the total number of
  1308.       quotes in the current data file.
  1309.  
  1310.       7.6.4 DATE
  1311.  
  1312.       The DATE variable is set to the date of the LAST quote in the file.
  1313.       It is a 'string' variable in the format YYMMDD. For example, if the
  1314.       last quote in the MSP ticker file is for Jan 4, 1991, the value of
  1315.       DATE will be '910104'.
  1316.  
  1317.       7.6.5 FIRST_TICKER
  1318.  
  1319.       This variable is set by TAS. It has a value of 1 (one) if the
  1320.       current ticker being processed is the first ticker for this script.
  1321.       This variable can be used to control the printing of headings for
  1322.       your script output. See the example below:
  1323.  
  1324.          if first_ticker then {write a heading line next }
  1325.            writeln('TICKER\t\tHIGH\tLOW\tCLOSE\tVOLUME\tDATE');
  1326.          { now, for all tickers, write the high,low,close,volume and date }
  1327.          vol := int(v[0]);     { get volume in integer format }
  1328.          writeln(ticker,'\t',h[0],'\t',l[0],'\t',c[0],'\t',vol,'\t',date);
  1329.  
  1330.       The above example will create a report that looks like the
  1331.       following:
  1332.  
  1333.       TICKER          HIGH    LOW     CLOSE   VOLUME  DATE
  1334.       ABX             21.625  21.125  21.625  2315    910103
  1335.       AAPL            44.250  43.000  43.000  13409   910103
  1336.       ARIX            0.625   0.531   0.562   33      910103
  1337.       CMNT            2.500   2.375   2.500   191     910103
  1338.       GR              38.500  37.750  38.000  517     910103
  1339.       SWZ             12.000  11.875  11.875  57      910103
  1340.       LA              13.875  13.375  13.750  2696    910103
  1341.       PCG             25.125  24.750  24.875  5592    910103
  1342.       TX              59.375  58.250  58.625  3899    910103
  1343.       UAL             113.125 111.250 112.000 2354    910103
  1344.       MXTR            5.250   5.000   5.062   2783    910103
  1345.       BP%             8.000   7.625   7.625   658     910103
  1346.  
  1347.    7.7 TAS "POUND" (#) Commands
  1348.  
  1349.    TAS "POUND" commands are used to control special script processing.
  1350.    They must begin with a "pound sign" ('#') in the first column of the
  1351.    line, and they must be completed on the same line.
  1352.  
  1353.       7.7.1 OUTPUT_FILE command
  1354.  
  1355.       You can direct the output of a script to a file by placing an
  1356.       #OUTPUT_FILE command in the script file. The #OUTPUT_FILE command
  1357.       must start in the first column of the line. It should be followed by
  1358.       the output file name surrounded by single quotes.
  1359.  
  1360.       For example,
  1361.  
  1362.            #OUTPUT_FILE 'select.lst'
  1363.  
  1364.       would place the output text of the script into the file
  1365.       'select.lst'.
  1366.  
  1367.       7.7.2 MAX_QUOTES Command
  1368.  
  1369.       You can use the #MAX_QUOTES command to limit the number of quotes
  1370.       read into a script. This value will "override" the MAXIMUM QUOTES
  1371.       you specified in the TAS Configuration Menu, for the script in which
  1372.       it is contained only.
  1373.  
  1374.       The format of the #MAX_QUOTES command is:
  1375.  
  1376.            #MAX_QUOTES nnn
  1377.  
  1378.       where "nnn" is the number of quotes to read into TAS when this
  1379.       script is processed.
  1380.  
  1381.       7.7.3 SCAN_DATE Command
  1382.  
  1383.       You can use the #SCAN_DATE command to force TAS to not process
  1384.       quotes after the date given in the command. This enables you to go
  1385.       back to a prior date and look at what the TAS script would have done
  1386.       on that date.
  1387.  
  1388.       The format of the #SCAN_DATE command is:
  1389.  
  1390.            #SCAN_DATE 'yymmdd'
  1391.  
  1392.       where yymmdd is the year, month, and day of the last quote to be
  1393.       read into TAS before the script is run. Note that you must use
  1394.       single quotes around the date given.
  1395.  
  1396.       7.7.4 PROFIT_TEST Command
  1397.  
  1398.       The #PROFIT_TEST command informs TAS of the type of profit test you
  1399.       want to run, whether you want to test "LONG" or "SHORT" positions,
  1400.       and the amount of "money" you want your position to start with. This
  1401.       command must be placed in the front of the TAS script, prior to any
  1402.       statements which do not begin with a # sign.
  1403.  
  1404.       TAS runs the profit test in two phases. The first phase, called 'PLOT
  1405.       PHASE' is when the script should compute the arrays to be tested during
  1406.       the next phase. This next phase is the 'TEST PHASE'. This phase is
  1407.       entered for the data points of the ticker file. After all data points
  1408.       have been processed, the 'END PHASE' indicator is set. Each 'phase' of
  1409.       the Profit Test process is indicated by a variable being equal to 1.
  1410.  
  1411.       The two phases are analogous to the steps you might run in Metastock
  1412.       to do the Profitability Test. First, you would plot an indicator,
  1413.       moving average, or custom formula. This is similar to the 'PLOT
  1414.       PHASE' in TAS. Next, you would run the Profit Tester specifying your
  1415.       Buy/Sell conditions. Metastock then applies your Buy/Sell signals to
  1416.       each plotted point on the graph, proceeding left to right until it
  1417.       reaches the last day loaded. This is the 'TEST PHASE' in TAS.
  1418.  
  1419.       When the TEST PHASE is entered with the last day of the ticker file,
  1420.       a variable, called 'END_PHASE' is set to 1. Testing this variable
  1421.       will allow you to print out the results for the Profit Test.
  1422.  
  1423.       For each ticker, the script is entered once for the PLOT Phase, and
  1424.       then as many times as there are data points for the TEST Phase.
  1425.  
  1426.       The format of the #PROFIT_TEST command is:
  1427.  
  1428.            #PROFIT_TEST type money
  1429.  
  1430.       where 'type' is either LONG or SHORT (for a "long" position test or
  1431.       a "short" position test) and "money" is the amount of money with
  1432.       which to start the test for each symbol.
  1433.  
  1434.       For example, if you plotted a 21 day EMA, and you were testing the
  1435.       EMA greater than the closing price, it would not make sense to call
  1436.       the TEST Phase earlier than plot entry 21. So, you would say
  1437.  
  1438. 8 TAS Script Examples
  1439.  
  1440. Included with the TAS package are several sample .TAS script files. Check
  1441. your directory after you install TAS to see the samples included.
  1442.  
  1443.    8.1 New High/New Low Example
  1444.  
  1445.    The following script is contained in file "NHNL.TAS".
  1446.  
  1447.       8.1.1 Script Contents
  1448.  
  1449.       { NHNL.TAS-
  1450.          This script example will show the 52 week high and low for each
  1451.          ticker. If the current day's high is equal to the highest high
  1452.          or the current low is equal to the lowest low, then we have a
  1453.          probable new high or new low. It might also be the case that today's
  1454.          high or low is just equal to the previous high or low.
  1455.  
  1456.          Just to make the script slightly more interesting, we will also
  1457.          compute the "percentage off from high", a frequently used metric
  1458.          seen in financial tables.
  1459.       }
  1460.       if first_ticker then
  1461.       begin
  1462.          writeln('              - CURRENT -       - 52 WEEK -     OFF');
  1463.          writeln('TICKER       HIGH      LOW     HIGH      LOW    HIGH');
  1464.       end;
  1465.       high_value := HHV(h,52*5);        { compute high over 52 weeks }
  1466.       low_value  := LLV(L,52*5);        { compute low over 52 weeks }
  1467.  
  1468.       off_high_value := ((high_value - c) / high_value) * 100;
  1469.       write(TICKER,' ',h,' ',l,' ',high_value,' ',low_value,
  1470.             '\t',INT(off_high_value),'%');
  1471.  
  1472.       if (high_value <= h) then       { today's high is new high  }
  1473.           write(' New High ');
  1474.  
  1475.       if (low_value >= l) then        { today's low is new low }
  1476.           write(' New Low  ');
  1477.  
  1478.       write('\n');        { end the line with a 'newline'}
  1479.  
  1480.       8.1.2 Script Output
  1481.  
  1482.                     - CURRENT -       - 52 WEEK -     OFF
  1483.       TICKER       HIGH      LOW     HIGH      LOW    HIGH
  1484.       ABX        21.875   21.375   24.750   15.875    13%
  1485.       AAPL       28.000   26.000   50.375   26.000    47% New Low
  1486.       ARIX        1.062    0.938    5.625    0.875    81%
  1487.       BP%        12.500   11.125   14.500    6.000    17%
  1488.       CMNT        2.312    2.188    3.500    2.063    33%
  1489.       GR         32.125   31.875   57.500   29.500    44%
  1490.       SWZ        12.125   11.750   17.500   10.875    32%
  1491.       LA         11.625   10.375   50.375    9.750    77%
  1492.       MXTR        5.625    5.250   16.500    5.250    66% New Low
  1493.       PCG        22.375   22.000   23.500   18.750    4%
  1494.       TX         61.625   60.125   68.500   49.875    12%
  1495.       UAL       110.000   99.000  286.750   87.250    64%
  1496.  
  1497.    8.2 TICKER Symbol Processing
  1498.  
  1499.    The following example shows how you could create a special script to
  1500.    notify you when certain stocks had reached prices you had set. This
  1501.    script is in "LIMIT.TAS".
  1502.  
  1503.       8.2.1 Script Contents
  1504.  
  1505.       { limit.tas
  1506.               This is an example of using a TAS script to watch your
  1507.               stocks.
  1508.  
  1509.               It checks the ticker symbol against one of several
  1510.               which you might (and I do) own. If the current close
  1511.               (shown as 'c[0]' is greater than the limit for profit
  1512.               or less than the stop loss, a message is generated.
  1513.       }
  1514.  
  1515.       stop_loss := 0;
  1516.       sell_profit := 0;
  1517.       if ticker = 'aapl' then
  1518.           if c > 47 then
  1519.               sell_profit := 1;
  1520.           else
  1521.           if c < 41 then
  1522.               stop_loss := 1;
  1523.       if ticker = 'gr' then
  1524.           if c > 43 then
  1525.               sell_profit := 1;
  1526.           else
  1527.           if c < 38 then
  1528.               stop_loss := 1;
  1529.       if ticker = 'la' then
  1530.           if c > 27 then
  1531.               sell_profit := 1;
  1532.           else
  1533.           if c < 10 then
  1534.               stop_loss := 1;
  1535.  
  1536.       if stop_loss = 1 then
  1537.           writeln(ticker, ' has reached your STOP LOSS limit. SELL');
  1538.       if sell_profit = 1 then
  1539.           writeln(ticker, ' has reached your Profit target. SELL');
  1540.  
  1541.    8.3 Directional Movement Example
  1542.  
  1543.    The following script is contained in file "DM.TAS".
  1544.  
  1545.    NOTE : This script will only work with the REGISTERED VERSION of TAS.
  1546.  
  1547.       8.3.1 Script Contents
  1548.  
  1549.       { DM.TAS
  1550.          Wilder's Directional Movement Trading Example
  1551.          This script will indicate
  1552.             a BUY signal
  1553.                if the +DI(14) crosses above -DI(14) and ADXR > 25
  1554.             a SELL signal
  1555.                if the -DI(14) crosses above +DI(14) and ADXR > 25
  1556.       }
  1557.       pdi_array : array;   { declare the +DI (Positive Directional Movement
  1558.       array}
  1559.       mdi_array : array;   { declare the -DI (Negative Directional Movement
  1560.       array}
  1561.  
  1562.       pdi_array := pdi(14);   { calculate +DI}
  1563.       mdi_array := mdi(14);   { calculate -DI}
  1564.  
  1565.       adxr_14 := adxr(14);
  1566.       if (adxr_14 > 25)   then        { AVG DX Rate of Change > 25 }
  1567.       begin
  1568.  
  1569.          if (over(pdi_array,mdi_array) = 0) then
  1570.             writeln(TICKER,' +DI crossed upward over -DI *** BUY SIGNAL ***')
  1571.          else
  1572.          if (over(mdi_array,pdi_array) = 0) then
  1573.             writeln(TICKER,' +DI crossed downward over -DI *** SELL SIGNAL***')
  1574.          else
  1575.          begin
  1576.             write(TICKER);
  1577.             write(' +DI ',pdi_array[-1],' --> ',pdi_array[0]);
  1578.             write(' -DI ',mdi_array[-1],' --> ',mdi_array[0]);
  1579.             writeln(' ADXR is ',adxr_14);
  1580.          end;
  1581.       end;
  1582.  
  1583.       8.3.2 Script Output
  1584.  
  1585.       AAPL     +DI 33.000 --> 32.000 -DI 17.000 --> 16.000 ADXR is 39.000
  1586.       ARIX     +DI 17.000 --> 23.000 -DI 16.000 --> 14.000 ADXR is 28.000
  1587.       GR       +DI 26.000 --> 28.000 -DI 34.000 --> 29.000 ADXR is 30.000
  1588.       LA       +DI crossed downward over -DI *** SELL SIGNAL ***
  1589.       UAL      +DI 44.000 --> 39.000 -DI 14.000 --> 22.000 ADXR is 36.000
  1590.       VCITX    +DI 50.000 --> 50.000 -DI 50.000 --> 50.000 ADXR is 33.000
  1591.  
  1592.    8.4 Modified "Binary Wave"
  1593.  
  1594.    The file "SELECT.TAS" contains a rather lengthy script which contains
  1595.    the logic for computing a 6 point "binary wave". The first 4 "points"
  1596.    of the wave are those described in the "MetaStock User's Manual" in
  1597.    Chapter 7, section 7.7.2 "Example Binary Waves".
  1598.  
  1599.    The final 2 points of the "binary wave" are included to show how you
  1600.    can extend the original example to compute additional indicators
  1601.    (Chaikin's Oscillator and Commodity Channel Index) which are used to
  1602.    further refine the selection.
  1603.  
  1604.    Since the file is large, it is not included in this documentation, but
  1605.    the file is included in the TAS package.
  1606.  
  1607.    NOTE : This script may only work with the REGISTERED VERSION of TAS.
  1608.  
  1609.    8.5 Profit Test Example Using RSI(14)
  1610.  
  1611.    The TAS Script file 'RSIPT.TAS' shows a Profit Test using the 14-day
  1612.    RSI.  It serves as an example of the kind of profit testing available
  1613.    with TAS/PT.
  1614.  
  1615.    NOTE : This script may only work with the REGISTERED VERSION of TAS/PT.
  1616.  
  1617.       8.5.1 Script Contents (RSIPT.TAS)
  1618.  
  1619.       {
  1620.               RSIPT.TAS
  1621.                       RSI PROFIT TEST SCRIPT EXAMPLE
  1622.                       This script will signal a SELL when the
  1623.                       RSI(14) crosses under 'rsi_upper' and a BUY when
  1624.                       RSI(14) crosses above 'rsi_lower'.
  1625.       }
  1626.       #PROFIT_TEST LONG 1000          { long positions with $1000}
  1627.       #MAX_QUOTES 300                 { only read in 300 quotes }
  1628.       #OUTPUT_FILE 'RSIPT.LST'        { assign output listing to rsipt.lst}
  1629.  
  1630.       RSI_VALUES : ARRAY;             { array containing plotted points }
  1631.       RSI_UPPER := 75;                { Upper range of RSI - point to SELL
  1632.                                         Change this if
  1633.                                         you want to test different value}
  1634.       RSI_LOWER := 50;                { Lower range of RSI - point to BUY
  1635.                                         Change this if
  1636.                                         you want to test different value}
  1637.  
  1638.       PLOT BEGIN      { This begins the "plot" of the RSI }
  1639.           RSI_VALUES := RSI(14);  { COMPUTE THE RSI(14) PLOT }
  1640.       END;
  1641.  
  1642.       BUY WHEN RSI_VALUES[-1] < RSI_LOWER AND RSI_VALUES > RSI_LOWER;
  1643.  
  1644.       SELL WHEN RSI_VALUES[-1] > RSI_UPPER  AND RSI_VALUES < RSI_UPPER;
  1645.  
  1646.       8.5.2 Script Output
  1647.  
  1648.               Technical Analysis Scanner (TAS) Profit Test
  1649.                       Wed Jan 23 16:04:23 1991
  1650.  
  1651.               3COM (COMS) From 02/21/90 To 01/22/91
  1652.               Initial Cash $ 1000.00. (Long Positions Only)
  1653.  
  1654.                                                       Trade    Total
  1655.         Date   Action  Shrs   Price  Points    Cash   Profit   Profit
  1656.       ------- -------- ---- -------- ------ -------  -------  -------
  1657.       04/06/90 Buy       75  13.250   0.000    6.25     0.00     0.00
  1658.       06/18/90 Sell      75  16.375   3.125 1234.38   234.38   234.38
  1659.       11/02/90 Buy      170   7.250   0.000    1.88     0.00   234.38
  1660.  
  1661.                      Summary for COMS
  1662.                              Long           Short            Total
  1663.       ---------------------------------------------------------------
  1664.        Trades                 2               0               2
  1665.        Profitable             1 ( 50.00%)     0 (  0.00%)     1 ( 50.00%)
  1666.        Stops                  0               0               0
  1667.        Profit $          234.38            0.00          234.38
  1668.        There is a Long Position which is still open.
  1669.        If it were liquidated at today's price of  6.375,
  1670.        the profit would be $   85.62
  1671.  
  1672.               Technical Analysis Scanner (TAS) Profit Test
  1673.                       Wed Jan 23 16:04:30 1991
  1674.  
  1675.               APPLE (AAPL) From 01/18/90 To 01/22/91
  1676.               Initial Cash $ 1000.00. (Long Positions Only)
  1677.  
  1678.                                                       Trade    Total
  1679.         Date   Action  Shrs   Price  Points    Cash   Profit   Profit
  1680.       ------- -------- ---- -------- ------ -------  -------  -------
  1681.       03/01/90 Buy       29  34.250   0.000    6.75     0.00     0.00
  1682.       03/20/90 Sell      29  41.375   7.125 1206.62   206.62   206.62
  1683.       05/07/90 Buy       29  41.500   0.000    3.12     0.00   206.62
  1684.       12/10/90 Sell      29  41.750   0.250 1213.88     7.25   213.88
  1685.  
  1686.                      Summary for AAPL
  1687.                              Long           Short            Total
  1688.       ---------------------------------------------------------------
  1689.        Trades                 2               0               2
  1690.        Profitable             2 (100.00%)     0 (  0.00%)     2 (100.00%)
  1691.        Stops                  0               0               0
  1692.        Profit $          213.88            0.00          213.88
  1693.  
  1694.  
  1695.  
  1696.                      Summary for ALL SYMBOLS
  1697.                              Long           Short            Total
  1698.       ---------------------------------------------------------------
  1699.        Trades                 4               0               4
  1700.        Profitable             3 ( 75.00%)     0 (  0.00%)     3 ( 75.00%)
  1701.        Stops                  0               0               0
  1702.        Profit $          448.25            0.00          448.25
  1703.        Profit (Including Open Positions) $               299.50
  1704.  
  1705. 9 TAS Change History
  1706.  
  1707.    9.1 Version 1.4
  1708.  
  1709.         -    Set size of INTEGER output to 5 characters, left-justified
  1710.  
  1711.         -    Set size of REAL numbers to 8 characters, left-justified
  1712.  
  1713.         -    Fixed problems with complex function nesting
  1714.  
  1715.         -    Round values of Directional Movement Indicator suite to integer
  1716.              values
  1717.  
  1718.         -    Fixed problem with declared arrays being reused for intermediate
  1719.              temporary arrays.
  1720.  
  1721.    9.2 Version 1.5 - Jan 11, 1991
  1722.  
  1723.         -    Added OBV(), PVI(), NVI(), NEG(), CUM() functions
  1724.  
  1725.         -    Fixed problem which occurred if a WRITE was called with a
  1726.              parameter which is a function returning an array. Always
  1727.              printed the address of the array rather than the last entry
  1728.              of the array.
  1729.  
  1730.         -    Fixed zero divide problem which occurred sometimes in ROC()
  1731.              function.
  1732.  
  1733.    9.3 Version 1.6 - Jan 14, 1991
  1734.  
  1735.         -    Added #OUTPUT_FILE command to allow writing script output to
  1736.              a file.
  1737.  
  1738.         -    Added #MAX_QUOTES command so that the Maximum Number of
  1739.              Quotes specified in the Configuration Menu can be over-ridden
  1740.              for individual scripts.
  1741.  
  1742.         -    Fixed inconsistencies in some of the 'tab' formatting between
  1743.              the trial version and registered version.
  1744.  
  1745.    9.4 Version 1.7 - Jan 17, 1991
  1746.  
  1747.         -    Added #SCAN_DATE command to stop loading data after a
  1748.              specific date.
  1749.  
  1750.         -    Added LINREG() 'Linear Regression' function, SLOPE() function
  1751.              and CORRCOEF() function.
  1752.  
  1753.    9.5 Version 2.0 - Jan 19, 1991
  1754.  
  1755.         -    Added #PROFIT_TEST command. This included variables
  1756.              PLOT_PHASE, TEST_PHASE, END_PHASE and LAST_TICKER. Added
  1757.              Profit Test functions PT_INIT(), PT_BUY(), PT_SELL(),
  1758.              PT_STOP(), and PT_TOTAL().
  1759.  
  1760.         -    Corrected errors in beginning of Exponential Moving Average
  1761.              and MACD array calculation.
  1762.  
  1763.         -    Added Functions ANGLE() and VOL()
  1764.  
  1765.    9.6 Version 2.1 - Jan 26, 1991
  1766.  
  1767.         -    Fixed several problems with the TAS Script Editor. Added the
  1768.              ability to 'split' a line by hitting ENTER when in INSERT
  1769.              mode.
  1770.  
  1771.    9.7 Version 2.2 - Feb 2, 1991
  1772.  
  1773.         -    Reworked PROFIT TEST features for ease of use. Added BUY/SELL
  1774.              WHEN, PLOT BEGIN...END; Removed requirement for directly
  1775.              calling the PT_xxxx functions.
  1776.  
  1777.         -    Simplified expression syntax by making AND and OR operators
  1778.              lower precedence than Relational Operators. This removes
  1779.              nearly all requirement for parentheses in statements.
  1780.  
  1781.         -    Allow '=' (equal sign) to be used for Assignment.
  1782.  
  1783.         -    Remove requirement to follow IF statement with THEN.
  1784.  
  1785.         -    Added CHARTPRO support.
  1786.  
  1787.    9.8 Version 2.3 - Feb 6, 1991
  1788.  
  1789.         -    Fixed bug in Profit Test which miscomputed the last day's
  1790.              closing price if the position was "open" at the end of the
  1791.              run.
  1792.  
  1793.         -    Made change to Wilder's RSI calculation to bring it closer to
  1794.              the Metastock calculation.
  1795.  
  1796.         -    Removed "beep" at end of TAS Run. Changed message to show
  1797.              successful run.
  1798.  
  1799.    9.9 Version 2.4 - Feb 12, 1991
  1800.  
  1801.         -    Added "Build or Run Selection" screen.
  1802.  
  1803.         -    Modified expression analyzer to allow mixing arrays and real
  1804.              values in an expression.
  1805.  
  1806.    9.10 Version 2.5 - Feb 15, 1991
  1807.  
  1808.         -    Added ability to include the heading in the PRINT function of
  1809.              the SELECTION RUN screen. Also added option to append to the
  1810.              file or replace it when printing.
  1811.  
  1812.         -    TICKER LIST menu now shows tickers sorted in alphabetical
  1813.              order.
  1814.  
  1815.    9.11 Version 2.6 - Feb 17, 1991
  1816.  
  1817.         -    Added RUN WINDOW which shows status of scanning operation.
  1818.              SCAN/RANK output goes to upper window, status output goes to
  1819.              lower window.
  1820.  
  1821.         -    Added PAUSE during run. If you type any keystroke while TAS
  1822.              is scanning a ticker, it will stop at the next ticker and
  1823.              wait for you to type another key.
  1824.