home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / tas412.zip / TAS.TXT < prev    next >
Text File  |  1992-01-18  |  224KB  |  7,045 lines

  1.  
  2.  
  3.  
  4.                          
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                       Technical
  11.  
  12.  
  13.  
  14.  
  15.                       Analysis
  16.  
  17.  
  18.  
  19.  
  20.                       Scanner
  21.  
  22.  
  23.  
  24.  
  25.                       TAS
  26.  
  27.  
  28.  
  29.                     FlexSoft
  30.                     7172 Regional Street, #276
  31.                     Dublin, CA 94568
  32.                     U.S.A.
  33.                     Voice   510-829-9733
  34.                     FAX     510-829-9733
  35.                     BBS     510-829-2293
  36.  
  37.  
  38.  
  39.  
  40.  
  41.              This document and all accompanying written and disk based
  42.              notes and specifications are copyrighted by FlexSoft.
  43.  
  44.  
  45.  
  46.  
  47.                     January 18, 1992
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                     Introduction
  65.  
  66.  
  67.           "Technical Analysis Scanner" (TAS) is a software program that
  68.           lets you analyze your MetaStock, Computrac, Investograph Plus or
  69.           ChartPro data base using technical analysis indicators and
  70.           conditional relationships to "scan" all, or a portion, of your
  71.           data files. TAS also contains a Profit Testing Facility with
  72.           which you can "back test" your historical data using nearly any
  73.           trading strategy to see how profitable it would have been.
  74.  
  75.           TAS is a generalized technical analysis "tool box". It is not a
  76.           "black box" system where you have no knowledge of the rules or
  77.           control over its decision making process.  With TAS,  you have
  78.           complete control over the indicators chosen, their
  79.           interpretation, and the output formatting of your reports.
  80.  
  81.           With TAS, you can combine over 60 built-in technical indicators,
  82.           compare their values against other indicators or values, make
  83.           decisions based on the result of those comparisons, and
  84.           ultimately, create a report which shows you what you want to see.
  85.  
  86.           TAS is designed to enable you to go beyond the MetaStock Pro
  87.           "Custom Formulas" by applying similar analysis to all, or any
  88.           part of, the data in your Metastock (or ChartPro) Data Base. If
  89.           you have a trading strategy  that relies on technical indicators
  90.           or price action, but you do not have the time to chart all of
  91.           your stocks everyday, then TAS is the tool you need. It runs your
  92.           own customized formula on selected groups of your stocks, and can
  93.           notify you if your buy or sell condition is reached.
  94.  
  95.           TAS can also be used to create custom reports on your stocks. For
  96.           example, you can use it to notify you when a particular stock has
  97.           reached a certain price, volume or technical indicator value.
  98.  
  99.           And with the Profit Tester feature  you can confirm the
  100.           profitability of your trading system. TAS goes back through your
  101.           historical data, a day at a time, applying your trading rules to
  102.           the indicators and conditions you specify. It keeps track of the
  103.           days you bought, sold or were stopped out of positions,
  104.           tabulating the results on a daily basis, or in a summary report
  105.           which tells you how your system performed.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.                  Technical Analysis Scanner (TAS)               Page 2
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                  System Requirements
  125.  
  126.           In order to use TAS, you should have the following software and
  127.           hardware configuration.
  128.  
  129.  
  130.           Hardware
  131.             Any IBM PC processor type (8088, 8086, 80x86)
  132.             A CGA, EGA, or VGA Monitor (EGA or VGA required for Charts)
  133.             Hard Disk (optional)
  134.             Microsoft or Logitech Mouse (optional)
  135.             512K minimum memory (640K better)
  136.             Expanded Memory (XMS) will be used on 286/386/486 class
  137.                machines if there is an Expanded Memory System (EMS) driver
  138.                or actual LIM 4.0 EMS memory installed.
  139.  
  140.  
  141.  
  142.           Software
  143.             DOS 2.1 or later
  144.             "Computrac" Format historical data files  used by Metastock,
  145.                Investograph Plus, and Computrac, among others
  146.                or
  147.             ChartPro or MegaTech data files
  148.                
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.                  Technical Analysis Scanner (TAS)               Page 3
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.                                 Support and Upgrades
  185.  
  186.  
  187.  
  188.  
  189.            Support
  190.  
  191.  
  192.           You can get support for TAS problems or questions by contacting
  193.           FlexSoft at its mailing address below:
  194.             FlexSoft
  195.             7172 Regional St, #276
  196.             Dublin, CA 94568
  197.  
  198.           or by telephone at 510-829-9733
  199.  
  200.           or by Email on the following services:
  201.                OnLine Service                       Userid
  202.                GEnie                                M.MOORE41
  203.                Prodigy                              JBMD65A
  204.                FlexSoft BBS (510-829-2293)          SYSOP
  205.                Compuserve                           76447,2367
  206.  
  207.  
  208.  
  209.  
  210.            Updates to TAS (Upgrades)
  211.  
  212.  
  213.           New releases of TAS may  be defined as "upgrade releases". An
  214.           Upgrade Release will require a new Registration Code and  an
  215.           Upgrade Registration Fee. When a major feature is added to TAS,
  216.           there will be a "Feature Upgrade" cost as well.
  217.  
  218.           Update versions of TAS are available , on the FlexSoft BBS at
  219.           510-829-2293.
  220.  
  221.           The FlexSoft BBS has an online order system which you can use to
  222.           purchase your new TAS update.  You will need a VISA , Mastercard,
  223.           or American Express credit card number to order your update to
  224.           TAS when using the online order system. Once your order is
  225.           confirmed, you will be given access to the "area" of the BBS that
  226.           contains the TAS update version.
  227.  
  228.           You can also obtain updates to TAS by U.S. Mail. If you need an
  229.           update by U.S. Mail, please send $5 for shipping and handling in
  230.           addition to the Update and/or Upgrade Registration Fee. Methods
  231.           of payment are by check,  money order, or VISA,  Mastercard, or
  232.  
  233.  
  234.  
  235.                  Technical Analysis Scanner (TAS)               Page 4
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.           American Express credit card number (include expiration date).
  245.  
  246.  
  247.  
  248.            Redistribution of TAS
  249.  
  250.  
  251.           You may not re-distribute TAS to BBS systems or other public
  252.           locations, nor may you copy it for other than your own use. You
  253.           may not redistribute your registration code , nor may you
  254.           transfer it or give it away to anyone else.
  255.  
  256.  
  257.  
  258.            Other FlexSoft Products
  259.  
  260.  
  261.           FlexSoft also has two companion products for users who wish to
  262.           order them. The first product is called PML and the second is
  263.           called PDL. With the combination of TAS, PML and PDL, you have
  264.           "end to end" access to your stock market data. PDL downloads the
  265.           quotes, PML updates the database, and TAS allows you to search,
  266.           analyze, report, and chart the data.  PML and PDL are described
  267.           below.
  268.  
  269.           Each of these programs can be ordered from FlexSoft or downloaded
  270.           from GEnie or Compuserve.
  271.  
  272.           PDL (Prodigy Down Loader)
  273.           PDL is a program that downloads, or captures, daily quote data
  274.           and market indices from the Prodigy Information Service. PDL can
  275.           download up to 1,000 daily quotes in a single run. If you need to
  276.           download more quotes, then you can run PDL several times. It uses
  277.           the Quote Check and Market Close features of Prodigy to obtain
  278.           the quotes, so there is no need to go into Prodigy and enter the
  279.           quotes by hand, as some systems require you do. The creation of
  280.           the ticker list of quotes to download can be done with a simple
  281.           TAS script.
  282.  
  283.           PDL also has a "vacation mode" that will enable you to go on
  284.           vacation or leave town for extended periods and still gather
  285.           daily quote data.
  286.  
  287.  
  288.           PML (Prodigy Metastock Loader)
  289.           PML converts quotes from GEnie, DowJones, Prodigy and Compuserve
  290.           into MetaStock data files and an ASCII format for input to
  291.           spreadsheets. PML produces summary reports on all your Metastock
  292.  
  293.  
  294.  
  295.                  Technical Analysis Scanner (TAS)               Page 5
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.           files whether you update the files with PML or not. Colors are
  305.           used to highlight those stocks which exceed either PRICE or
  306.           VOLUME limits you set in the installation procedure. PML also
  307.           creates a Summary Report file.
  308.  
  309.  
  310.  
  311.  
  312.            Credits
  313.  
  314.  
  315.           MetaStock Professional is a stock charting program from Equis
  316.           Inc.
  317.  
  318.           ChartPro is a stock charting program written by David Rettger.
  319.  
  320.           GEnie is a trademark of General Electric Co.
  321.  
  322.           Prodigy is a trademark of Prodigy Services Co.
  323.  
  324.  
  325.  
  326.  
  327.            Disclaimers
  328.  
  329.  
  330.           The author claims no responsibility for any damages caused by the
  331.           use or misuse of this product. This product is distributed "as
  332.           is" with no warranty expressed or implied.  The author will not
  333.           be responsible for any losses incurred, either directly or
  334.           indirectly, by the use of this product.
  335.  
  336.           The author reserves the right to make modifications at any time.
  337.           Prices are subject to change without notice.
  338.  
  339.  
  340.  
  341.  
  342.            Technical Analysis References
  343.  
  344.  
  345.           The Encyclopedia of Technical Market Indicators, Colby & Meyers,
  346.           Dow Jones Irwin Press, 1988, ISBN 1-55623-049-4
  347.           New Concepts in Technical Trading Systems, J. Welles Wilder Jr.,
  348.           Trend Research, 1978, ISBN 0-89459-027-8
  349.           The New Commodity Trading Systems and Methods, Perry J. Kaufman,
  350.           John Wiley and Sons 1987, ISBN 0-471-87879-0
  351.           Metastock Professional Users Guide, Equis International
  352.  
  353.  
  354.  
  355.                  Technical Analysis Scanner (TAS)               Page 6
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.                                    Installing TAS
  365.  
  366.           TAS is distributed as an LHARC compressed collection of files.
  367.           The name of the .EXE file will be based on the version and
  368.           release level of TAS. For version 4, release 08, the name will be
  369.           'TAS408.EXE', and in general, the name will be 'TASvrr.EXE' where
  370.           'v' is the Version and 'r' is the Release.
  371.  
  372.  
  373.  
  374.            Quick Start Installation
  375.  
  376.  
  377.           The following "quick start" documentation shows how to get TAS up
  378.           and running on your system initially. The file name for the TAS
  379.           file is referred to as "TASvrr.EXE".
  380.  
  381.           In order to install TAS, you should perform the following steps
  382.  
  383.             1. Create a directory to contain TAS software. It can be any
  384.                name you choose. The following instructions assume the
  385.                subdirectory name is "\TAS". To create a directory named
  386.                \TAS on your C: drive, type "MD C:\TAS"
  387.             2. If you received TAS on a floppy disk, copy TASvrr.EXE into
  388.                directory \TAS  by typing
  389.                  COPY A:\TAS\TASvrr.EXE C:\TAS
  390.             3. CD \TAS
  391.             4.   Type TASvrr, e.g, if the file is TAS408.EXE, type 'TAS408'
  392.             5. Type TAS  and press ENTER.
  393.             6. You will be presented with an initial screen which tells you
  394.                that you have not run TAS before. There are flashing areas
  395.                at the bottom to remind you that the F1-key is the Help key.
  396.                Hit the ESC key after reading the message.  You will see
  397.                another message indicating you have a trial version of TAS.
  398.                Once again, hit the ESC key to move to the next screen.
  399.             7. You will now be placed in the  "Configure TAS" menu screen.
  400.                Fill in the MetaStock or Chartpro directory names you want
  401.                to scan. You can enter up to 10 subdirectories and then hit
  402.                F3 to save the directories you named.
  403.  
  404.           TAS is now installed .  The following section shows how to do a
  405.           build and run a simple selection that will perform the same
  406.           function as the Metastock Utility Rank feature.
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.                  Technical Analysis Scanner (TAS)               Page 7
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.            Creating and Running a Sample Selection
  426.  
  427.  
  428.             1. Go to the Define Ticker List Menu by either typing "T" or
  429.                moving the cursor bar down to that selection and pressing
  430.                ENTER. If you have a mouse, you can click on the menu item.
  431.             2. Select New Ticker List from the next prompt.
  432.             3. Give the name "MYTICKS" . This will be the name of a ticker
  433.                list for testing.
  434.             4. After a moment, TAS will present you with a list of all the
  435.                tickers it found in the Data Directories you defined in the
  436.                Configure TAS screen. Move the cursor to each ticker symbol
  437.                you want to run a script against. Hit the SPACE bar on the
  438.                symbol.  It should highlight (indicating it is selected).
  439.                Hit F3 when all desired symbols are selected. This will save
  440.                the ticker list you just created.
  441.             5. At the Main Menu, select Build or Run Selection by typing
  442.                "B"
  443.             6. Select Use Old from the Build or Run Selection Menu
  444.             7. Pick the selection MSURANK.SEL (by typing "M" or moving the
  445.                cursor to it) and hitting ENTER.
  446.             8. Hit the F4 function key to "RUN" the MSURANK selection
  447.                script. TAS will now display a screen containing all the
  448.                ticker lists available to use. You will be asked which
  449.                ticker list you wish to use when you run this script.
  450.             9. Pick the ticker list you just created "MYTICKS.TCK" by
  451.                moving the cursor or mouse to the file name and pressing
  452.                ENTER or clicking on the filename.  This particular
  453.                selection  will create a report like the one Metastock
  454.                Utility (MSU) creates when you select "Rank" using a 26 day
  455.                Rate of Change and a 10 day Moving Average.
  456.             10.  Now TAS runs the script with the ticker symbols you put in
  457.                the ticker list. As each ticker is processed, you will see a
  458.                line in the "run" window. Once all tickers are processed,
  459.                the report will be presented on the screen, sorted by
  460.                ticker.
  461.             11.  Hit F1 now to see the choices you have. By hitting F1, you
  462.                can read the help and see what you can do from here. You can
  463.                sort your tickers on the value of any column shown, either
  464.                ascending or descending order. To sort on the values in the
  465.                second column, press the key sequence Alt-2 (hold the ALT
  466.                key and hit the number 2).
  467.             12.  To exit from the report screen, hit the ESC key.
  468.  
  469.           The documentation for the system is in the online help file
  470.           available by hitting the F1 key at any time.
  471.  
  472.  
  473.  
  474.  
  475.                  Technical Analysis Scanner (TAS)               Page 8
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.                                      Running TAS
  485.  
  486.           In general, you can start TAS with the following format command:
  487.            TAS [switches] [scriptName] [tickerListName]  [@parameters]
  488.  
  489.           The options in brackets are optional and need not be specified.
  490.  
  491.           You can start TAS in "MENU MODE" by simply typing "TAS" by
  492.           itself. TAS has switches available which you can specify on the
  493.           command line. They are:
  494.  
  495.             -c Eliminate CGA "snow"
  496.  
  497.             -b Use BIOS to write to video screen. This may be necessary on
  498.                some systems which are not 100% compatible.
  499.  
  500.             -m Use Monochrome color scheme
  501.  
  502.           If you are a registered user of TAS, you can also start TAS in
  503.           "batch mode" by specifying the name of a SCRIPT, the scriptName,
  504.           and the Ticker List, the tickerName, on the command line. So, if
  505.           you had a TAS script named "SELECT.TAS" and a Ticker List named
  506.           "MYSTOCK.TCK", you could run the SELECT script against the stocks
  507.           in the list MYSTOCK by typing:
  508.  
  509.             TAS SELECT MYSTOCK
  510.  
  511.           If you wanted TAS to process all of the stock symbols (Tickers)
  512.           in your data base, you can omit the Ticker List name.
  513.  
  514.           You can also specify initial script statements to be executed at
  515.           the beginning of the script by specifying parameters on the
  516.           command line, preceded by the "@" sign. Each statement should be
  517.           terminated by a semi-colon, just as it would be if it were
  518.           inserted at the beginning of the script. See the section titled
  519.           "Syntax" beginning on page  for a description of script
  520.           statements.
  521.  
  522.  
  523.  
  524.  
  525.            TAS Menus
  526.  
  527.  
  528.           The TAS Main Menu contains a screen which has all the options you
  529.           can choose when you work with TAS. The Main Menu looks like the
  530.           figure below.
  531.  
  532.  
  533.  
  534.  
  535.                  Technical Analysis Scanner (TAS)               Page 9
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.           The following sections will describe each of the options
  545.           accessible from the Main Menu.
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                  Technical Analysis Scanner (TAS)               Page 10
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.                  Technical Analysis Scanner (TAS v.rr) Copyright 1991,
  606.                       Main Menu
  607.  
  608.  
  609.                       Configure TAS
  610.  
  611.                       Define Ticker List
  612.  
  613.                       Build or Run Selection
  614.  
  615.                       Build or Run Profit Test
  616.  
  617.                       Edit A TAS Script
  618.  
  619.                       Run TAS Script
  620.  
  621.                       Quit
  622.  
  623.  
  624.            [F1]=Help               Select Choice          [ESC]=Quit
  625.  
  626.  
  627.           Special Keys within TAS
  628.  
  629.             F1      The F1 key is the HELP Key. This key will cause a help
  630.                     screen to be display when you press it. The help topic
  631.                     will be for the current cursor location (i.e., "context
  632.                     sensitive help").
  633.  
  634.             ALT-X   The ALT-X key will exit from TAS to DOS. This will
  635.                     allow you to do a few things outside of TAS. Because
  636.                     TAS is a large program, you won't have a a great deal
  637.                     of storage left when  you exit to DOS. To return to TAS
  638.                     from DOS, type "EXIT".
  639.  
  640.             ALT-M   The ALT-M key will tell you how much memory is
  641.                     available to TAS and the maximum size used of the
  642.                     SYMBOL TABLE. This key will also display the amount of
  643.                     EMS memory used by the program as well as the video
  644.                     display parameters detected by the program.
  645.  
  646.             ESC     The ESC key will always leave the screen or prompt you
  647.                     are in and  immediately "pop" you back to the previous
  648.                     menu.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                  Technical Analysis Scanner (TAS)               Page 11
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.             CTRL-BRK The CTRL-BRK key can be used to stop a TAS when it is
  665.                     running. Any other key pressed during the execution of
  666.                     a TAS script will cause the display to pause, awaiting
  667.                     another key press.
  668.  
  669.  
  670.  
  671.            Error Processing
  672.  
  673.  
  674.           When an error is detected in a TAS script, selection, or profit
  675.           test, TAS will attempt to isolate the cause of the error and
  676.           display an error message as well as an information screen that
  677.           describes the cause of the error and a recommendation for fixing
  678.           the error.
  679.  
  680.           The script line number and column where the error was detected is
  681.           also given to you to further isolate the problem.  Below is an
  682.           example of an error detected in a Selection Script. Note the
  683.           error message next to the line in error and the explanation at
  684.           the bottom of the page.
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.                  Technical Analysis Scanner (TAS)               Page 12
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.            #MAX_QUOTES 31
  726.            F1 : ARRAY;
  727.            F1 = MOV(c,10,'S')x; { <----- ERROR#60:Don't know what to do
  728.            with "X" }
  729.            F2 : ARRAY;
  730.            F2 = MOV(c,30,'S');
  731.            F3 : ARRAY;
  732.            F3 = f2-f1;
  733.            C1 = ISECT(f1,f2)=0;
  734.  
  735.            +--------------------------TAS ERROR 60 Has Occurred----------
  736.            --------------------+
  737.  
  738.            The following error has been detected around Line 3, Column 20
  739.            ERROR#60:Don't know what to do with "X"
  740.                                 Press ESC to continue
  741.            -----------------------Explanation for Error Number 60--------
  742.            ------------------------+
  743.            Cause:
  744.            TAS syntax check has encountered a symbol or word that is
  745.            either
  746.            misplaced, mis-spelled, or preceded by a word that might be
  747.            mis-spelled.
  748.            Recommendation:
  749.            Check the spelling of the word pointed out and the previous
  750.            word.
  751.            Also, check that you are using it in accordance with the
  752.            description given in the User's Guide.
  753.  
  754.  
  755.  
  756.  
  757.  
  758.            CONFIGURE TAS - Configuration and Setup
  759.  
  760.  
  761.           The Configuration Menu is used to tell TAS the location of your
  762.           Metastock or ChartPro Data Directory(ies). Up to ten directories
  763.           can be defined on the Configuration Menu, and up to twenty
  764.           directories can be processed at one time.
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.                  Technical Analysis Scanner (TAS)               Page 13
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.           The configuration menu looks like this:
  785.  
  786.  
  787.  
  788.                     TAS Configuration and Setup
  789.  
  790.                          
  791.  
  792.  
  793.  
  794.             1st Data DIRECTORY      \MSPTEST\DATA_A_E
  795.  
  796.             2nd Data DIRECTORY        \MSPTEST\DATA_F_P
  797.  
  798.             3rd Data DIRECTORY        \MSPTEST\DATA_Q_Z
  799.  
  800.             4th Data DIRECTORY
  801.  
  802.             5th Data DIRECTORY
  803.  
  804.               .
  805.  
  806.             10th Data DIRECTORY
  807.  
  808.  
  809.  
  810.  
  811.  
  812.             Include Ticker Period
  813.  
  814.  
  815.  
  816.             Symbol Table Size 9000  Quotes per Symbol   50   Use EMS
  817.            Arrays Y
  818.  
  819.  
  820.  
  821.             Your Name              John Doe
  822.  
  823.             Registration Code      02125F3012
  824.  
  825.  
  826.  
  827.  
  828.  
  829.           DATA DIRECTORY(S)
  830.           You should fill in the names of your Metastock or ChartPro
  831.           Directories, one per line above. Be sure to include the full path
  832.  
  833.  
  834.  
  835.                  Technical Analysis Scanner (TAS)               Page 14
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.           name, including the first backslash character. If you have more
  845.           than one directory of data files, you can enter the other
  846.           directory names on the second thru tenth lines.
  847.  
  848.  
  849.  
  850.            You cannot intermix directories across products. In other
  851.            words, all 10 of your directories must be either Metastock
  852.            format or ChartPro format. TAS determines the type of
  853.            directory by first looking for a file named "MASTER" in the
  854.            first directory. If found, it assumes all  directories are
  855.            Metastock format. If not found, it looks for files ending
  856.            with ".PRO". If these are found, it assumes that all
  857.            directories are ChartPro data. If neither search is
  858.            satisfied, TAS issues an error message and requests that you
  859.            change the directory name.
  860.  
  861.  
  862.  
  863.           If you have more than 10 Metastock format directories, you can
  864.           add the 11th through the 20th directory names in the file TAS.CNF
  865.           manually with an editor by adding lines like the one below:.
  866.                MSP_DATA_DIRxx = \MSPTEST\DATA_A_E
  867.           where xx is 10 to 19 for the eleventh through the twentieth
  868.           directory.
  869.  
  870.  
  871.           INCLUDE TICKER PERIOD
  872.           This parameter should be set to "Y" if you have multiple tickers
  873.           with the same ticker symbol but different "periods". For example,
  874.           if you have a DAILY and a WEEKLY file for the symbol AAPL, you
  875.           will need to set this value to "Y" in order to distinguish
  876.           between the daily and weekly ticker files.
  877.  
  878.  
  879.  
  880.            If you have TICKER LISTS created with this value set to "Y",
  881.            they will not work if you change this value to "N" (and vice
  882.            versa). You will have to re-select the tickers again. TAS is
  883.            distributed with this value unset (which means "No"). Note
  884.            also, that if you have this value set to "Y", you must include
  885.            the ticker file period in every reference to a ticker name,
  886.            including references on the #INDEX command.
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.                  Technical Analysis Scanner (TAS)               Page 15
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.           SYMBOL TABLE SIZE
  905.           The SYMBOL TABLE SIZE parameter is a "tuning" value which
  906.           determines the size of the internal tables for TAS. You may need
  907.           to increase the value if you write a particularly long or complex
  908.           selection script. If you specify any value less than 9000, TAS
  909.           will use 9000 as the value.
  910.  
  911.           From time to time, as more functions are added to TAS, there is a
  912.           natural increase in the SYMBOL TABLE SIZE needed for TAS
  913.           functions. So, it may be the case that your symbol table is
  914.           adequate for an earlier release of TAS, but needs to be increased
  915.           for a new release. Try adding a couple of thousand to whatever
  916.           value you currently have until your script works.
  917.  
  918.  
  919.  
  920.            If you want to see the amount of SYMBOL TABLE your TAS scripts
  921.            are using, you can type the ALT-M key to display the memory
  922.            usage of TAS. One of the values shown is the maximum SYMBOL
  923.            TABLE SIZE used so far.
  924.  
  925.  
  926.  
  927.           QUOTES PER SYMBOL
  928.           The QUOTES PER SYMBOL parameter specifies how many quotes you
  929.           want TAS to read into memory when performing the selection. The
  930.           higher this number, the longer the selection will take.
  931.           See the section below under Use EMS Arrays for the effect of this
  932.           setting on the usage of EMS memory and processing time.
  933.  
  934.  
  935.            This parameter has a very significant impact on the processing
  936.            time that TAS uses for each symbol. It should be set to as low
  937.            a value as possible (based on the time periods you use in your
  938.            indicators) so that the TAS processing is minimized.
  939.  
  940.  
  941.  
  942.           Use EMS Arrays
  943.           If you have EMS (Expanded Memory) or XMS (eXtended Memory)
  944.           installed with suitable driver software1, you can set this value
  945.           ____________________
  946.           1  Most systems today do not actually have EMS memory., but
  947.           instead have Extended Memory (XMS), the kind that is built-in to
  948.           new 386 and 486 systems. The term EMS actually refers to a
  949.           software/hardware standard that is emulated by driver programs
  950.           from various vendors, such as QuarterDeck Office Systems (QEMM
  951.           and DesqView/386) as well as Microsoft's EMM386 program.    
  952.  
  953.  
  954.  
  955.                  Technical Analysis Scanner (TAS)               Page 16
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.           to Y to take advantage of the extra memory you have above the
  965.           640K DOS limit.
  966.  
  967.           TAS will automatically determine if you have EMS memory
  968.           installed, and if so, it will always use that memory for a
  969.           "swapping area", reducing the amount of disk reads required to
  970.           run the program.
  971.  
  972.           In addition, if you set this parameter to Y, and you have
  973.           requested more arrays or set  Quotes per Symbol high enough so
  974.           that product of all the array sizes times the number of arrays
  975.           needed is greater than the amount of  memory available in the DOS
  976.           640K region, TAS will swap arrays into and out of EMS memory.
  977.           This swapping of arrays can slow TAS processing somewhat, but it
  978.           allows you to set Quotes per Symbol to a maximum value.
  979.  
  980.           REGISTRATION CODE
  981.           When you register TAS , you will receive a REGISTRATION CODE
  982.           based on your Name. Whatever name you include in the file
  983.           REGISTER.DOC will be used to form an encrypted code. Use the same
  984.           name as sent  in the  REGISTER.DOC file. Place the REGISTRATION
  985.           CODE sent to you in the appropriate field.
  986.  
  987.  
  988.  
  989.            DEFINE TICKER LIST
  990.  
  991.  
  992.           You can create "ticker lists" with TAS. A "ticker list" is a list
  993.           of stock or ticker symbols which you can name as a group. This
  994.           allows you to create individualized lists of symbols against
  995.           which you can run your TAS scripts. As an example, you could
  996.           create a ticker list containing the Dow Jones 30 Industrials, or
  997.           a list containing only stocks you hold.
  998.  
  999.           When you choose the TICKER LIST menu, you are asked if you want
  1000.           to create a New Ticker List or Modify an Old Ticker List.
  1001.  
  1002.           If you request a new Ticker List, you will be prompted for the
  1003.           Ticker List name. Enter only the filename portion, not the .TCK
  1004.           extension. The file will be created in the \TAS directory.
  1005.  
  1006.           If you want to Modify an Old Ticker List, a File Name Selection
  1007.           Screen will appear which contains the names of all the files in
  1008.           the current directory ending with ".TCK". Move the cursor or
  1009.           mouse over to the correct file name and press Enter (or
  1010.           double-click).  Directories will also be displayed in this
  1011.           screen, so if your ticker list is in another directory, you can
  1012.  
  1013.  
  1014.  
  1015.                  Technical Analysis Scanner (TAS)               Page 17
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.           change to that directory by moving the cursor to the directory
  1025.           name and pressing ENTER.
  1026.  
  1027.           The Ticker List screen will then appear with all the ticker
  1028.           symbols contained in the MetaStock directories you have
  1029.           configured. Each symbol that is highlighted in YELLOW has been
  1030.           "selected" for inclusion in the ticker list. To select or
  1031.           unselect a symbol, move the cursor to the symbol and hit the
  1032.           SPACE Bar. If the symbol is selected, it becomes unselected or
  1033.           vice versa.
  1034.  
  1035.           If you want to SELECT ALL TICKERS, hit the F9 (SELECT ALL) Key.
  1036.  
  1037.           To UNSELECT ALL TICKERS, hit the F8 (UnSELECT ALL) Key.
  1038.  
  1039.           Once you have created the ticker list, hit the F3 (Save) Key to
  1040.           save it. If you do not want to save the list, hit the ESC (Abort)
  1041.           Key.
  1042.  
  1043.           If you want to run a TAS script against all of your data, create
  1044.           a new Ticker List called "ALL". Hit the F9 Key to select all
  1045.           symbols. Then hit the F3 Key to save the list.
  1046.  
  1047.  
  1048.            If you have set the CONFIGURATION option INCLUDE TICKER PERIOD
  1049.            to "Y", your ticker names will be followed by a slash and the
  1050.            period of the file, e.g. "AAPL/D" for APPLE COMPUTER Daily
  1051.            data. The period is not available with ChartPro data files.
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.            BUILD OR RUN SELECTION
  1058.  
  1059.  
  1060.           Using the BUILD SELECTION screen of TAS, you can create your own
  1061.           report containing up to 7 columns of calculated formulas or data
  1062.           values. In addition, you can use the Condition entry areas (below
  1063.           the Formulas) to specify which conditions must be satisfied for a
  1064.           ticker to be included in the report output.
  1065.  
  1066.           The figure below shows the equivalent of the MetaStock Utility
  1067.           "Rank" option where the first formula is the Current Price ("C"
  1068.           is the Closing Price), the second formula is the 26 day Rate of
  1069.           Change (ROC). The third formula is the 10 day Simple Moving
  1070.           Average of the price. The fourth is the 10 day Simple Moving
  1071.           Average of "F2", where "F2" is the 26 day ROC. Finally, the last
  1072.  
  1073.  
  1074.  
  1075.                  Technical Analysis Scanner (TAS)               Page 18
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.           formula F5 is the percentage by which the Price is above or below
  1085.           the moving average contained in F3.
  1086.  
  1087.  
  1088.                TAS Selection Creation
  1089.  
  1090.            Enter Formulas Below, e.g. CCI(14)                Title
  1091.            Formula F1  C                   CURR PRC
  1092.            Formula F2  ROC(C,26,'%')       %ROC/PRC
  1093.            Formula F3  MOV(C,10,'S')       MOV AVG
  1094.            Formula F4  MOV(F2,10,'S')         MA %ROC
  1095.            Formula F5  (F1/F3-1)*100          %PRC MA
  1096.            Formula F6
  1097.            Formula F7
  1098.  
  1099.            Enter Conditions Below, e.g. F1 > F2
  1100.            Condition 1
  1101.            Condition 2
  1102.            Condition 3
  1103.            Condition 4
  1104.            Condition 5
  1105.            Condition 6
  1106.  
  1107.            F1]=Help [F3]=Save [F4]=Run [F5]=Options [F7]=Formula Builder
  1108.            ESC]=Quit
  1109.  
  1110.  
  1111.  
  1112.  
  1113.           You can place any formulas or data value in each of the Formula
  1114.           areas. If you hit the F7 key, a list of functions included in TAS
  1115.           will be shown on the screen and you will be prompted for the
  1116.           parameters of the function.
  1117.  
  1118.           The CONDITION entries are used to "select" only those tickers
  1119.           that match all the conditions specified. The conditions are
  1120.           specified in terms of the formulas given above. In the example
  1121.           above, if you only wanted to see tickers whose ROC (Formula 'F2')
  1122.           was greater than 50, then you could set
  1123.             CONDITION 1    F2 > 50
  1124.  
  1125.           Also, if you had another condition, for example the current price
  1126.           of the ticker is greater than $5, you could place that condition
  1127.           as follows
  1128.             CONDITION 2    C > 5
  1129.  
  1130.           and that would select only tickers whose ROC is greater than 50
  1131.           and whose price is greater than 5.
  1132.  
  1133.  
  1134.  
  1135.                  Technical Analysis Scanner (TAS)               Page 19
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.           Selection Build Options
  1145.           The OPTION Key (F5) allows you to set options for the SELECTION,
  1146.           such as the MAXIMUM QUOTES to read, and any INDEX file you might
  1147.           want to use. Be sure to use the F3 key (SAVE) if you are in the
  1148.           OPTION screen to save your options.
  1149.  
  1150.  
  1151.                  Set Selection Options
  1152.  
  1153.  
  1154.             INDEX Ticker SP-500     Maximum Quotes   200
  1155.  
  1156.             Start Date     /   /     End Date       /   /
  1157.  
  1158.  
  1159.           Index Ticker
  1160.           If you want to run a profit test that uses some index, such as
  1161.           the SP-500, you can specify the ticker here. Then, in your profit
  1162.           test, you refer to the index ticker's value with the INDEX array
  1163.           name.
  1164.  
  1165.           Maximum Quotes
  1166.           You can specify the maximum number of quotes to load for the
  1167.           profit test. This number should be less than or equal to the
  1168.           Maximum Quotes per Symbol setting in your Configuration Menu.
  1169.  
  1170.  
  1171.           Start Date
  1172.           If you want to start your test on a specific date, specify that
  1173.           date here. Make sure that the date is a date you have in the
  1174.           file. If it is not, the test will begin on the first date prior
  1175.           to that date.
  1176.  
  1177.           End Date
  1178.           If you want to end your test on a specific date, specify that
  1179.           date here. Make sure that the date is one you have in the file.
  1180.           If it is not, the test will end on the first date prior to the
  1181.           end date.
  1182.  
  1183.           Running Your Selection
  1184.           Once your SELECTION is built, you can run it using the F4 Key.
  1185.           You will be asked for a TICKER LIST against which to run the
  1186.           SELECTION. Choose one.
  1187.  
  1188.           Once the SELECTION starts running, there is no output to the main
  1189.           part of the screen until the SELECTION completes. At that point,
  1190.           a "report" will display on your screen with the TICKER in the
  1191.           first column and the formula values you set up for F1 through F7
  1192.  
  1193.  
  1194.  
  1195.                  Technical Analysis Scanner (TAS)               Page 20
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.           in each column.
  1205.  
  1206.           Sorting on Selected Columns
  1207.           You can SORT your report by the contents of any column by typing
  1208.           the ALT key at the same time as you hold down the number over the
  1209.           column you want to sort on.
  1210.  
  1211.           For example, to sort on the contents of the column next to TICKER
  1212.           (this would be column numbered "2"), you would type ALT-2 key
  1213.           pair. If you want to change the order of the sorting from
  1214.           ascending order to descending order, type ALT-D (for
  1215.           "Descending"). To go back to ascending order, type ALT-A. Once
  1216.           you have set the sorting direction, you can then resort using a
  1217.           ALT-column_number again.
  1218.  
  1219.  
  1220.           Printing Your Selection Report
  1221.           To PRINT the contents of your report in the current sort order,
  1222.           type ALT-P. If you want to print to a file, enter a file name.
  1223.  
  1224.  
  1225.  
  1226.            To print to your PRINTER, type LPT1 or PRN (or whatever
  1227.            address your printer is hooked up to) in the file name prompt.
  1228.  
  1229.  
  1230.  
  1231.  
  1232.           Errors In Selection Formulas
  1233.           If you have any errors in the SELECTION you have created, you
  1234.           will be told about them when you try to run the SELECTION. An
  1235.           error message  will be displayed and then the TAS EDITOR will be
  1236.           run with a dummy file called _RUNSEL.TAS. This file is the file
  1237.           that is created from your SELECTION. It is a special form of a
  1238.           TAS script. You should recognize the formulas though, since they
  1239.           are the ones you entered in your SELECTION.
  1240.  
  1241.           The EDIT screen will redisplay the error message and the
  1242.           explanation of the error at the bottom of the screen. Hit the ESC
  1243.           key and the cursor will be placed near the place where the error
  1244.           was found. In addition, the error message will be placed in the
  1245.           file to the right of the line in error. Look at the formula or
  1246.           condition and try to figure out what the problem is.
  1247.  
  1248.           You are only half done though. Now you have to go back to your
  1249.           BUILD SELECTION screen (by typing ESC) and fix the formula(s) in
  1250.           that screen. Do not try to fix the problem in the TAS Editor
  1251.           screen, since this is just a temporary view of the actual
  1252.  
  1253.  
  1254.  
  1255.                  Technical Analysis Scanner (TAS)               Page 21
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.           Selection file. Once you have corrected the error in the
  1265.           Selection screen, be sure to save (by hitting F3) your file.
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                  Technical Analysis Scanner (TAS)               Page 22
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.            BUILD OR RUN PROFIT TEST
  1326.  
  1327.  
  1328.           The BUILD OR RUN PROFIT TEST screen is similar to the BUILD
  1329.           SELECTION screen in appearance. Shown below is a sample of the
  1330.           Build Profit Test screen.
  1331.  
  1332.  
  1333.             TAS Build/Run Profit Test
  1334.  
  1335.            Enter Plot Formulas Below, e.g. CCI(14)
  1336.  
  1337.            Formula F1    RSI(14)
  1338.  
  1339.            Formula F2
  1340.  
  1341.            Formula F3
  1342.  
  1343.            Formula F4
  1344.  
  1345.            Formula F5
  1346.  
  1347.            Formula F6
  1348.  
  1349.            Formula F7
  1350.  
  1351.            Enter Buy/Sell Conditions below  e.g. F1 > F2
  1352.  
  1353.            Cond    C1    F1[-1] < 30 AND F1 > 30
  1354.  
  1355.            Cond    C2    F1[-1] > 70 AND F1 < 70
  1356.  
  1357.            Cond    C3
  1358.  
  1359.            Cond    C4
  1360.  
  1361.            Cond    C5
  1362.  
  1363.            Cond    C6
  1364.  
  1365.            BUY WHEN          SELL WHEN         LONG STOP        SHORT STOP
  1366.  
  1367.            C1                  C2
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.                  Technical Analysis Scanner (TAS)               Page 23
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.            [F1]=Help [F3]=Save [F4]=Run [F5]=Options [F7]=Formula Builder
  1386.            ESC=Quit
  1387.  
  1388.  
  1389.           You can fill in the FORMULAs (F1 to F6) with indicators (or
  1390.           combinations of indicators) you want to 'plot' for the profit
  1391.           test. Then, in the CONDITION entry areas (COND C1 to C6), you
  1392.           fill in conditions you would use in a BUY, SELL or STOP loss
  1393.           signal.
  1394.  
  1395.           Once you have entered your FORMULAS and the CONDitions, you can
  1396.           choose which conditions you want to use for the BUY, SELL and
  1397.           STOP signals.
  1398.  
  1399.           In the example above, only RSI(14) is being plotted. The
  1400.           condition C1 tests to see if the RSI has crossed from below 30 to
  1401.           above 30 (Buy Signal). Condition C2 tests if the RSI has crossed
  1402.           from above 70 to below 70 (Sell Signal). Notice how C1 is entered
  1403.           below BUY WHEN, indicating the Profit Tester should buy if
  1404.           condition C1 is true (and the stock is not already held). And,
  1405.           then C2 is below SELL WHEN, indicating a similar SELL strategy.
  1406.  
  1407.           Special Note for Metastock Users
  1408.           If you are a Metastock user, you are probably used to being able
  1409.           to enter custom formulas like,
  1410.                (H+L)/2
  1411.           however, with TAS, this calculation would not work. You must
  1412.           reform the equation as follows
  1413.             DIVBY(ADD(H,L),2)
  1414.           which first adds the High and the Low arrays, and then divides
  1415.           the resulting array by 2, thus creating a new array which is the
  1416.           sum of the High and the Low divided by 2.
  1417.  
  1418.           Whenever you want to add two arrays together, use the ADD
  1419.           function, to subtract, use the SUB function, to multiply, use
  1420.           the MUL function, and to divide, use the DIV function. Each of
  1421.           these functions takes two arrays as arguments and returns a new
  1422.           array as the result.
  1423.           To add, subtract, multiply or divide an array by a number, you
  1424.           would use the ADDTO, SUBFROM, MULBY, and DIVBY functions.
  1425.  
  1426.  
  1427.           Profit Test Options
  1428.  
  1429.           Profit Test has a number of options which are set by hitting the
  1430.           F5 Function Key in this screen. You will see the following
  1431.           screen. Each of the items in bold represent one of several
  1432.           choices available for the option.
  1433.  
  1434.  
  1435.                  Technical Analysis Scanner (TAS)               Page 24
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.             Set TAS Profit Test Options
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.             Initial Cash 5000   Test Type LONG    Commissions  NOCOMM
  1455.  
  1456.  
  1457.  
  1458.             Share Purchases ONESHARE             Price Slippage 0 -
  1459.            TODAYS CLOSE
  1460.  
  1461.  
  1462.  
  1463.             Output File Name                     Report Detail DETAIL
  1464.  
  1465.  
  1466.  
  1467.             Maximum Quotes                       INDEX Ticker
  1468.  
  1469.  
  1470.  
  1471.             Reinvest Profits N
  1472.  
  1473.  
  1474.  
  1475.             Start Date     /    /     End Date           /    /
  1476.  
  1477.  
  1478.           When you bring up this screen, you can choose options by using
  1479.           the TAB key to move to each field and selecting the appropriate
  1480.           option. Type the HELP Key (F1) at each field to see the meaning
  1481.           of the choices. When you are done with changes to this screen,
  1482.           hit the F3 key to save the options. If you are in a "pop-up"
  1483.           window, hit ENTER, then hit F3.
  1484.  
  1485.  
  1486.           Profit Test Option Settings
  1487.  
  1488.           Initial Cash
  1489.           This is the amount of "money" the trading should start with. It
  1490.           must be sufficient to buy the amount of shares specified by the
  1491.           Share Purchase option below. For example, if you start with
  1492.  
  1493.  
  1494.  
  1495.                  Technical Analysis Scanner (TAS)               Page 25
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.           $1,000 and you are buying Round Lots (100 shares), your stock had
  1505.           better not sell for more than $10 per share or you won't have
  1506.           enough money to buy a round lot.
  1507.  
  1508.           Test Type
  1509.           There are 3 choices for this option. You can perform a LONG ,
  1510.           SHORT or BOTH test.
  1511.           A LONG test only takes long positions, that is, it only buys to
  1512.           open a position and sells to close it.
  1513.  
  1514.           A SHORT test only takes short positions, selling to open and
  1515.           buying to close ("cover") the position.
  1516.  
  1517.           A BOTH test opens a long or short position and reverses each time
  1518.           a signal is generated to "go the other way". This is essentially
  1519.           a "stop and reverse" system.
  1520.  
  1521.           Commissions
  1522.           You can use several commission structures for your simulated
  1523.           trading. The commissions for Charles Schwab,  OLDE Discount, and
  1524.           PCFN brokerages are built into the profit tester. These
  1525.           commissions are accurate as of 1/1/91. You can also specify a
  1526.           percentage commission amount or a fixed dollar amount for each
  1527.           trade. Finally, you can ignore commissions altogether.
  1528.  
  1529.           Share Purchases
  1530.           You can elect to purchase shares of the security in either Round
  1531.           Lots or using all available cash. If you choose round lots, your
  1532.           profit test will purchase or sell stocks in groups of 100. This
  1533.           is important if you are using a real commission schedule, since
  1534.           the commission per share is reduced when you trade in round lots.
  1535.  
  1536.  
  1537.           Price Slippage
  1538.           Price Slippage refers to the price at which you want to exercise
  1539.           the trade. Generally, you cannot execute a trade at the exact
  1540.           price you want, nor can you always trade at the previous day's
  1541.           closing price. So, you have several options for choosing the
  1542.           trade price.
  1543.  
  1544.                Price Slippage Type                               Meaning
  1545.                 0 - TODAYS CLOSE                               Today's closing price
  1546.                 1 - NEXT AVERAGE                               Tomorrow's (High+Low+Close)/3
  1547.                 2 - NEXT OPEN  Tomorrow's Open Price
  1548.                 3 - NEXT CLOSE Tomorrow's Close Price
  1549.                 4 - NEXT HIGH  Tomorrow's High Price
  1550.                 5 - NEXT LOW   Tomorrow's Low Price
  1551.  
  1552.  
  1553.  
  1554.  
  1555.                  Technical Analysis Scanner (TAS)               Page 26
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.           The prices at which the BUY, SELL and STOP transactions occur are
  1565.           obtained from the choices given on the Profit Test Build Options
  1566.           screen. There are several choices, one of which is to buy at the
  1567.           close for the prior day. This is the default. If you have OPEN
  1568.           data, you should choose the option to buy at the OPEN price. If
  1569.           not, then you can choose an average of the price range, or
  1570.           several other choices.
  1571.  
  1572.           Just to elaborate on the profit testing, suppose on day 2/15/90,
  1573.           your buy signal is reached..in other words, the BUY WHEN is true.
  1574.           The price at which your buy is made is most accurately at the
  1575.           OPEN of the next day (since you
  1576.           are using CLOSING data for your test up to 2/15/90, you wouldn't
  1577.           have been able to really buy at the CLOSE for 2/15/90). If you
  1578.           don't have OPEN data, you can use some other choice from the
  1579.           prices on 2/16, the following day.
  1580.  
  1581.           But, in every case, the actual BUY takes place on 2/16/90, the
  1582.           day following the date the signal was given (can't buy after the
  1583.           close).
  1584.  
  1585.  
  1586.           Output File Name
  1587.           If you want the output report from the profit test to go to a
  1588.           file, specify the name here.
  1589.  
  1590.           Report Detail
  1591.           There are three choices for this option: DETAIL, TICKERSUMMARY,
  1592.           and TOTALSUMMARY.
  1593.  
  1594.              DETAIL           Show every trade
  1595.              TICKERSUMMARY    Show totals for each ticker
  1596.              TOTALSUMMARY     Show totals only for all tickers
  1597.  
  1598.  
  1599.           Maximum Quotes
  1600.           You can specify the maximum number of quotes to load for the
  1601.           profit test. This number should be less than or equal to the
  1602.           Maximum Quotes per Symbol setting in your Configuration Menu.
  1603.  
  1604.           Index Ticker
  1605.           If you want to run a profit test that uses some index, such as
  1606.           the SP-500, you can specify the ticker here. Then, in your profit
  1607.           test, you refer to the index ticker's value with the INDEX array
  1608.           name.
  1609.  
  1610.           Reinvest Profits
  1611.           This option determines how much money you want the profit tester
  1612.  
  1613.  
  1614.  
  1615.                  Technical Analysis Scanner (TAS)               Page 27
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.           to use for each trade.
  1625.           If you specify "Y", the profit test will use your current cash
  1626.           position, including profits, minus losses and commissions to
  1627.           determine how much money you have available to trade.
  1628.           If you specify "N", the profit tester will initiate each trade
  1629.           with the same amount of cash, regardless of your prior profits,
  1630.           losses or commissions.
  1631.  
  1632.           Start Date
  1633.           If you want to start your test on a specific date, specify that
  1634.           date here. Make sure that the date is a date you have in the
  1635.           file. If it is not, the test will begin on the first date prior
  1636.           to that date.
  1637.  
  1638.           End Date
  1639.           If you want to end your test on a specific date, specify that
  1640.           date here. Make sure that the date is a date you have in the
  1641.           file. If it is not, the test will begin on the first date prior
  1642.           to that date.
  1643.  
  1644.           Running the Profit Test
  1645.           To run the Profit Test hit the F4 key (once you leave the Options
  1646.           screen). If you want to save the Profit Test formulas, save it
  1647.           with the F3 key and then reselect it to run it.
  1648.  
  1649.           Errors In Profit Test Formulas
  1650.           If you have any errors in the Profit Test you have created, you
  1651.           will be told about them when you try to run the PROFIT TEST. An
  1652.           error message  will be displayed and then the TAS EDITOR will be
  1653.           run with a file called _RUNPT.TAS. This file is the file that is
  1654.           created from your PROFIT TEST. It is a special form of a TAS
  1655.           script. You should recognize the formulas though, since they are
  1656.           the ones you entered in your PROFIT TEST.
  1657.  
  1658.           The EDIT screen will redisplay the error message and the
  1659.           explanation of the error at the bottom of the screen. Hit the ESC
  1660.           key and the cursor will be placed near the place where the error
  1661.           was found. In addition, the error message will be placed in the
  1662.           file to the right of the line in error. Look at the formula or
  1663.           condition and try to figure out what the problem is.
  1664.  
  1665.           You are only half done though. Now you have to go back to your
  1666.           BUILD PROFIT TEST screen (by typing ESC) and fix the formula(s)
  1667.           in that screen. Do not try to fix the problem in the TAS Editor
  1668.           screen, since this is just a temporary view of the actual
  1669.           Selection file. Once you have corrected the error in the Profit
  1670.           Test screen, be sure to save (by hitting F3) your file.
  1671.  
  1672.  
  1673.  
  1674.  
  1675.                  Technical Analysis Scanner (TAS)               Page 28
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.            The file that is built when you create (or modify) a Profit
  1686.            Test has a special file extension ".PTS" (Profit Test Script).
  1687.            This file has a special format that can be read by the
  1688.            Build/Run Profit Test menu. If you go in with an editor and
  1689.            change any part of the .PTS file, it is very likely that the
  1690.            .PTS file WILL NO LONGER WORK when you pull it up into the
  1691.            Profit Test screen. If you want to change a .PTS file, copy it
  1692.            to a file .TAS file name and edit that file. Once you do that,
  1693.            you have to run the file as a TAS SCRIPT, not a Profit Test.
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.            EDIT TAS SCRIPT - Editing TAS Scripts
  1701.  
  1702.  
  1703.           TAS has a built-in text editor which can be used to create and
  1704.           modify TAS script files. All TAS script files end with the suffix
  1705.           ".TAS".
  1706.  
  1707.           When you select this menu item, you will be asked if you want to
  1708.           create a New Script or Modify an Old Script.
  1709.  
  1710.           If you request a new script, you will be prompted for the script
  1711.           name. Enter only the filename portion, not the .TAS extension.
  1712.           The file will be created in the \TAS directory.
  1713.  
  1714.           If you want to modify an old script, a File Name Selection Screen
  1715.           will appear which contains the names of all the files in the
  1716.           current directory ending with ".TAS". Move the cursor or mouse
  1717.           over to the correct file name and press Enter (or double-click).
  1718.  
  1719.           The editor screen will then appear with the contents of the file
  1720.           displayed.
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.                  Technical Analysis Scanner (TAS)               Page 29
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.            The TAS editor cannot handle lines larger than 78 characters .
  1746.            If the line is longer than that, it will be broken at column
  1747.            78 and continued onto the next line. If the total length of
  1748.            the line is more than 256 characters, the last part of the
  1749.            line will be lost if the file is saved. You should be aware of
  1750.            this when creating a script in another editor and then using
  1751.            the TAS editor to modify it. An arbitrary "break" at column 76
  1752.            might cause a word to be split in the middle, thus introducing
  1753.            an error into the script.
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.                  Technical Analysis Scanner (TAS)               Page 30
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.           Editor Function Keys
  1805.             F1      HELP Key
  1806.                     If you need help with the editor, hit the F1 (Help)
  1807.                     Key. You will see a list of editor commands.
  1808.             F3      Save Script File Key
  1809.                     When you are done with your editing, you can save the
  1810.                     file by hitting the F3 (Save) Key. If you do not want
  1811.                     to save the file, hit the ESC (Abort) Key.
  1812.  
  1813.             F4      Run Script Key
  1814.                     The Run Script key will run the script you are
  1815.                     currently editing without saving it back to its
  1816.                     original script file.  
  1817.                     
  1818.             F5      Check Script Key
  1819.                     If you wish to check your script file for errors in
  1820.                     syntax, press the F5 key. If there are errors in the
  1821.                     script which can be detected by the Check Script
  1822.                     function, an error message showing the type of error
  1823.                     encountered and the line and column number on which the
  1824.                     error occurred will appear in a window at the bottom of
  1825.                     the screen. This window will disappear after a few
  1826.                     seconds or when you hit a key. Then the script file
  1827.                     will be positioned so that the cursor is on the line
  1828.                     where the error was detected. It is usually the case
  1829.                     that the error is somewhere either on that line or on
  1830.                     the previous line.
  1831.  
  1832.             F7      Formula Builder Key-One key available in the editor is
  1833.                     the Formula Builder Key. This key will bring up a list
  1834.                     of Technical Indicator functions and Pre-defined Data
  1835.                     Arrays. If you select one of the functions or arrays,
  1836.                     the subsequent parameters of the function (e.g. MOV
  1837.                     "Moving Average" requires 3 additional parameters) will
  1838.                     be prompted. Enter each parameter. When you are done,
  1839.                     the formula and parameters will be placed into your
  1840.                     script file at the location of the cursor when you hit
  1841.                     F7.
  1842.  
  1843.           Editor Control Keys
  1844.             Alt-R   Rename script file. You will be asked to provide a new
  1845.                     name for the script file. When you save the script, it
  1846.                     will be saved with the new name.
  1847.             Alt-S   Save script file.  The script file will be saved to
  1848.                     disk under the name shown at the top of the edit
  1849.                     screen. You can continue editing the script after it is
  1850.                     saved.
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                  Technical Analysis Scanner (TAS)               Page 31
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.            RUN TAS SCRIPT - Running TAS Scripts
  1866.  
  1867.  
  1868.           If you have created a script (or are using one of the example
  1869.           scripts) and you want to run it against a specific Ticker List,
  1870.           you should choose the "RUN TAS Scripts" option from the Main
  1871.           Menu. (You must have created at least one Ticker List before you
  1872.           can run TAS)
  1873.  
  1874.           When this option is chosen, you will be asked for the TAS script
  1875.           name and the Ticker List name. Each choice will be from a list of
  1876.           filenames ending with the appropriate extension (".TAS" or
  1877.           ".TCK"). Move the cursor to the correct file name for each choice
  1878.           and hit ENTER.
  1879.  
  1880.  
  1881.  
  1882.            QUIT
  1883.  
  1884.  
  1885.           This option will exit from TAS. If you want to go to DOS and
  1886.           return to what you were doing within TAS, use the ALT-X key.
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.                  Technical Analysis Scanner (TAS)               Page 32
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.                         TAS Selection Scripts -  Description
  1925.  
  1926.           TAS reads each security name in the TICKER LIST from the
  1927.           historical (MetaStock or Chartpro format) data file. It reads the
  1928.           quotes for the file into the pre-defined data arrays up to the
  1929.           lower of either (1) the number specified in the QUOTES PER SYMBOL
  1930.           (in the Configure TAS Menu) (2) the number specified in
  1931.           #MAX_QUOTES in the script file itself,  (3) all the quotes in the
  1932.           file, or (4), the number of quotes between the SCAN_DATE or Start
  1933.           Date and End Date.
  1934.  
  1935.           Once all the price history has been read into the data arrays,
  1936.           TAS "executes" the statements in the TAS script file. Once all
  1937.           statements in the file have been executed, TAS moves on to the
  1938.           next security's symbol in the TICKER LIST.
  1939.  
  1940.           This process continues until all the symbols in the TICKER LIST
  1941.           have been read or until an error is encountered in the script
  1942.           file.
  1943.  
  1944.  
  1945.  
  1946.            The order in which TAS processes the securities in the ticker
  1947.            list is in the order in which the security files are found in
  1948.            the Metastock directories or in the Chartpro directories, not
  1949.            the order of the ticker list.
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.                  Technical Analysis Scanner (TAS)               Page 33
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.                                  TAS Script Language
  1985.  
  1986.           TAS Script Language  is loosely based on  the programming
  1987.           language  PASCAL. There has to be some way to tell TAS what you
  1988.           want to look for, compute, print, etc., so the choices made in
  1989.           the way you  tell it to do something are what can be called the
  1990.           "syntax". In a way, the language is similar to English, where you
  1991.           would say "If a is greater than b then tell me about it". Except,
  1992.           as you will see, TAS also has abbreviations for relationships
  1993.           like "is greater than". Other than that, however, the language
  1994.           can be read like English and algebraic notation combined. The
  1995.           following topics will give an explanation of the TAS script
  1996.           language.
  1997.  
  1998.           The TAS package contains numerous examples of TAS Scripts. You
  1999.           should print them and look at them while reading the next
  2000.           section. The sample scripts contain "comments" which explain what
  2001.           the script is doing at each point of the script.
  2002.  
  2003.  
  2004.  
  2005.            Syntax
  2006.  
  2007.  
  2008.           In the subsequent discussion, the word "statement" is used. A
  2009.           "statement" is like a sentence in English. Like a sentence, it is
  2010.           composed of "words".
  2011.  
  2012.           A semi-colon (;) is used to tell TAS that the statement you just
  2013.           entered is done. Every statement should be terminated by a semi-
  2014.           colon.
  2015.  
  2016.           In the syntax descriptions below, words you must use are in UPPER
  2017.           CASE, and parts of the statement that are up to you are in lower
  2018.           case.
  2019.  
  2020.  
  2021.  
  2022.            Building Blocks
  2023.  
  2024.  
  2025.           The "Building Blocks" of TAS scripts are the following types of
  2026.           items:
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.                  Technical Analysis Scanner (TAS)               Page 34
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.             "VARIABLES".
  2045.                     Variables are where you put values or, in the case of
  2046.                     "pre-defined" variables, where you get them. The names
  2047.                     are anything you choose, but they have to start with a
  2048.                     letter of the alphabet and must consist of characters
  2049.                     from the following set {A to Z, 0 to 9, and
  2050.                     underscore}. Other characters are not allowed in the
  2051.                     variable name.
  2052.  
  2053.             "ASSIGNMENT ".
  2054.                     The ASSIGNMENT statement (":=" or "=") is how you can
  2055.                     move a value from one place to another.
  2056.  
  2057.             "ARITHMETIC Operators".
  2058.                     These are the usual ADD(+), SUBTRACT (-), MULTIPLY(*)
  2059.                     and DIVIDE(/) and EXPONENTIATION (^).
  2060.  
  2061.             "FUNCTIONS".
  2062.                      A "function" is a built-in Technical Indicator , math
  2063.                     function, or "output" function which usually returns a
  2064.                     value.
  2065.  
  2066.             IF statements
  2067.                     An "IF" statement is used to test a condition or value.
  2068.                     Once the condition is tested, you can perform certain
  2069.                     actions "if" it is TRUE or "if" it is false.
  2070.  
  2071.             WHILE statement
  2072.                     The WHILE statement is used to control the execution of
  2073.                     a sequence of instructions that need to be repeated
  2074.                     until some condition is false.
  2075.             FOR statement
  2076.                     The FOR statement is used to describe the values to be
  2077.                     used for a "loop" or sequence of statements that need
  2078.                     to be executed a certain number of times.
  2079.  
  2080.             "BEGIN-END Blocks"
  2081.                     A "BEGIN-END" block is a way to "group" several
  2082.                     statements into one. For example, the IF statement only
  2083.                     allows you to execute the following "statement".
  2084.                     However, if you use a BEGIN followed by multiple
  2085.                     statements, followed by an END, the whole series of
  2086.                     statements from the BEGIN through the END is considered
  2087.                     to be ONE statement. It is similar to putting
  2088.                     parentheses around an arithmetic expression.
  2089.  
  2090.             "Logical AND"
  2091.  
  2092.  
  2093.  
  2094.  
  2095.                  Technical Analysis Scanner (TAS)               Page 35
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.                     The AND word takes a left-hand side and a right-hand
  2105.                     side. If both are TRUE, the whole is TRUE.
  2106.  
  2107.             "Logical OR"    
  2108.                     The OR word also has a left and right side. If either
  2109.                     is TRUE, the whole is TRUE.
  2110.  
  2111.             "RELATIONAL Operators"
  2112.                     These are how you test the "relation" between two
  2113.                     values. The English language form of the operators and
  2114.                     the symbolic form for the operators are shown in the
  2115.                     table below. You may use either form for expressing an
  2116.                     equality or inequality relationship.
  2117.             
  2118.                English Language Keyword form
  2119.                                   Symbolic form
  2120.                EQUAL
  2121.                                   =
  2122.                GREATER THAN
  2123.                                   >
  2124.                GREATER THAN OR EQUAL
  2125.                                   >=
  2126.                LESS THAN
  2127.                                   <
  2128.                LESS THAN OR EQUAL
  2129.                                   <=
  2130.                NOT EQUAL
  2131.                                   <>
  2132.  
  2133.             Comments
  2134.                     These are used to "document" the TAS script. They
  2135.                     perform no function, but only help to understand what
  2136.                     is going on in the general area of the script. They are
  2137.                     good to use and should be included in the script to
  2138.                     make it easier to understand.
  2139.  
  2140.           Variables
  2141.           The concept of a "variable" can be difficult to communicate to
  2142.           anyone who hasn't programmed before. Loosely speaking, it is a
  2143.           name given to a "place" to put a "value". Think of it as a "name
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.                  Technical Analysis Scanner (TAS)               Page 36
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.           for a value"2.
  2165.           Except for "pre-defined" variables (see below) you can make up
  2166.           the names for the variables in your script.
  2167.  
  2168.           A variable name must start with an alphabetic letter, contain
  2169.           only letters, numbers and underscores ("_"). Some valid names
  2170.           are:
  2171.  
  2172.               my_stuff, my_122999, my999, m9, M32_togo, Beethoven, etc
  2173.  
  2174.           Generally, you first use variables in "assignment statements",
  2175.           that is, you first "put" something into them. Subsequently, you
  2176.           can use them as values passed to functions or another statement
  2177.           such as an IF statement or a WHILE statement.
  2178.  
  2179.  
  2180.           Creation of Variables
  2181.           TAS variables are created in one of two ways. You can "declare"
  2182.           them before using them, as you must do with ARRAY's, or you can
  2183.           just assign some value to them.
  2184.           When a variable is created, it has a "scope" or area of the
  2185.           script where it is guaranteed to be "known". The area of the
  2186.           script where it is "known"  (or "scope" of the variable) is
  2187.           determined by the BEGIN..END block structure of the script. A
  2188.           variable that is created within a BEGIN..END block is "known" to
  2189.           all inner statements to that BEGIN..END block, but it will lose
  2190.           its value once the BEGIN..END block is departed.
  2191.           This may seem confusing at first, so here is an example:
  2192.             if C > 25 THEN
  2193.             BEGIN
  2194.                price = price+c;
  2195.             END;
  2196.             WRITELN(price);
  2197.  
  2198.           If the Closing price is greater than 25, then the BEGIN .. END
  2199.           block is entered. Now, since this is the first assignment to
  2200.           price, the variable price is created with a value of zero. The
  2201.           Closing price for the last day is added to the variable price,
  2202.           suppose it is 32. Now, price contains 32. Then, the END statement
  2203.           is reached. At this point, price is freed, since its scope was
  2204.           only within the BEGIN..END block in which it was first used. The
  2205.           ____________________
  2206.           2  The variable names are anything you choose, but they have to
  2207.           start with a letter of the alphabet and must consist of
  2208.           characters from the following set {A to Z, 0 to 9, and
  2209.           underscore}. Other characters are not allowed in the variable
  2210.           name.
  2211.  
  2212.  
  2213.  
  2214.  
  2215.                  Technical Analysis Scanner (TAS)               Page 37
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.           subsequent WRITELN statement will write out price, but this time,
  2225.           the variable price is used outside of the BEGIN..END block in
  2226.           which it was previously created, it is a new variable. The value
  2227.           of price at this point will be zero3!
  2228.  
  2229.           TAS Variable Types
  2230.  
  2231.           "String" Variables
  2232.           These are variables to hold text information, like 'IBM', or
  2233.           'THIS IS A STICK-UP'.  String variables must be surrounded by
  2234.           single-quote (') characters.  String variables can be different
  2235.           lengths, depending on what you put into them. They can contain
  2236.           blanks at the end of the variable, which you may need to remove
  2237.           with the TRIM function.
  2238.  
  2239.           "Numeric" Variables 
  2240.           These are variables that hold numbers, like 32, or -75.69, or
  2241.           10000034.
  2242.  
  2243.           There are two types of numeric variables, INTEGERS and REAL
  2244.           numbers. An INTEGER is a number which has no decimal point and
  2245.           must be smaller than 32,767 in value.
  2246.  
  2247.  
  2248.  
  2249.            An INTEGER can be NO LARGER THAN 32,767 in value. If you need
  2250.            to use a number larger than 32,767 then you must include a
  2251.            decimal point followed by at least one zero in the number. For
  2252.            example, if you want to use the number 1 million in your
  2253.            script, you cannot say 10000000 because the number is larger
  2254.            than 32,767 and it does not contain a decimal point. In this
  2255.            case, you must say 1000000.0 to tell TAS that the number is a
  2256.            REAL number.
  2257.  
  2258.  
  2259.  
  2260.           "Numeric Array" Variables
  2261.           These are variables that hold many numbers in an "array"  (or
  2262.           collection of numbers). All of the numbers in the array have the
  2263.           same variable name; however, you cannot "look" at them all at
  2264.           once.  You must pick out one of the numbers of the array by
  2265.           specifying its "location" in the array.
  2266.           ____________________
  2267.           3  Current versions of TAS allow you to create a variable within
  2268.           a BEGIN..END block and use it outside of that block. However,
  2269.           future versions of the program will not guarantee that such a
  2270.           technique will work.
  2271.  
  2272.  
  2273.  
  2274.  
  2275.                  Technical Analysis Scanner (TAS)               Page 38
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.           Each array has exactly QUOTE_COUNT entries. The variable
  2286.           QUOTE_COUNT is "filled in" by TAS when the script runs for the
  2287.           ticker file.  Given a ticker that has 100 quotes (or the maximum
  2288.           number of quotes to load, MAX_QUOTES, set to 100) the following
  2289.           indices are usable for any array in the ticker file:
  2290.             
  2291.                English Language Index                              Index Relative to Today                                  Index Relative to First Day
  2292.                Today     0        100
  2293.                Yesterday -1       99
  2294.                2 Days Ago                         -2       98
  2295.                3 Days Ago                         -3       97
  2296.                       ....................                                       .....    .....
  2297.                99 Days Ago                         -99      1
  2298.  
  2299.           An example of an array that is always available when a ticker is
  2300.           processed is the Closing Price array,"C". Obviously, there are
  2301.           many Closing Prices (one for each quote, in fact), and in order
  2302.           to refer to the Closing Price on a particular day, there must be
  2303.           some way to reference it. In the absence of any explicit
  2304.           reference to a particular day in an array, TAS will assume the
  2305.           reference is for the last day for the ticker.
  2306.  
  2307.           However, if you need to know what the value of the Closing Price
  2308.           was two days before the last quote's day, you have to tell TAS
  2309.           that you want the quote two days before. You can do this in one
  2310.           of three ways. Suppose you have 100 days of data loaded. To get
  2311.           the Closing Price quote from two days  prior to the last day, you
  2312.           could say:
  2313.  
  2314.                1)        C[-2]    
  2315.                2)        C[98] 
  2316.                3)        C 2 DAYS AGO   
  2317.           Methods (1) and (2) above use "subscript" notation to tell TAS
  2318.           which number in the array is needed. In the first case, you are
  2319.           saying "give me the Closing Price array entry 2 days backward
  2320.           from the last entry". The negative number says to start
  2321.           "counting" back days from the last day.
  2322.  
  2323.           The second version, shown in (2), says "give me the Closing Price
  2324.           array entry 98 days from the first day loaded". Since we had
  2325.           stipulated 100 days were loaded, this is the same as the price
  2326.           two days ago (100-98 = 2).
  2327.  
  2328.           Finally, the last expression, shown in (3), says in English that
  2329.           you want to retrieve the Closing Price 2 days ago. In the
  2330.           interest of readability, this version is the best, but it is more
  2331.           wordy and does incur a very slight performance penalty when you
  2332.  
  2333.  
  2334.  
  2335.                  Technical Analysis Scanner (TAS)               Page 39
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.           run the script, since TAS has extra work to do in order to
  2345.           interpret the English phrase.
  2346.  
  2347.           In addition, you can also describe the current day's Closing
  2348.           value by saying
  2349.                CLOSE OF TODAY
  2350.           and you can refer to yesterday's Closing price by saying
  2351.                CLOSE OF YESTERDAY
  2352.  
  2353.           Other pre-defined data arrays, like H, L, C, V (for High Price,
  2354.           Low Price, Closing Price and Volume) are examples of arrays.
  2355.  
  2356.           If you want to refer to a closing price 10 days ago (using our
  2357.           earlier example of 100 days loaded), you can say
  2358.                         C[-10] or C[90] or CLOSE 10 DAYS AGO
  2359.           Each time you refer to an "element" of an array, you need to
  2360.           either provide the "subscript" in square brackets, e.g. [-10],
  2361.           which means "subscript minus ten" or say "xx DAYS AGO".
  2362.  
  2363.           You can define your own variable array by "declaring" it (prior
  2364.           to first using it) as follows:
  2365.  
  2366.             variable_name : ARRAY;
  2367.                OR
  2368.             variable_name IS AN ARRAY;
  2369.  
  2370.           where 'variable_name' is the name by which you want to refer to
  2371.           the array.
  2372.  
  2373.           You might wonder "Why would I define my own array?". The answer
  2374.           to that depends on what you are trying to do. Generally, you
  2375.           define your own array because you want to put some indicator
  2376.           value into it. Most indicators create arrays of numbers. When
  2377.           using a charting program, you can see these numbers as a line on
  2378.           a graph. Each of the points on the line are values of the
  2379.           indicator for a particular day. Now, suppose you wanted to know
  2380.           what the value of the indicator was two days ago.
  2381.  
  2382.           Normally, when an indicator is computed, it returns (or creates)
  2383.           an array. However, if you don't put the result of the indicator
  2384.           function into an array (declared via the ARRAY declaration as
  2385.           shown above), then the result stored is the indicator value for
  2386.           the current day only.  In order to "look" at the indicator value
  2387.           for other than the last day loaded, you must place it into an
  2388.           array that you have already declared. For more information on
  2389.           placing the results of a function into an array or variable, see
  2390.           the section that follows.
  2391.  
  2392.  
  2393.  
  2394.  
  2395.                  Technical Analysis Scanner (TAS)               Page 40
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.           Assignment Statement
  2405.           The Assignment Statement is used to set the contents of a
  2406.           variable or array to the result of an "expression". An
  2407.           "expression" is a term, that means sequence of mathematical
  2408.           operations, a logical relation  and/or the result of a
  2409.           "function".
  2410.  
  2411.           It might help to give some examples of assignment operations:
  2412.  
  2413.                                   a := b + 3 / 4;
  2414.  
  2415.           The ":=" (colon-equal)  is the operator that says "assign to"4.
  2416.           So, reading the above assignment, in English, it says "add the
  2417.           contents of variable 'b' to the result of dividing 3 by 4. Place
  2418.           this result in variable 'a'". If variable 'b' contained 6 when
  2419.           this statement was encountered, then variable 'a' would contain
  2420.           6.75 (6 + 3/4).
  2421.  
  2422.           Another example is:
  2423.  
  2424.                               a := (c[-1] + c[0]) / 2;
  2425.  
  2426.           In this example, the array 'c' is pre-defined as the "closing
  2427.           price array". So, the statement is adding the closing price
  2428.           yesterday (c[-1]) to the closing price today (c[0]). It is then
  2429.           dividing the total of this addition by 2 and placing the result
  2430.           in variable 'a'. Note the use of the parentheses to "group" the
  2431.           addition so that it would be done before the division by 2. If
  2432.           there were no parentheses, the result would have been
  2433.           considerably different. Instead, it would have divided today's
  2434.           closing price by 2, added it to yesterday's closing price, and
  2435.           placed the result in 'a'.
  2436.  
  2437.           Another example of an assignment is the result of a "function"
  2438.           call. All Technical Indicators available in TAS are created by
  2439.           making a "function" call. In other words, the Technical Indicator
  2440.           is referred to by its name (the "function"). So, for example,
  2441.  
  2442.                                 a := mov(c,21,'E');
  2443.  
  2444.           calculates the 21 day exponential moving average ("mov" function)
  2445.           of the closing price array. If variable 'a' has been declared to
  2446.           be an ARRAY prior to this point, then 'a' contains all the moving
  2447.           average "points". If 'a' has not been declared as an ARRAY, then
  2448.           'a' will contain the value of the moving average at the last
  2449.           ____________________
  2450.           4  TAS will also accept a simple "equal" sign in lieu of the
  2451.           "colon-equal" sequence of characters for an assignment statement.
  2452.  
  2453.  
  2454.  
  2455.                  Technical Analysis Scanner (TAS)               Page 41
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.           point of the range, i.e., today's value. See the section titled
  2465.           "Numeric ArrayVariables  for a description of arrays and
  2466.           "subscripts".
  2467.  
  2468.           Arithmetic Operators
  2469.           Arithmetic Operators are addition (plus sign '+'), subtraction
  2470.           (minus sign '-'), multiplication (asterisk '*') , division (slash
  2471.           '/') and "exponentiation" (caret "^"). When you write an
  2472.           arithmetic expression, you should use parentheses to guarantee
  2473.           the order in which the operations are performed. In general,
  2474.           exponentiation is performed first, then division and
  2475.           multiplication are performed, then lastly, addition and
  2476.           subtraction.
  2477.  
  2478.           The Arithmetic Operators do not apply to math operations on
  2479.           arrays. If you want to add two arrays together, you cannot use
  2480.           the "+" operator to add them. In this case, you must use the ADD
  2481.           function. The same applies to the use of the other arithmetic
  2482.           operators on arrays.  As an example of what won't work, suppose
  2483.           you told TAS to perform the following operation
  2484.             A IS AN ARRAY;
  2485.             A := CLOSE + HIGH
  2486.           TAS would assume that by CLOSE, you meant the last day's Closing
  2487.           Price and that by HIGH, you meant the last day's High Price. It
  2488.           would then add the two last day's  together and place the result
  2489.           in the last day of array A. All prior days in the array A would
  2490.           be left unchanged. This is obviously not what you would want to
  2491.           happen, so the way to perform the addition of the Close and the
  2492.           High price and place it in an array A would be to do the
  2493.           following:
  2494.             A := ADD(CLOSE,HIGH);
  2495.           Now array A contains the sum of the Close and the High prices for
  2496.           each day in the security file.
  2497.  
  2498.           Functions
  2499.           A "function" is a reference to a "built-in" Technical Indicator
  2500.           function (like "MOV(...)"), an output function (like WRITE or
  2501.           WRITELN), or an array manipulation function (like DIVBY). See the
  2502.           individual descriptions of each function in the Metastock
  2503.           Professional  User's Guide for a more complete definition of the
  2504.           meaning of the various Technical Indicators that are found in
  2505.           that program.
  2506.  
  2507.           IF Statement
  2508.           The IF statement is perhaps the most powerful  feature of TAS. It
  2509.           enables you to create complex relationships between indicators
  2510.           based on their relationship with other indicators and values.
  2511.  
  2512.  
  2513.  
  2514.  
  2515.                  Technical Analysis Scanner (TAS)               Page 42
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.           An IF statement is written as follows:
  2525.  
  2526.             IF condition THEN
  2527.                statement to execute if the condition is true
  2528.             ELSE
  2529.                statement to execute if the condition is false;
  2530.  
  2531.           The ELSE part of the IF statement is optional, but sometimes it
  2532.           is convenient to make a two way decision about something. You
  2533.           could alternatively say:
  2534.  
  2535.             IF condition THEN
  2536.                statement to execute if the condition is true;
  2537.  
  2538.           The TAS language does not require you to include the word THEN
  2539.           after the IF part of the statement. You must terminate each IF
  2540.           statement with a semi-colon. Note, however, that IF statements
  2541.           containing an ELSE part are terminated after the ELSE part. For
  2542.           example,
  2543.  
  2544.           IF a GREATER THAN b THEN
  2545.             WRITELN('a is greater than b, hurray!')
  2546.           ELSE
  2547.             WRITELN('a is not greater than b, sorry.');
  2548.  
  2549.           Note how there is a semi-colon on the last line, but not after
  2550.           the first WRITELN. However, if you wanted to print a message only
  2551.           if "a" is greater than "b", then you would say
  2552.  
  2553.           IF a GREATER THAN b THEN
  2554.             WRITELN('a is greater than b, hurray!');
  2555.  
  2556.           Note the semi-colon after the last line.
  2557.  
  2558.           WHILE Statement
  2559.           The WHILE statement executes a statement (or group of statements
  2560.           surrounded by a BEGIN..END) as long as the condition given in the
  2561.           WHILE statement is true.
  2562.           A WHILE statement is written as follows:
  2563.  
  2564.             WHILE condition
  2565.                statement to execute "while" the condition is true
  2566.  
  2567.           FOR Statement
  2568.           The FOR statement executes a statement (or group of statements
  2569.           surrounded by a BEGIN..END)  a certain number of times, and while
  2570.           a condition is true.
  2571.           The FOR statement has three parts to it. each part separated from
  2572.  
  2573.  
  2574.  
  2575.                  Technical Analysis Scanner (TAS)               Page 43
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.           the previous part by a semi-colon. The first part is done once,
  2585.           before the statement following the FOR is executed. This part of
  2586.           the FOR statement is called the initializer. The second part is
  2587.           the test of the condition that controls the loop.  This part is
  2588.           called the condition. The third part is executed each time after
  2589.           the statement following the FOR has been executed. This third
  2590.           part is called the re-initialization step.
  2591.  
  2592.           The format of the FOR statement is
  2593.  
  2594.             FOR initializer; condition; re-initialization;
  2595.                statement;
  2596.  
  2597.           As an example, suppose you wanted to add the HIGH and the LOW for
  2598.           each day of the security's loaded data and also get the
  2599.           difference of the HIGH and the LOW. Also suppose you wanted to
  2600.           place both of these values in their own array. You could put a
  2601.           FOR loop "outside" of the actions you wanted to perform for each
  2602.           day. Using the index variable i to refer to each day's array
  2603.           entry, you would set it up as follows:
  2604.             HIGHLOWSUM : ARRAY;   
  2605.             HIGHLOWDIFF : ARRAY;
  2606.             FOR i = 1; i  <= QUOTE_COUNT; i = i+1;
  2607.             BEGIN   
  2608.                HIGHLOWSUM[i] = CLOSE[i] + HIGH[i];
  2609.                HIGHLOWDIFF[i]  = CLOSE[i] - HIGH[i];
  2610.             END;
  2611.           This statement is a very powerful and convenient way to "iterate"
  2612.           or loop through some portion of the price or indicator data.
  2613.  
  2614.           BREAK Statement
  2615.           The BREAK statement can be used within either a FOR or WHILE loop
  2616.           to "break" out of a loop before the terminating condition has
  2617.           been reached.
  2618.  
  2619.           BEGIN..END Statement
  2620.           Suppose you want to do more than one thing if the condition "a is
  2621.           greater than b" is true. In that case, you would need to use a
  2622.           BEGIN .. END block.
  2623.  
  2624.            A "BEGIN..END" block "groups" all statements between the BEGIN
  2625.           and the END so that the entire "group" is treated as if it were
  2626.           one statement.
  2627.  
  2628.           This is useful in the case of the IF  (or FOR and WHILE)
  2629.           statement, because the action to be taken following the statement
  2630.           THEN or ELSE part of the IF can only be one statement. But if you
  2631.           use the BEGIN..END block to group several statements, the entire
  2632.  
  2633.  
  2634.  
  2635.                  Technical Analysis Scanner (TAS)               Page 44
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.           block is treated as a "single" statement. Think of BEGIN..END
  2645.           blocks in the same way you would think of parenthesized
  2646.           arithmetic expressions. You use parentheses to "group" some
  2647.           operations so that they are treated as a group.
  2648.  
  2649.           An example of the use of the BEGIN..END block in an IF statement
  2650.           is shown below:
  2651.  
  2652.           IF a GREATER THAN b THEN
  2653.           BEGIN
  2654.             a := a - 1;
  2655.             b := mov(c,21,'E');
  2656.             WRITELN('New values for a and b are:' ,a,' ',b);
  2657.           END;
  2658.  
  2659.           All three statements following the BEGIN will be executed (acted
  2660.           upon) if the value of "a" is greater than the value of "b". If
  2661.           you had left out the BEGIN..END section, only the first statement
  2662.           ("a := a - 1") would have been done if "a GREATER THAN b" was
  2663.           true. The following two statements would have ALWAYS been done,
  2664.           since they were not part of the IF.
  2665.  
  2666.           GOTO Statement and LABELS
  2667.           You can use the GOTO statement in a script to transfer control to
  2668.           a LABEL you define in the script.
  2669.  
  2670.           A LABEL is defined by a COLON (":")  immediately followed by a
  2671.           LABEL NAME. For example, in the script below, the third line has
  2672.           the sequence ":AGAIN". This makes "AGAIN" the name of a LABEL. On
  2673.           the tenth line of the script, there is a "GOTO AGAIN" which
  2674.           transfers the "flow of control" of the script back to the
  2675.           statement just following the label 'AGAIN'. The purpose of the
  2676.           script below is to show an example of GOTO and LABEL's, but
  2677.           incidentally, it also computes all the moving averages for
  2678.           periods from 20 days to 40 days and prints them.
  2679.  
  2680.           ma_array10 IS AN array;
  2681.           n = 20;
  2682.           :AGAIN
  2683.           ma_array10 = mov(c,n,'e');
  2684.           writeln(ticker,date,int(n),' day moving average is
  2685.           ',ma_array10);
  2686.           n = n+1;
  2687.           if n LESS THAN 40 then
  2688.             GOTO AGAIN;
  2689.  
  2690.           The following script is an example of using GOTO and LABEL's to
  2691.           transfer control FORWARD in the script. Note the GOTO B in the
  2692.  
  2693.  
  2694.  
  2695.                  Technical Analysis Scanner (TAS)               Page 45
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.           first IF statement.
  2705.  
  2706.           n = 1;
  2707.           :a
  2708.           if n GREATER THAN 30 then goto b;
  2709.           { DO SOME WORK HERE USING THE VALUE OF N}
  2710.           n = n+1;
  2711.           goto a;
  2712.           :b
  2713.           writeln('done...n is ',n);
  2714.  
  2715.           When you use the GOTO within a BEGIN..END block, you must be
  2716.           careful not to GOTO someplace outside of the block. Your script
  2717.           must encounter the END statement which matches the previous BEGIN
  2718.           statement.
  2719.  
  2720.           GOSUB statement
  2721.           The GOSUB statement is used to "go to a subroutine". This
  2722.           statement can be used when you have the same section of script
  2723.           code that you want to execute several times. Rather than
  2724.           including the same lines in the script in each place you want to
  2725.           use them, you can place them in one location in the script and
  2726.           use GOSUB each place you want to execute them.
  2727.  
  2728.           When you use GOSUB, you specify a label where the 'subroutine'
  2729.           starts. When the subroutine is completed, it should have a RETURN
  2730.           statement. The RETURN statement will return the script control
  2731.           back to the statement FOLLOWING the GOSUB.
  2732.  
  2733.           Here is a sample script using the GOSUB statement:
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.                  Technical Analysis Scanner (TAS)               Page 46
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.           a = 5;
  2765.           gosub s1;
  2766.           gosub s2;
  2767.           return;
  2768.           :s1
  2769.           begin
  2770.           writeln(ticker);
  2771.           writeln('s1 entered, a = ',int(a));
  2772.           return;
  2773.           end;
  2774.           :s2
  2775.           a = a+1;
  2776.           begin
  2777.           writeln('s2 entered, a = ',int(a));
  2778.           gosub s3;
  2779.           return;
  2780.           end;
  2781.           :s3
  2782.           a = a+1;
  2783.           begin
  2784.           writeln('s3 entered, a = ',int(a));
  2785.           return;
  2786.           end;
  2787.           The output from this script is:
  2788.  
  2789.           AMH
  2790.           s1 entered, a =     5
  2791.           s2 entered, a =     6
  2792.           s3 entered, a =     7
  2793.  
  2794.           RETURN statement
  2795.           The RETURN statement in a script will stop processing the current
  2796.           ticker or return from a GOSUB call. For example, if you want to
  2797.           avoid computing several complex indicators if there are less than
  2798.           100 quotes in the file or the price is less than $5, you could
  2799.           put the following section of code BEFORE your calculations in the
  2800.           script:
  2801.  
  2802.           IF quote_count LESS THAN 100 OR close LESS THAN 5 THEN
  2803.             RETURN;
  2804.  
  2805.           Or, if you have a subroutine that you call with the GOSUB
  2806.           statement, you need to return back to the place where the GOSUB
  2807.           was made by using a RETURN statement at the end of the
  2808.           subroutine.
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.                  Technical Analysis Scanner (TAS)               Page 47
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.           GOSUB SUB1;       {Call subroutine 1}
  2826.           RETURN;           {Return to TAS and end script}
  2827.           :SUB1         { BEGINNING OF SUB1}
  2828.           { DO WHATEVER SUB1 DOES HERE
  2829.                ......................}
  2830.           RETURN;           { RETURN FROM SUB1}
  2831.  
  2832.           Logical Operators
  2833.           You can combine relations by using the words "AND" and "OR". They
  2834.           have the same sense as in English. Whenever you use AND and OR,
  2835.           you can use parentheses to group your relations to be sure they
  2836.           are computed the way you want them to be understood. For example:
  2837.  
  2838.           IF a GREATER THAN b AND b EQUAL TO 1 THEN
  2839.             WRITELN('a is greater than b and b is equal to 1');
  2840.  
  2841.           This example compares "a" to "b". If "a" is greater than "b",
  2842.           then it compares "b" to the number 1. If "b" is equal to 1, then
  2843.           the message
  2844.             a is greater than b and b is equal to 1
  2845.           will be printed. If either of the "relations" (a in "relation" to
  2846.           b AND b in "relation" to 1) is not true, then the WRITELN will
  2847.           not be done.
  2848.  
  2849.           On the other hand, suppose we want to print the message if either
  2850.           of the conditions is true. Then we would say:
  2851.  
  2852.           IF a > b OR b = 1 THEN
  2853.             WRITELN('a is greater than b OR b is equal to 1');
  2854.  
  2855.           In this case, it would print the message if "a" were greater than
  2856.           "b" or if "b" were equal to 1.
  2857.  
  2858.           Relational Operators
  2859.           Relational Operators describe a "relationship" between the
  2860.           expression on the left of the operator and the expression on the
  2861.           right of the operator. For example, "a > b". 'a' is on the left
  2862.           side, 'b' is on the right side, and the operator is '>' which
  2863.           means "greater than". Relational operators can be expressed using
  2864.           mathematical notation (">", "<", "<>", ">=") or by using English
  2865.           forms of the same relation, such as "GREATER THAN", "LESS THAN",
  2866.           etc).
  2867.  
  2868.           Comments
  2869.           Comments are surrounded on both sides by "curly braces". These
  2870.           are the characters at the right of your keyboard. They look like
  2871.           this:
  2872.  
  2873.  
  2874.  
  2875.                  Technical Analysis Scanner (TAS)               Page 48
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.             {  - Left "curly brace"
  2885.             }  - Right "curly brace"
  2886.  
  2887.           You can place these "curly braces" around any thing in your
  2888.           script file that you do not want TAS see. It is only for your
  2889.           eyes and the eyes of other humans.
  2890.  
  2891.  
  2892.  
  2893.            Pre-Defined Variables
  2894.  
  2895.  
  2896.           Predefined Variables are variables that are "filled in" when each
  2897.           MetaStock TICKER is processed or at specific times during the
  2898.           processing of ticker files.
  2899.            TICKER        The 'ticker' symbol, e.g., AXP
  2900.  
  2901.            FULLNAME      The 'full name', e.g., AMERICAN EXPRESS
  2902.  
  2903.            DATAPATH      contains the DOS file name of the data
  2904.                         subdirectory currently being processed.
  2905.  
  2906.            TICKER_PERIOD contains the periodicity of the ticker file. This
  2907.                         is taken from the Metastock PERIOD field.
  2908.  
  2909.            QUOTE_COUNT   The number of quotes in the file
  2910.  
  2911.            QUOTE_RANGE   Initially set to QUOTE_COUNT by TAS. This variable
  2912.                         can be modified by the script to set the index of
  2913.                         the last quote in the file for computation.
  2914.                         Somewhat similar to the Metastock REF function..
  2915.  
  2916.            FIRST_TICKER  Variable, which, if equal to 1 (one), indicates
  2917.                         this ticker is the first to be processed.
  2918.  
  2919.            LAST_TICKER   Variable, which, if equal to 1 (one), indicates
  2920.                         this ticker is the last to be processed.
  2921.  
  2922.            DATE          The date of the latest quote in the file in the
  2923.                         format MM/DD/YY.
  2924.  
  2925.            P             The "last computed" array. For example,
  2926.                          X := MOV(C,30,'E')
  2927.                          places the last day's 30day EMA in 'X' and the
  2928.                         entire EMA array is in 'P' until another function
  2929.                         is called.
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.                  Technical Analysis Scanner (TAS)               Page 49
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.            PLOT_PHASE    Variable which is set to 1 when the Profit Test
  2945.                         Script is entered for the first time for a ticker.
  2946.  
  2947.            TEST_PHASE    Variable which is set to 1 when the Profit Test
  2948.                         Script is entered for the EACH quote for a ticker.
  2949.            END_PHASE     Variable which is set to 1 when the Profit Test
  2950.                         Script is entered for the last quote for a ticker.
  2951.  
  2952.  
  2953.  
  2954.            Pre-Defined DATA Arrays
  2955.  
  2956.  
  2957.           A pre-defined DATA Array contains one entry of one type of value
  2958.           for each day in the ticker file. There are as many entries in
  2959.           each array as there are days loaded for the ticker.
  2960.  
  2961.           Unlike user-defined arrays,  the pre-defined arrays should not be
  2962.           defined within the script with the array declaration. Since they
  2963.           are pre-defined, they are always available for use within the
  2964.           script.  There are two ways to refer to each of the pre-defined
  2965.           arrays. There is an English language name, such as CLOSE and a
  2966.           "short variable name", such as "C", for the Closing Price array.
  2967.           The names for the pre-defined arrays are shown in the table that
  2968.           follows:
  2969.  
  2970.            English language name for array                         Short Variable Name                                   Description
  2971.             Pre-defined DATA Arrays
  2972.            OPEN          O         The OPEN PRICE "data array"
  2973.            HIGH          H         The HIGH "data array"
  2974.            LOW           L         The LOW  "data array"
  2975.            CLOSE         C         The CLOSE "data array"
  2976.            VOLUME        V         The VOLUME "data array"
  2977.            OPEN_INTEREST OI        The OPEN INTEREST "data array"
  2978.            INDEX         INDEX     Array containing the CLOSE quotes for a
  2979.                                    TICKER defined by an INDEX command.
  2980.            DATES         DATES     Array of DATES associated with each of
  2981.                                    the price entries. These dates are in
  2982.                                    number format, not string format.
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.                  Technical Analysis Scanner (TAS)               Page 50
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.                                 Pre-defined Functions
  3005.  
  3006.           TAS functions which are also available in MetaStock have the same
  3007.           names and (nearly the same) parameters as those documented in the
  3008.           MetaStock Custom Formulas Section of the MetaStock "User's
  3009.           Manual".
  3010.  
  3011.           Functions which are unique to TAS (not shared by MetaStock) are
  3012.           described in detail in this document. The MetaStock functions are
  3013.           only summarized. Please refer to the Metastock documentation or
  3014.           the Encyclopedia of Technical Market Indicators for a complete
  3015.           description of the functions and their parameters.
  3016.  
  3017.           In some instances, the parameter to a MetaStock named function
  3018.           has to have single quotes around it. This is the case with any
  3019.           function that passes a single character as a parameter, such as
  3020.           the last parameter in the "mov" (Moving Average) function.
  3021.  
  3022.  
  3023.  
  3024.            Technical Indicators available in Metastock
  3025.  
  3026.  
  3027.  
  3028.           ad()      Accumulation/Distribution
  3029.           The Accumulation/Distribution indicator, developed by Marc
  3030.           Chaikin, calculates the percent range a stock moves in a given
  3031.           day and multiplies this times the volume.  The relationship of
  3032.           the close is (Close - Low) - (High - Close). This is then divided
  3033.           by the range (High - Low) and multiplied by the volume.  The
  3034.           result is added to the running total.  The buying pressure is
  3035.           compared to selling pressure for each day and like the OBV the
  3036.           indicator is cumulative.
  3037.  
  3038.           The A/D line is analyzed much like the OBV.  If a stock is going
  3039.           to rise then there should be volume behind it. This volume is
  3040.           measured by the degree the close is closer to the high of the
  3041.           day.  If there is buying pressure then the percent of the close
  3042.           times the volume will be greater.  This adds more to the A/D line
  3043.           and divergences may be detected before the price has actually
  3044.           risen to a great extent.
  3045.  
  3046.           Sample script:  {A/D Volume Line for one year of data}
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.                  Technical Analysis Scanner (TAS)               Page 51
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.            #max_quotes 265
  3065.            opengraph(3,-264,0);
  3066.            sizegraph(3,1,3);
  3067.            graph(1,'PRICE');
  3068.            graph(v,'VOLUME');
  3069.            graph(ad(),'ACCUMULATION DISTRIBUTION
  3070.           LINE',mov(ad(),30,'s'),'30
  3071.           DMA');
  3072.            closegraph();
  3073.  
  3074.           References:  Chaikin, Marc. 177 E. 77th Street, New York, NY
  3075.           10021
  3076.  
  3077.  
  3078.           adx(p)    Average Directional Movement
  3079.  
  3080.           adxr(p)   Average Directional Movement Rating
  3081.  
  3082.           add(a,b)  Add two arrays
  3083.            Add each element of array "a" to the corresponding element of
  3084.            array "b".
  3085.  
  3086.           cci(p)    Commodity Channel Index Array
  3087.            p = number of periods
  3088.  
  3089.           co()      Chaikin's Oscillator
  3090.  
  3091.           cos(a)    Trigonometric cosine
  3092.            of each entry in array 'a'.
  3093.            Use the _cos(n) function to compute the cosine of a single
  3094.            number "n".
  3095.  
  3096.  
  3097.           cum(a)    Cumulative Sum of Array "a"
  3098.  
  3099.           div(a,b)  Divide two arrays
  3100.            Divide each element of array "a" by an element of array "b".
  3101.  
  3102.           dmi(p)    Directional Movement Index
  3103.  
  3104.           exp(a)    Exponential Function
  3105.            Computes the exponential value of each entry in array "a"
  3106.            Use the _exp(n) function to compute the exponential of a
  3107.            single number "n".
  3108.  
  3109.  
  3110.           hhv(a,p)  Highest High Value
  3111.            Returns Highest High Value in the array 'a' over the  period
  3112.  
  3113.  
  3114.  
  3115.                  Technical Analysis Scanner (TAS)               Page 52
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.            'p'
  3125.  
  3126.           llv(a,p)  Lowest Low Value
  3127.            Returns Lowest Low Value in the array 'a' over the period 'p'
  3128.  
  3129.           log(a)    Exponential Logarithm
  3130.            of each entry in array 'a'.
  3131.            Use the _log(n) function to compute the exponential logarithm
  3132.            of a single number "n".
  3133.  
  3134.           macd()    Moving Average Convergence/Divergence
  3135.            Computes Gerald Appel's MACD indicator.
  3136.  
  3137.           mdi(p)    Minus Directional Movement (-DI)
  3138.  
  3139.           mo(p)     Momentum Array
  3140.            p = number of periods
  3141.  
  3142.           mov(d,p,t)  Compute Moving Average
  3143.            Moving Average Array
  3144.             d = Data Array
  3145.             p = number of periods
  3146.             t = Moving Average Type
  3147.                'E' - Exponential
  3148.                'S' - Simple
  3149.                'W' - Weighted
  3150.  
  3151.           mul(a,b)  Multiply two arrays
  3152.            Multiply each element of array "a" by the corresponding
  3153.            element of array "b".
  3154.  
  3155.           neg(a)    Negative of Array "a"
  3156.            Computes the negative of an array "a".
  3157.  
  3158.           nvi()     Negative Volume Indicator
  3159.  
  3160.           obv()     On Balance Volume
  3161.           On balance volume uses the change of the close plus volume to
  3162.           determine how much buying or selling pressure there is in a
  3163.           stock.  If the close is higher than yesterday then the volume is
  3164.           added to yesterdays OBV.  If the stock closes lower than
  3165.           yesterday the volume is subtracted from the OBV indicator.
  3166.           Because this indicator keeps a running total it can reveal the
  3167.           accumulation or distribution of a stock.  This can show early
  3168.           interest in a stock or an eventual sell off.
  3169.  
  3170.           OBV can be analyzed several ways.  A simple moving average of the
  3171.           OBV can be used to watch for breakouts.  For more intense study,
  3172.  
  3173.  
  3174.  
  3175.                  Technical Analysis Scanner (TAS)               Page 53
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.           the patterns the indicator makes can be compared to the stock for
  3185.           divergences, higher highs, or lower lows.  These patterns may
  3186.           suggest activity not seen in just in the price chart.
  3187.           Sample script:  {On Balance Volume for one year of data}
  3188.            #max_quotes 265
  3189.            opengraph(3,-264,0);
  3190.            sizegraph(3,1,3);
  3191.            graph(1,'PRICE');
  3192.            graph(v,'VOLUME');
  3193.            graph(obv(),'ON BALANCE VOLUME',mov(obv(),30,'s'),'30 DMA');
  3194.            closegraph();
  3195.  
  3196.           References:  Granville, Joseph E.  New Strategy of Daily Stock
  3197.           Market Timing for Maximum Profit.  Englewood Cliffs NJ:
  3198.           Prentice_Hall, 1976.
  3199.  
  3200.           oscp(p1,p2,t,r)   Price Oscillator
  3201.            Price Oscillator formed by subtracting a "t" type "p2" day
  3202.            moving average of the Closing Price from a "t" type "p1" day
  3203.            moving average of the Closing Price.
  3204.             p1 = shorter moving average period
  3205.             p2 = longer moving average period
  3206.            t = Moving Average Type
  3207.             'E' - Exponential
  3208.             'S' - Simple
  3209.             'W' - Weighted
  3210.            r = ROC Type
  3211.             '%' - percentage ROC
  3212.             '$' - Unit ROC
  3213.  
  3214.           oscv(p1,p2,t,r)   Volume Oscillator
  3215.            Volume Oscillator formed by subtracting a "t" type "p2" day
  3216.            moving average of the Volume from a "t" type "p1" day moving
  3217.            average of the Volume.
  3218.             p1 = shorter moving average period
  3219.             p2 = longer moving average period
  3220.                t = Moving Average Type
  3221.                  'E' - Exponential
  3222.                  'S' - Simple
  3223.                  'W' - Weighted
  3224.  
  3225.             r = ROC Type
  3226.                '%' - percentage ROC
  3227.                '$' - Unit ROC
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.                  Technical Analysis Scanner (TAS)               Page 54
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.           pdi(p)    Positive Directional Movement (+DI)
  3245.  
  3246.           per()     Performance Indicator
  3247.            Performance Indicator computed as follows:
  3248.             
  3249.  
  3250.           pvi()     Positive Volume Indicator
  3251.  
  3252.           rsi(p)    Wilder's Relative Strength Indicator
  3253.            p = number of periods
  3254.  
  3255.           roc(d,p,r)  Rate Of Change Array
  3256.            Computes the rate of change of the data array "D" over "p"
  3257.            periods, using either a percentage basis or a dollar unit
  3258.            basis.
  3259.             d = Data Array
  3260.             p = number of periods
  3261.             r = ROC Type
  3262.                '%' - percentage ROC
  3263.                '$' - Unit ROC
  3264.  
  3265.           sar(i,m)  Wilder's Parabolic (SAR)
  3266.            or Stop and Reverse  indicator. Create a parabolic stop line
  3267.            either over or under the price graph.
  3268.            where
  3269.              'i' = increment value and initial
  3270.              'm' = maximum acceleration factor
  3271.  
  3272.            Wilder's explanation uses the values of  i = .02 and m= 0.20
  3273.  
  3274.            In ChartPro, this indicator is referred to as Technical Study
  3275.            'PTP'
  3276.  
  3277.           sin(a)    Trigonometric sine
  3278.             of each entry in array 'a'
  3279.            Use _sin(n) for the sine of a single number.
  3280.  
  3281.  
  3282.           sqrt(a)   Square root
  3283.            of each entry in array 'a'.
  3284.            Use the _sqrt(n) function to compute the square root of a
  3285.            single number "n".
  3286.  
  3287.  
  3288.           std(d,p)  Statistical Standard Deviation.
  3289.            Computes the standard deviation of the array 'd' using 'p'
  3290.            data points. Defined as the square root of the variance (see
  3291.            var below).
  3292.  
  3293.  
  3294.  
  3295.                  Technical Analysis Scanner (TAS)               Page 55
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.           stoch(p,s)  Stochastic Oscillator
  3305.             p = number of periods
  3306.             s = k slowing periods
  3307.  
  3308.           sub(a,b)  Subtract one array from another
  3309.            Subtract each element of array "b  from the corresponding
  3310.            element of array "a".
  3311.  
  3312.           sum(a,p)  Summation of array over period
  3313.            Create a 'p' day summation of array 'a'.
  3314.  
  3315.           tan(a)    Trigonometric tangent
  3316.            of each entry in array 'a'.
  3317.            Use _tan(n) for the tangent of a single number.
  3318.  
  3319.           trix(p)   TRIX Function
  3320.            Calculate a 1 day percent Rate of Change of a p day triple
  3321.            exponential moving average of the closing price.
  3322.  
  3323.           tsf(a,p)  Time Series Forecast  function.
  3324.            This function computes a p day linear regression of the array
  3325.            a for each day.
  3326.  
  3327.           var(d,p)  Statistical VARIANCE
  3328.            of the array 'p' over the time period 'p'.
  3329.  
  3330.           vol(pm,pr)  Volatility Indicator.
  3331.            This is the 'pr' day Rate Of Change Oscillator of a 'pm' day
  3332.            exponential Moving Average of the difference between each
  3333.            day's high and low price.
  3334.  
  3335.           wc()      Weighted Close
  3336.             defined as (2 * CLOSE + HIGH + LOW)/4
  3337.  
  3338.           willa()   William's Accumulation/Distribution.
  3339.  
  3340.           willr(p)  William's %R
  3341.            for 'p' periods. This is equivalent to a 'p' period stochastic
  3342.            with 1 day smoothing. The result is then reduced by 100.
  3343.  
  3344.  
  3345.           zig(a,r,t)  Zig Zag Function
  3346.            Compute a ZIG ZAG function for array 'a'. 'r' is the minimum
  3347.            percentage or unit (dollar) change which must be made in order
  3348.            to reflect a change in the Zig Zag line. The third parameter
  3349.            't' is either '%' or '$'. If it is '%', then the 'r' value is
  3350.            expressed as a percentage change, otherwise it is a unit (or
  3351.            dollar) change.
  3352.  
  3353.  
  3354.  
  3355.                  Technical Analysis Scanner (TAS)               Page 56
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.            If you want to see what kind of profits you could make, run
  3365.            the ZIG.PTS Profit Test file.  According the Equis Metastock
  3366.            User's Manual, "The Zig Zag indicator has 20/20
  3367.            hindsight...Unfortunately, the Zig Zag's foresight is not as
  3368.            profitable. This is because the last "leg" of the Zig Zag
  3369.            indicator isn't fixed until future prices are known. If you
  3370.            use the Zig Zag  indicator to predict future prices, you are
  3371.            probably fooling yourself." Sorry, but that's the way it
  3372.            works. It is provided in TAS as a sort  of "benchmark" to
  3373.            judge how much the IDEAL strategy could SQUEEZE  out of a
  3374.            portfolio. It is nearly ideal, because it knows the future.
  3375.  
  3376.  
  3377.  
  3378.            TAS Functions
  3379.  
  3380.  
  3381.  
  3382.           addto(a,n)  Add number to array
  3383.            Adds the number "n" to each entry of array "a" and returns the
  3384.            result in an array.
  3385.  
  3386.           angle(a)  Angle of a line
  3387.            returns the angle in degrees of the line described by the
  3388.            array 'a'. This function is only usable on an array that has
  3389.            been created by either linreg or linreg2.
  3390.  
  3391.           alpha()   Alpha function
  3392.            The alpha function is a "sister" function of the beta
  3393.            function. This function describes how much the stock's price
  3394.            would have moved on average on a yearly basis assuming the
  3395.            INDEX did not change. An alpha  of .20 means that the stock
  3396.            would have increased  20% more than the INDEX during the year.
  3397.            In terms of a two way linear regression (performed by the beta
  3398.            function), the alpha is  related to the y-intercept of the
  3399.            linear regression line.
  3400.            It is important to note that the alpha function must be called
  3401.            immediately after the beta function. At any other time, the
  3402.            results of the alpha  function are undefined.
  3403.  
  3404.           avgprc()  Average Price
  3405.            Creates an array where each entry is that day's
  3406.            (HIGH+LOW+CLOSE)/3
  3407.  
  3408.           bbandt(p,s) Top Bollinger Band
  3409.            Bollinger Band upper (top) indicator for "p" periods with "s"
  3410.            standard deviations added to the p-day simple moving average.
  3411.  
  3412.  
  3413.  
  3414.  
  3415.                  Technical Analysis Scanner (TAS)               Page 57
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.           bbandb(p,s) Bottom Bollinger Band
  3425.            Bollinger Band lower (bottom) indicator for "p" periods with
  3426.            "s" standard deviations subtracted from the p-day simple
  3427.            moving average.
  3428.  
  3429.           beta(r)   "Beta" function
  3430.            The beta function calculates the linear regression of the
  3431.            percentage rate of change of the closing price (of the current
  3432.            ticker being processed) to the percentage rate of change of
  3433.            the INDEX.
  3434.            Values of r, the rate of change period, are
  3435.             'D'  Daily rate of change
  3436.             'W'  Weekly rate of change
  3437.             'M'  Monthly rate of change
  3438.            The weekly rate of change calculates the rate of change from
  3439.            Friday to Friday and the monthly rate of change calculates the
  3440.            rate of change from the first of each month.
  3441.  
  3442.            The actual value returned by the beta function is the slope of
  3443.            the line created by this two way linear regression.
  3444.  
  3445.            The purpose of the beta function is to measure the stock's
  3446.            sensitivity to movement in the general market over the period
  3447.            of time chosen. A beta value of 2.00 means that the stock
  3448.            tends to move with the market, but 2 times as far (percentage
  3449.            change is twice as much). A beta of -.5 means that the stock
  3450.            moves in the opposite direction of the market, but only one
  3451.            half as far.
  3452.  
  3453.           corrcoef()  Correlation Coefficient
  3454.            returns the "correlation coefficient" of the last linear
  3455.            regression performed. This value ranges from -100 to +100. If
  3456.            the data points match the points in the linear regression
  3457.            approximation, the correlation coefficient will be 100. If the
  3458.            points show no correlation with the approximation, the
  3459.            correlation coefficient will be zero.
  3460.  
  3461.  
  3462.           datestr(d)  Create a formatted date
  3463.            Create a "date string" in the form MM/DD/YY from the DATES
  3464.            array entry 'd'.
  3465.  
  3466.  
  3467.           daymon(d) Day of Month function
  3468.            Returns the "DAY OF THE MONTH" of the DATE contained in
  3469.            variable "d". The value returned is the day of the month. For
  3470.            example, daymon(910204) will return 4.
  3471.  
  3472.  
  3473.  
  3474.  
  3475.                  Technical Analysis Scanner (TAS)               Page 58
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.           daywk(d)  Day of Week function
  3485.            Returns the "DAY OF THE WEEK" of the DATE contained in
  3486.            variable "d". The value returned is a number from 0 to 6,
  3487.            where 0 is Sunday, 1 is Monday, 2 is Tuesday, 3 is Wednesday,
  3488.            4 is Thursday, 5 is Friday and 6 is Saturday.
  3489.  
  3490.  
  3491.           divby(a,x)  Divide array by number
  3492.            Divide each element of array "a" by the value of "x". In this
  3493.            case, "x" is a single number.
  3494.  
  3495.  
  3496.           dump_array   Dump Array Contents
  3497.            dump_array(a1,a2...aN)
  3498.            Dump the contents of arrays"a1" to "aN" to the screen or a
  3499.            file. Each entry in the array is shown as a decimal number
  3500.            with the entry number in square brackets to the left, followed
  3501.            by the date. DUMP_ARRAY can be called with up to 12 array
  3502.            names. They will be printed side-by-side on the display.
  3503.            This function is useful for checking out the contents of an
  3504.            array...in other words, it is a debugging tool, not a report
  3505.            generating tool.
  3506.  
  3507.  
  3508.           int(x)    Create Integer
  3509.            Turns the number "x" into an "integer" by dropping any part of
  3510.            the number to the right of the decimal point. An integer is a
  3511.            number without a fractional part (the part after the decimal).
  3512.            The maximum number that you can turn into an integer is
  3513.            32,767.
  3514.  
  3515.  
  3516.           isect(a,b)  Find array intersection
  3517.            Find the latest intersecting point of the two arrays "a" and
  3518.            "b". Returns the number of days since the two arrays
  3519.            intersected (as a negative number) or 1 (positive one) if they
  3520.            have never intersected.
  3521.  
  3522.            NOTE:
  3523.            Since the graph of the two arrays actually crosses BETWEEN two
  3524.            days, the value returned will be the later day AFTER the
  3525.            crossing. For example, if the arrays crossed between yesterday
  3526.            and today, the value returned will be zero. If they crossed
  3527.            between two days ago and yesterday, the value returned will be
  3528.            -1, and so forth.
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.                  Technical Analysis Scanner (TAS)               Page 59
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.           linreg    Linear Regression over time
  3545.            linreg(a,s,e) Create a linear regression line using
  3546.            "least-squares" method to find the mathematical average of the
  3547.            values in the array "a" starting at entry "s" and ending at
  3548.            entry "e". If "s" is zero, it refers to the first value in the
  3549.            array. If "e" is zero, it refers to the last value in the
  3550.            array. Positive values for "s" or "e" refer to the appropriate
  3551.            array entries (counting from 0).
  3552.            A negative number in the "s" or "e" index is subtracted from
  3553.            the total number of entries in the array to get the
  3554.            appropriate positive array index. For example,
  3555.                x : array;
  3556.                x := linreg(c,-50,-10);
  3557.            will find the line passing most closely through the closing
  3558.            prices from 50 days before the last day in the file to 10 days
  3559.            before the last day in the file.
  3560.  
  3561.  
  3562.           linreg2   Linear Regression of two variables
  3563.            linreg2(y,x,s,e)
  3564.            Create a linear regression line using "least-squares" method
  3565.            to find the mathematical  average of the values in the array y
  3566.            over the array x starting at entry "s" and ending at entry
  3567.            "e". If "s" is zero, it refers to the first value in the
  3568.            array. If "e" is zero, it refers to the last value in the
  3569.            array. Positive values for "s" or "e" refer to the appropriate
  3570.            array entries (counting from 0).
  3571.             A negative number in the "s" or "e" index is subtracted from
  3572.            the total number of entries in the array to get the
  3573.            appropriate positive array index. For example,
  3574.                x : array;
  3575.                x := linreg2(c,v,-50,-10);
  3576.            will find the line passing most closely through the closing
  3577.            prices and volume from 50 days before the last day in the file
  3578.            to 10 days before the last day in the file.
  3579.  
  3580.  
  3581.           load(t,f) Load a data array
  3582.           The load function will retrieve the first occurrence of a ticker
  3583.           from the Metastock directory. The ticker is specified as the
  3584.           first parameter to the load function.
  3585.  
  3586.           The second parameter of the load function is the field to be
  3587.           loaded from the ticker file. The name of the field must be
  3588.           surrounded by single quotes or it must be a string variable
  3589.           containing the name of the field. The field names are the same as
  3590.           the pre-defined data array names, that is, C for closing price, H
  3591.           for high price, etc.
  3592.  
  3593.  
  3594.  
  3595.                  Technical Analysis Scanner (TAS)               Page 60
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.           The value returned from the load function is an array containing
  3606.           the portion of the ticker file requested by the field name.
  3607.  
  3608.  
  3609.           macdx(s,l,t)   "MACD Extended"
  3610.            Compute an MACD indicator using a short term EMA of "s"
  3611.            periods, a long term EMA of "l" periods, and a trigger line of
  3612.            "t" periods.  
  3613.  
  3614.           mfi(p)    "Money Flow Index"
  3615.            as described in Equis "The Pointer" Volume 5, Number 4 and
  3616.            corrected in Vol 6, Number 1.
  3617.  
  3618.           month(d)  Month function
  3619.            Returns the Month (1-12) of the date value contained in the
  3620.            parameter.
  3621.  
  3622.           mulby(a,x)     Multiply by number
  3623.            Multiply each element of array "a" by the value of "x". In
  3624.            this case, "x" is a single number.
  3625.  
  3626.  
  3627.           over(a,b) Over function
  3628.            If array "a" is "over" array "b", this function returns the
  3629.            number of days since array "a" crossed above(or over) array
  3630.            "b".  See the description of the isect function page  for the
  3631.            values returned when the arrays cross.
  3632.  
  3633.  
  3634.           peak(a,n) Find Peak in Array
  3635.            returns the index of the 'n'-th peak value in array 'a'. A
  3636.            'peak' is defined as a high value surrounded by lower values.
  3637.            The value returned from this function is the array index to
  3638.            the peak value.
  3639.  
  3640.            In the figure above, the peak(C,2) call would return the index
  3641.            of the point marked P2. If you consider the volume vertical
  3642.            bars a day, then the value returned in this example would be
  3643.            '-13', or 13 days prior to the last day.
  3644.  
  3645.  
  3646.           per1(a)   Performance using Array
  3647.            Computes the "performance indicator" for an array a. The
  3648.            performance indicator is computed as
  3649.                
  3650.  
  3651.                                 
  3652.  
  3653.  
  3654.  
  3655.                  Technical Analysis Scanner (TAS)               Page 61
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.           set(a,v)  Set Array to Value
  3665.            Sets all entries in array 'a' to the value 'v'. For example,
  3666.            you could use this function to create an array where each
  3667.            entry is 22.5.
  3668.  
  3669.  
  3670.           slope(a)  Slope of Line
  3671.            will return the mathematical "slope" of the line whose points
  3672.            are contained in array "a". This array must have been created
  3673.            with the linreg function.
  3674.  
  3675.           strlen(s) String Length
  3676.            The strlen function will return the length of the string
  3677.            variable "s" as an integer. For example,
  3678.             X = strlen('IBM');
  3679.            will set X to 3.
  3680.  
  3681.           subfrom(a,n)   Subtract number from array
  3682.            Subtract the number "n" from each entry in array "a" returning
  3683.            the result in an array.
  3684.  
  3685.           substr(s,b,l)  Substring function
  3686.            The substr function takes a string "s" as the first argument
  3687.            and extracts the substring starting at character position 'b"
  3688.            for the length "l".  For example,
  3689.             X = substr('ABCDEF', 2,4)
  3690.            will create set the variable X to the string 'BCDE'.
  3691.  
  3692.           trough(a,n) Find Trough in Array
  3693.            returns the index of the 'n'-th "trough" value in array 'a'. A
  3694.            'trough' is defined as a low value surrounded by higher
  3695.            values. The value returned from this function is the array
  3696.            index to the trough value.
  3697.  
  3698.            In the figure shown with the peak function above, the
  3699.            trough(C,2) call would return the index of the point marked
  3700.            'T2'.  Based on the volume bars shown, the value returned in
  3701.            this example would be '-11', or 11 days prior to the last day.
  3702.  
  3703.  
  3704.           tr()      Wilder's True Range
  3705.            This function creates an array containing for each day, the
  3706.            higher of the following differences :
  3707.            Between today's high and today's low.
  3708.            Between today's high and yesterday's close.
  3709.            Between today's low and yesterday's close.
  3710.             
  3711.            The value of tr() for any day is always positive or zero.
  3712.  
  3713.  
  3714.  
  3715.                  Technical Analysis Scanner (TAS)               Page 62
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.           trim()    Trim blanks from a string
  3725.            This function takes a string variable as input and returns a
  3726.            string variable as the return value. The returned string
  3727.            variable has all spaces removed from the right hand portion.
  3728.  
  3729.           year(d)   Year function
  3730.            Returns the Year (0-99) of the date value contained in the
  3731.            parameter.
  3732.  
  3733.  
  3734.           zero(a)   Zero Array
  3735.            Sets each entry of array 'a' to zero.
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.                  Technical Analysis Scanner (TAS)               Page 63
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.                                   Output Functions
  3785.  
  3786.  
  3787.  
  3788.  
  3789.            WRITE and WRITELN  Functions
  3790.  
  3791.  
  3792.           There are two direct output functions, WRITE and WRITELN. The
  3793.           WRITELN function is identical to the WRITE function, except that
  3794.           WRITELN causes a NEW LINE to be added at the end of the last
  3795.           field.
  3796.  
  3797.           The parameters to WRITE (and WRITELN) are either text strings,
  3798.           like 'this is a text string', surrounded by single quotes ('), or
  3799.           "variable values". A variable value is a value that you have
  3800.           assigned to a name by use of a formula or constant setting. There
  3801.           are "pre-defined" variables, such as H, L, C, V, O, TICKER,
  3802.           FULLNAME. These pre-defined variables are "filled in" when TAS
  3803.           reads the data values for each symbol.
  3804.  
  3805.           You can control the formatting of your output to some extent by
  3806.           using the characters sequence "\t" (backslash tee) in your text
  3807.           string. This will place a "tab" character in the output. TAS
  3808.           places "tab stops" every 4 columns of the output line.
  3809.  
  3810.           You can cause a new page to be printed by placing a "\f"
  3811.           (formfeed) in your WRITELN string.
  3812.  
  3813.           In addition, the sizes of the two types of "numbers", are
  3814.           constant. If you are printing an INTEGER value, it is five
  3815.           characters wide, left-justified. If you are printing a number
  3816.           with a decimal point, it is eight characters wide (99999.999).
  3817.           This will allow you to line up the output with column headings.
  3818.  
  3819.  
  3820.  
  3821.            FORMAT Function
  3822.  
  3823.  
  3824.           The FORMAT function can be used to precisely control the way
  3825.           numbers print. This function takes two arguments. The first
  3826.           argument is the number to be formatted. The second argument is a
  3827.           "format specifier" string. A format specifier string is  is
  3828.           formed as follows:
  3829.             % [width] [.prec] [type]
  3830.  
  3831.           The [width] is the minimum number of characters to print.
  3832.  
  3833.  
  3834.  
  3835.                  Technical Analysis Scanner (TAS)               Page 64
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.           The [.prec] is the maximum number of characters to print or the
  3846.           minimum number of digits to print.
  3847.  
  3848.             [type] for the FORMAT function can only be
  3849.             'f'  for REAL numbers
  3850.  
  3851.           For example, to print the closing price without the decimal point
  3852.           normally printed with the WRITELN fucntion, you could say
  3853.             writeln('Closing price is ',format(c of today,'%4.0f'));
  3854.  
  3855.           This would print the closing price in a field that is 4
  3856.           characters wide with zero decimal places. Note also that the
  3857.           closing price printed would be rounded to the nearest integer.
  3858.  
  3859.  
  3860.  
  3861.            SORT Functions
  3862.  
  3863.  
  3864.           TAS contains functions which can be used to sort your report
  3865.           output. Rather than doing WRITE and WRITELN, you can call the
  3866.           SORTOUT function to place the report data in a "sort buffer".
  3867.           Once all the tickers have been processed (when LAST_TICKER is 1),
  3868.           you can then sort the data using the SORTON function. Finally,
  3869.           you can retrieve the sorted "lines" with the SORTGET function or
  3870.           print them with the SORTPRINT function.
  3871.  
  3872.           If you want to experiment with the SORT commands, you should
  3873.           start out simply and then work toward more complex combinations.
  3874.           These are advanced functions and are not necessarily appropriate
  3875.           for the person who doesn't want to plan their requirements.
  3876.  
  3877.           In order to understand how the  sort commands work, you need to
  3878.           understand some terms. The first term is a  "line".  Each time
  3879.           you use the SORTOUT function, you give it a "line" of data which
  3880.           is placed in the "sort buffer". Each "line" is composed of
  3881.           'columns". A "column" is a group of data values that are repeated
  3882.           for each SORTOUT function.  So, for example, if you wanted to
  3883.           create a list of TICKERs and their Closing Prices, you would have
  3884.           two "columns", the TICKER and the Closing Price for the ticker.
  3885.           The "line" would consist of the combination of the TICKER and
  3886.           Closing Price.
  3887.  
  3888.           SORTOUT
  3889.           The SORTOUT function takes up to 40 parameters which are fields
  3890.           to be placed in the 'sort buffer'. As each ticker is processed,
  3891.           you can place the computed results in the 'sort buffer'.
  3892.  
  3893.  
  3894.  
  3895.                  Technical Analysis Scanner (TAS)               Page 65
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.           For example, suppose you wanted to create a report of tickers in
  3906.           order by their volume. You wanted the report to contain the
  3907.           TICKER, the High, Low and Closing prices as well. For each ticker
  3908.           you would say
  3909.             SORTOUT(TICKER,H,L,C,V);
  3910.  
  3911.           SORTON
  3912.           Once all tickers have been processed, and their lines of data
  3913.           have been placed in the sort buffer using the SORTOUT function,
  3914.           you can sort the lines of data with the SORTON function. The
  3915.           SORTON function requires pairs of two parameters as follows:
  3916.  
  3917.             SORTON(column_number_1, direction_1,column_number_2,
  3918.             direction_2,....,column_number_N,direction_N)
  3919.  
  3920.             where:
  3921.             column_number_*    is the parameter position of the data
  3922.                     field  (column) in the SORTOUT command that placed
  3923.                     the data in the sort buffer.
  3924.             direction_*   is either 'a' for ASCENDING or 'd' for
  3925.                     DESCENDING sort.
  3926.  
  3927.           The SORTON function will sort first on column_number_1 in
  3928.           direction_1, then on the next column/direction pair, etc.
  3929.           Using the example given in the SORTOUT description above, since
  3930.           the report was to be sorted by VOLUME, that is the 5th parameter
  3931.           position ("column") in the SORTOUT function shown.
  3932.  
  3933.           The SORTON function returns as its value the number of records in
  3934.           the sort buffer.
  3935.  
  3936.           SORTGET
  3937.           After a SORTON function is called, the data in the sort array is
  3938.           in some particular sorting order. If you want to retrieve each
  3939.           "line" from the sort array, one at a time, you can use the
  3940.           SORTGET function.  When you use the SORTGET function, you are
  3941.           asking TAS to "retrieve" the columns of data in the next line
  3942.           from the sort buffer and to place those data values in the
  3943.           variables you specify as parameters to the SORTGET function.
  3944.  
  3945.           After the SORTGET function returns, the variables you named in
  3946.           the SORTGET function call will be "filled in" with the values
  3947.           from the next line (in sequence) of the sort buffer.
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.                  Technical Analysis Scanner (TAS)               Page 66
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.             SORTGET(v1,v2,v3,....,vN)
  3965.  
  3966.             where
  3967.             v1   is the first variable to be filled in by SORTGET
  3968.             v2   is the second variable to be filled in by SORTGET,
  3969.                     and
  3970.              vN   is the last variable to be filled in by SORTGET. The
  3971.                     number "N" must be exactly equal to the number of
  3972.                     parameters used in the SORTOUT command that filled in
  3973.                     the sort buffer.
  3974.  
  3975.           The SORTGET function returns as its value a 1 (one) if the
  3976.           variables were "filled in" by a record from the sort buffer and 0
  3977.           (zero) if not.  This returned value can be used in a WHILE loop
  3978.           to determine when the last sort record has been obtained.
  3979.                
  3980.  
  3981.           SORTPRINT
  3982.           The trickiest part of using the SORT feature is the specification
  3983.           of the 'format string' used by the SORTPRINT function. If you
  3984.           have access to a C Programming book, you will find the format
  3985.           specifications under the PRINTF() function description. Short of
  3986.           that, a summary of the types of format specifiers follows:
  3987.  
  3988.           A format specifier is formed as follows:
  3989.             % [width] [.prec] [type]
  3990.  
  3991.           The [width] is the minimum number of characters to print.
  3992.  
  3993.           The [.prec] is the maximum number of characters to print or the
  3994.           minimum number of digits to print.
  3995.  
  3996.           [type] is one of three values:
  3997.             'ld' for INTEGER values (result of INT() function)
  3998.             'f'  for REAL numbers (most results)
  3999.             's'  for a STRING CONSTANT (like TICKER or DATE)
  4000.  
  4001.           So, to print the results of the SORTOUT request given above,
  4002.           there must be five format specifiers (since there are five
  4003.           parameters to SORTOUT). The first parameter is the TICKER (which
  4004.           is a 'string') so its format specifier would simply be '%s'.
  4005.  
  4006.           The next three fields are all 'real' numbers (that is, they have
  4007.           decimal points), so their format could be '%7.3f' which would
  4008.           say, make the field 7 characters wide, and include three decimal
  4009.           places, like this '999.999', so this will work fine unless the
  4010.           price is greater than 1000. If it were, you could make the field
  4011.           '%8.3f' to add more room at the left.
  4012.  
  4013.  
  4014.  
  4015.                  Technical Analysis Scanner (TAS)               Page 67
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.           Finally, the last field, V (VOLUME) does not contain any portion
  4026.           beyond the decimal point. That is, shares are reported in whole
  4027.           numbers. But, because Volume is typically larger than the maximum
  4028.           value of an "integer" field (32,767) , it is also a 'REAL'
  4029.           number. To make the volume field report in whole units, without a
  4030.           decimal point, you would say '%8.0f' which would place volume in
  4031.           an eight character field with no decimal.
  4032.  
  4033.           So, the format string for the SORTPRINT would be:
  4034.             SORTPRINT('%s %7.2f %7.2f %7.2f %8.0f\n');
  4035.  
  4036.           The '\n' at the end of the SORTPRINT format string is to start a
  4037.           NEW LINE after printing this line.
  4038.  
  4039.  
  4040.  
  4041.            Column Headings
  4042.  
  4043.  
  4044.           For an example of controlling the printing of 'headings' in your
  4045.           TAS output, go to the section describing the pre-defined variable
  4046.           FIRST_TICKER. Using this variable, you can determine when to
  4047.           print a heading initially in your report.
  4048.  
  4049.           In addition, since all variables are initially set to zero before
  4050.           the first TICKER file is processed, you can use a variable to
  4051.           accumulate a "line count". You can test this variable and
  4052.           generate a new heading each time it is greater than the number of
  4053.           lines on your page (e.g. 66). An example of how to place a
  4054.           heading on each page of the report follows:
  4055.  
  4056.           IF FIRST_TICKER OR (LINE_COUNT > 65) THEN
  4057.           BEGIN
  4058.           LINE_COUNT := 0;
  4059.           WRITELN('YOUR REPORT HEADING WOULD GO HERE');
  4060.           END;
  4061.  
  4062.  
  4063.           Then, each time you wrote a line in your script you would execute
  4064.           the statement: LINE_COUNT := LINE_COUNT + 1;
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.                  Technical Analysis Scanner (TAS)               Page 68
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.                                Profit Test Statements
  4085.  
  4086.           Profit Test Statements are used to:
  4087.  
  4088.             Define which Technical Indicators are to be computed.
  4089.  
  4090.             Define BUY conditions
  4091.  
  4092.             Define SELL conditions
  4093.  
  4094.             Define STOP conditions
  4095.  
  4096.  
  4097.  
  4098.  
  4099.            See Page  for an explanation of how the price at which a
  4100.            transaction is executed is determined.
  4101.  
  4102.  
  4103.  
  4104.           The statements used to describe the situations above are
  4105.           described in the next 4 sections.
  4106.  
  4107.  
  4108.  
  4109.            PLOT statement: Define Technical Indicators
  4110.  
  4111.  
  4112.           The PLOT statement is used to create the formulas or indicators
  4113.           which will be used in the subsequent profit test. The PLOT
  4114.           statement is executed once per ticker symbol, and must be placed
  4115.           prior to any of the BUY/SELL/STOP WHEN conditions.
  4116.  
  4117.           The format of the PLOT statement is:
  4118.  
  4119.                PLOT stmt;
  4120.  
  4121.           where 'stmt' can be a single statement or a BEGIN..END block. For
  4122.           example, if your profit test is to test the Commodity Channel
  4123.           Index (CCI) for 14 days, you could say:
  4124.  
  4125.           CCI_ARRAY : ARRAY;    { Define the cci array}
  4126.           PLOT CCI_ARRAY := CCI(14);
  4127.  
  4128.           In the example, only one indicator is computed, so there was no
  4129.           need to use the BEGIN..END block. Suppose, however, that we want
  4130.           to incorporate Wilder's RSI in the profit test as well. Then we
  4131.           would say:
  4132.  
  4133.  
  4134.  
  4135.                  Technical Analysis Scanner (TAS)               Page 69
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.           CCI_ARRAY : ARRAY;    { Define the cci array}
  4146.           RSI_ARRAY : ARRAY;    { Define the rsi array}
  4147.           PLOT BEGIN
  4148.             CCI_ARRAY := CCI(14);
  4149.             RSI_ARRAY := RSI(14);
  4150.           END;   { of PLOT statement}
  4151.  
  4152.  
  4153.  
  4154.            BUY WHEN - Define BUY Conditions
  4155.  
  4156.  
  4157.           The BUY WHEN condition causes the profit tester to 'buy' the
  4158.           stock if the condition is true.
  4159.  
  4160.                BUY WHEN expression;
  4161.  
  4162.           where 'expression' can be any combination of logical or
  4163.           relational operators.
  4164.  
  4165.           For example, using the last PLOT statement in the previous
  4166.           example, we will issue a BUY signal when the CCI rises above -100
  4167.           and the RSI is less than 40:
  4168.  
  4169.           BUY WHEN cci_array OF YESTERDAY IS LESS THAN < -100
  4170.             AND cci_array OF TODAY  IS GREATER THAN -100
  4171.             AND rsi_array IS LESS THAN 40;
  4172.  
  4173.  
  4174.  
  4175.            SELL WHEN - Define SELL Conditions
  4176.  
  4177.  
  4178.           The SELL WHEN condition causes the profit tester to 'sell' the
  4179.           stock if the condition is true.
  4180.  
  4181.             SELL WHEN expression;
  4182.  
  4183.           where 'expression' can be any combination of logical or
  4184.           relational operators.
  4185.  
  4186.           For example, using the last PLOT statement in the previous
  4187.           example, we will issue a SELL signal when the CCI drops below 100
  4188.           and the RSI is greater than 60:
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.                  Technical Analysis Scanner (TAS)               Page 70
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.             SELL WHEN cci_array OF YESTERDAY > 100
  4205.                AND cci_array OF TODAY < 100
  4206.                AND rsi_array OF TODAY IS GREATER THAN 60;
  4207.  
  4208.  
  4209.  
  4210.            STOP (LONG or SHORT) Condition
  4211.  
  4212.  
  4213.           The STOP LONG and STOP SHORT statements close a "long" position
  4214.           or a "short" position, respectively, by either selling or buying
  4215.           to cover an open position.
  4216.  
  4217.           To close out a long position (by selling), the statement is:
  4218.  
  4219.             STOP LONG WHEN expression;
  4220.  
  4221.           where 'expression' can be any combination of logical or
  4222.           relational operators.
  4223.  
  4224.           To close out a short position (by buying), the statement is:
  4225.  
  4226.             STOP SHORT WHEN expression;
  4227.  
  4228.           where 'expression' can be any combination of logical or
  4229.           relational operators.
  4230.  
  4231.           Adding a long stop to the example built in the prior sections, we
  4232.           could say that we want to issue a stop if, after having gone
  4233.           long, the CCI drops below -100 again. In that case, we could say:
  4234.  
  4235.           STOP LONG WHEN cci_array < -100;
  4236.  
  4237.  
  4238.  
  4239.            TAS Profit Tester Functions
  4240.  
  4241.  
  4242.           The Profit Tester feature of TAS uses the following functions to
  4243.           indicate the buy/sell transactions controlled by a Profit Testing
  4244.           script.
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.                  Technical Analysis Scanner (TAS)               Page 71
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.            pt_buy()      Buy the stock at the current closing price if not
  4265.                         already held. If testing Short positions, buy to
  4266.                         'cover' the short sale.
  4267.  
  4268.            pt_sell()     Sell the stock at the current closing price if it
  4269.                         has been bought. If testing Short positions, sell
  4270.                         the stock short.
  4271.  
  4272.            pt_stop(t)    Issue either a Long Stop or a Short Stop. The
  4273.                         parameter 't' is either 'L' for a Long Stop, or 'S'
  4274.                         for a Short Stop.
  4275.  
  4276.            pt_price(t)   Returns the share price at which the last OPEN
  4277.                         transaction was executed. If there is currently no
  4278.                         position held, then the value returned depends on
  4279.                         the value of the parameter t. If t' is 'L', the
  4280.                         value returned is 0. If t is 'S', the value
  4281.                         returned is 9999999.0.
  4282.                          The function is useful if you want to set a STOP
  4283.                         based on the change in price. The parameter t is
  4284.                         either 'L' for a Long Position, or 'S' for a Short
  4285.                         Position.
  4286.            pt_setprice(p)  Sets the price at which the next transaction
  4287.                         will take place, where p is the price.
  4288.  
  4289.  
  4290.           Profit Test Phases - Advanced Use Only
  4291.           TAS runs the profit test in two phases. The first phase, called
  4292.           PLOT PHASE is when the script should compute the arrays to be
  4293.           tested during the next phase. This next phase is the TEST PHASE.
  4294.           This phase is entered for the data points of the ticker file.
  4295.           After all data points have been processed, the END PHASE
  4296.           indicator is set. Each 'phase' of the Profit Test process is
  4297.           indicated by a variable being equal to 1.
  4298.  
  4299.           The two phases are analogous to the steps you might run in
  4300.           Metastock to do the Profitability Test. First, you would plot an
  4301.           indicator, moving average, or custom formula. This is similar to
  4302.           the 'PLOT PHASE' in TAS. Next, you would run the Profit Tester
  4303.           specifying your Buy/Sell conditions. Metastock then applies your
  4304.           Buy/Sell signals to each plotted point on the graph, proceeding
  4305.           left to right until it reaches the last day loaded. This is the
  4306.           'TEST PHASE' in TAS.
  4307.  
  4308.           When the TEST PHASE is entered with the last day of the ticker
  4309.           file, a variable, called 'END_PHASE' is set to 1. Testing this
  4310.           variable will allow you to print out the results for the Profit
  4311.           Test.
  4312.  
  4313.  
  4314.  
  4315.                  Technical Analysis Scanner (TAS)               Page 72
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.           For each ticker, the script is entered once for the PLOT Phase,
  4326.           and then as many times as there are data points for the TEST
  4327.           Phase.
  4328.  
  4329.  
  4330.            If you use the PT_BUY, PT_SELL, PT_STOP, PT_PRICE functions,
  4331.            you will need to understand the different phases for the
  4332.            Profit Tester. However, if you use the BUY WHEN, SELL WHEN,
  4333.            STOP ... WHEN and PLOT forms of the Profit Test, you do not
  4334.            need to be concerned about the different Profit Tester phases,
  4335.            since the script generates the appropriate phase testing
  4336.            automatically. You should   use the BUY, SELL and STOP WHEN
  4337.            statements to do your PROFIT TESTING. See RSIPT.TAS for an
  4338.            example.
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.                  Technical Analysis Scanner (TAS)               Page 73
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.                                    GRAPH Functions
  4385.  
  4386.           The TAS GRAPH functions increase the power of TAS by making it
  4387.           possible to display the contents of any indicator, either
  4388.           builtin, or created by the user, in a graphical display. You can
  4389.           write a script that selects only those tickers with the
  4390.           conditions you are looking for, and when one of them is found,
  4391.           display a graph of the indicators and the stock price action.  Up
  4392.           to 10 individual graphs with up to 10 indicators on each graph
  4393.           can be displayed at once with the GRAPH feature. Individual
  4394.           graphs can be assigned their own sizes relative to the other
  4395.           graphs on the screen, or each graph can be the same size as the
  4396.           other graphs.
  4397.  
  4398.  
  4399.  
  4400.            OPENGRAPH
  4401.  
  4402.  
  4403.           OPENGRAPH(numgraphs[,start,end])
  4404.  
  4405.           This function prepares for numgraph graph windows to be
  4406.           displayed. The dates displayed are from quote start to quote
  4407.           number end. For example, to prepare to display 3 graphs of the
  4408.           last 50 days, you would say:
  4409.                   OPENGRAPH(3,-50,0);
  4410.           The start and end values are optional, so you don't have to
  4411.           specify them. If they are not specified, the default is to
  4412.           display from the first to the last quote.
  4413.  
  4414.  
  4415.  
  4416.            SIZEGRAPH
  4417.  
  4418.  
  4419.           SIZEGRAPH(S1, S2,...Sn)
  4420.  
  4421.           where S1..Sn are the number of 'shares' of the display area each
  4422.           graph prepared by the OPENGRAPH function will get when shown. For
  4423.           example, as above, with 3 graphs to be displayed, if you want the
  4424.           first graph to have 2 times as much space as the second or third,
  4425.           you would say
  4426.                   SIZEGRAPH(2,1,1);
  4427.           Note that there must be as many parameters to the SIZEGRAPH
  4428.           function as the number in the first parameter of the OPENGRAPH
  4429.           function (numgraphs above).
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.                  Technical Analysis Scanner (TAS)               Page 74
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.            GRAPH
  4446.  
  4447.  
  4448.           GRAPH(a1,l1,a2,l2...,aN,lN)
  4449.           where a1 is the first array to be graphed, l1 is the legend (name
  4450.           to be displayed with) the graph of a1,  a2 is the second array
  4451.           and l2 is the second legend. Each of the arrays and legends
  4452.           specified in the GRAPH command are graphed in the same window,
  4453.           one on top of the other. For example, to graph +DI, -DI and ADX
  4454.           on the same graph, you would say
  4455.           GRAPH(PDI(14),'+DI',MDI(14),'-DI',ADX(14),'ADX 14');
  4456.           Simple as that.
  4457.  
  4458.           There is a special 'array' named '1' which represents the Price
  4459.           Bar Chart normally seen in charts. So, to plot the price bar
  4460.           chart, you could say
  4461.                  GRAPH(1);
  4462.  
  4463.  
  4464.  
  4465.  
  4466.            DRAWLINE
  4467.  
  4468.  
  4469.           DRAWLINE(color,x1,y1,x2,y2,start,end)
  4470.  
  4471.           This function will draw a line from the point (x1,y1) to (x2,y2)
  4472.           starting at point start and ending at point end. The color
  4473.           parameter can be in the range from 0 (black) to 15 (white).
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.                  Technical Analysis Scanner (TAS)               Page 75
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.           The following table lists the color codes that can be used with
  4505.           the DRAWLINE function.
  4506.  
  4507.                              Color #                         Color Generated
  4508.                                 0                         BLACK
  4509.                                 1                         BLUE
  4510.                                 2                         GREEN
  4511.                                 3                         CYAN
  4512.                                 4                         RED
  4513.                                 5                         MAGENTA
  4514.                                 6                         BROWN
  4515.                                 7                         LIGHTGRAY
  4516.                                 8                         DARKGRAY
  4517.                                 9                         LIGHTBLUE
  4518.                                 10                         LIGHTGREEN
  4519.                                 11                         LIGHTCYAN
  4520.                                 12                         LIGHTRED
  4521.                                 13                         LIGHTMAGENTA
  4522.                                 14                         YELLOW
  4523.                                 15                         WHITE
  4524.  
  4525.  
  4526.  
  4527.  
  4528.            CLOSEGRAPH
  4529.  
  4530.  
  4531.           CLOSEGRAPH()
  4532.  
  4533.           The CLOSEGRAPH() function waits for you to hit any key. If you
  4534.           hit an ESC or CTRL-C the graphing (and the script) stop
  4535.           completely. Any other key will close the graph and go back to the
  4536.           regular TAS output display.
  4537.  
  4538.  
  4539.  
  4540.  
  4541.            GRAPH EXAMPLES
  4542.  
  4543.  
  4544.           Here is an example of a graph that shows how to draw a price
  4545.           graph with Bollinger Bands around it in the first (top) graph and
  4546.           the MACD indicator and its trigger in the bottom graph.
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.                  Technical Analysis Scanner (TAS)               Page 76
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.           opengraph(2);
  4565.           graph(bband_top,bband_bot,1);
  4566.           graph(macd(),'Macd',macdtrigger(),'Trigger');
  4567.           closegraph();
  4568.  
  4569.           The next figure shows a graph created by TAS using the following
  4570.           GRAPH commands:
  4571.           opengraph(2);
  4572.           sizegraph(2,1);
  4573.           graph(1,'PRICE',
  4574.               bbandt(20,2),'BBAND TOP',
  4575.               bbandb(20,2),'BBAND BOT',
  4576.               mov(c,21,'e'),'21DAY EMA',
  4577.               mov(c,200,'e'),'200DAY EMA');
  4578.           graph(rsi(14),'RSI 14');         { show RSI }
  4579.           drawline(3,0,20,0,20);  
  4580.           drawline(3,0,80,0,80);
  4581.           closegraph();
  4582.  
  4583.           The first statement above, opengraph(2), tells TAS to create
  4584.           space on the screen for 2 graph areas. The second statement,
  4585.           sizegraph(2,1), says to give the top graph 2 "shares" of space
  4586.           and the bottom graph 1 share of space. This effectively gives the
  4587.           top graph 2/3 of the screen and the bottom graph the remaining
  4588.           1/3 of the screen.
  4589.           The third statement
  4590.  
  4591.            graph(1,'PRICE',
  4592.             bbandt(20,2),'BBAND TOP',                  bbandb(20,2),'BBAND
  4593.           BOT',                   mov(c,21,'e'),'21DAY EMA',                
  4594.             mov(c,200,'e'),'200DAY EMA')
  4595.  
  4596.           defines the values to be graphed in the first (top) graph. The
  4597.           first value to graph is the "price bar chart" which has a special
  4598.           indicator name of "1". Then, two Bollinger Bands, top and bottom,
  4599.           are graphed . Finally, a 21 day Exponential Moving Average and a
  4600.           200 day Exponential Moving Average are graphed. Each of these
  4601.           items to be graphed can be followed by a "legend" or title to be
  4602.           displayed on the graph in the color chosen for the line.
  4603.  
  4604.           The statement
  4605.  
  4606.            graph(rsi(14),'RSI 14')
  4607.  
  4608.            tells TAS to place a graph of Wilder's Relative Strength Index
  4609.           in the second (bottom) graph.
  4610.  
  4611.           The next two statements,
  4612.  
  4613.  
  4614.  
  4615.                  Technical Analysis Scanner (TAS)               Page 77
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.           drawline(3,0,20,0,20);  
  4625.           drawline(3,0,80,0,80);
  4626.           tell TAS to draw a line in blue from the left of the graph (just
  4627.           drawn) to the right of the graph at height 20 and 80. This is
  4628.           just adding the 20/80 lines to the RSI graph for ease of
  4629.           recognition of crossings to overbought/oversold conditions.
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.                  Technical Analysis Scanner (TAS)               Page 78
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.                               TAS "POUND" (#) Commands
  4685.  
  4686.           TAS "POUND" commands are used to control special script
  4687.           processing. They must begin with a "pound sign" ('#') in the
  4688.           first column of the line, and they must be completed on the same
  4689.           line.
  4690.  
  4691.           DO NOT USE A SEMI-COLON to terminate a POUND command, since they
  4692.           are not TAS script language statements, but are TAS run settings.
  4693.           You should not put comments at the end of a POUND command either.
  4694.  
  4695.           "POUND" commands are executed by TAS only one time during the
  4696.           life of the script, as contrasted with other TAS script
  4697.           statements which are executed once for every ticker.
  4698.  
  4699.  
  4700.  
  4701.            OUTPUT_FILE Command
  4702.  
  4703.  
  4704.           You can direct the output of a script to a file by placing an
  4705.           #OUTPUT_FILE command in the script file. The #OUTPUT_FILE command
  4706.           must start in the first column of the line. It should be followed
  4707.           by the output file name surrounded by single quotes.
  4708.  
  4709.           If you want to direct your output to a PRINTER, for example,
  4710.           LPT1, you can use the #OUTPUT_FILE command, #OUTPUT_FILE 'LPT1'
  4711.  
  4712.           For example,
  4713.  
  4714.           #OUTPUT_FILE 'select.lst'
  4715.  
  4716.           would place the output text of the script into the file
  4717.           'select.lst'.
  4718.  
  4719.           Appending to Output File
  4720.           If you want to APPEND, or add to, the end of the output file, you
  4721.           can do so by placing a plus (+) character at the end of the
  4722.           output file name. From the example above,
  4723.  
  4724.           #OUTPUT_FILE 'select.lst+'
  4725.  
  4726.           would place the output of the script at the end of file
  4727.           "select.lst". This feature will be most useful if you are running
  4728.           several scripts in succession and want to place the output from
  4729.           different scripts into one output file.
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.                  Technical Analysis Scanner (TAS)               Page 79
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.           Suppressing TAS Report Heading
  4745.           In addition, if you want to suppress the headings that TAS
  4746.           normally puts out on its reports, you can do this with the
  4747.           OUTPUT_FILE command by placing the letter "N" after the file name
  4748.           (preceded by a space).
  4749.  
  4750.  
  4751.  
  4752.            MAX_QUOTES Command
  4753.  
  4754.  
  4755.           You can use the #MAX_QUOTES command to limit the number of quotes
  4756.           read into a script. This value must be less than the MAXIMUM
  4757.           QUOTES you specified in the TAS Configuration Menu. If it is less
  4758.           than the TAS Configuration Menu MAXIMUM QUOTES, it will override
  4759.           the quote count to read for the script in which it is contained
  4760.           only.
  4761.  
  4762.           The format of the #MAX_QUOTES command is:
  4763.  
  4764.                #MAX_QUOTES nnn
  4765.  
  4766.           where "nnn" is the number of quotes to read into TAS when this
  4767.           script is processed.
  4768.  
  4769.  
  4770.  
  4771.            SCAN_DATE Command
  4772.  
  4773.  
  4774.           You can use the #SCAN_DATE command to define the time frame you
  4775.           want to process. You can specify a beginning date, an ending date
  4776.           or both.
  4777.            The SCAN_DATE command enables you to start loading quotes from a
  4778.           specific date (the start date)  and to stop loading quotes after
  4779.           a specific date (the end date).
  4780.  
  4781.           The format of the #SCAN_DATE command is:
  4782.  
  4783.             #SCAN_DATE start_date end_date
  4784.                or
  4785.             #SCAN_DATE end_date
  4786.  
  4787.           Both start_date and end_date can be in the following format
  4788.           where yy is the year, mm is the month, and dd is the day :
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.                  Technical Analysis Scanner (TAS)               Page 80
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.             yymmdd  ,e.g. 910302 for March 2, 1991
  4805.             'mm/dd/yy'   
  4806.             mm/dd/yy
  4807.  
  4808.           Some examples of the use of #SCAN_DATE are:
  4809.             #SCAN_DATE 910102 0
  4810.           will start loading data on Jan 2, 1991 and load up to the last
  4811.           day in the file.
  4812.  
  4813.             #SCAN_DATE 910102 910915
  4814.           will start on Jan 2, 1991 and load up to Sept 15, 1991.
  4815.  
  4816.           If there is no quote in the file for the start_date, the first
  4817.           date prior to the start_date will be loaded.
  4818.  
  4819.           If there is no quote in the file for the end_date,the first date
  4820.           prior to the end_date will be used.
  4821.  
  4822.           Either the start_date or the end_date may be zero, in which case,
  4823.           it means to load from the beginning or the end of the file
  4824.           without regard to date, but taking into account the MAX_QUOTES
  4825.           range.
  4826.  
  4827.  
  4828.  
  4829.            PROFIT_TEST Command
  4830.  
  4831.  
  4832.           The #PROFIT_TEST command informs TAS of the type of profit test
  4833.           you want to run, whether you want to test "LONG", "SHORT" or
  4834.           "BOTH" long and short positions, and the amount of "money" you
  4835.           want your position to start with. This command must be placed in
  4836.           the front of the TAS script, prior to any statements which do not
  4837.           begin with a # sign.
  4838.  
  4839.           The format of the #PROFIT_TEST command is:
  4840.             #PROFIT_TEST type money
  4841.  
  4842.           where 'type' is either LONG, SHORT or BOTH (for a "long" position
  4843.           test or a "short" position test, or a test of both Long and Short
  4844.           positions) and "money" is the amount of money with which to start
  4845.           the test for each symbol.
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.                  Technical Analysis Scanner (TAS)               Page 81
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.            INDEX Command
  4866.  
  4867.  
  4868.           The #INDEX command can be used to load an "index" data array,
  4869.           such as the SP500, DJIA or another stock. It tells TAS to access
  4870.           the ticker symbol contained in the command and place its CLOSING
  4871.           PRICES into a Pre-defined Data Array named "INDEX".
  4872.  
  4873.           The format of the INDEX Command is:
  4874.                #INDEX 'ticker'
  4875.           where 'ticker' is the TICKER SYMBOL of the Index quote file. For
  4876.           example, if you had the SP 500 quotes in a file with a ticker
  4877.           name of "SP500", and you wanted to load it as the INDEX array,
  4878.           you would say
  4879.             #INDEX 'SP500'
  4880.  
  4881.           Later in the script, you could reference the array by the name of
  4882.           INDEX.
  4883.  
  4884.  
  4885.            This command must be placed in the front of the TAS script,
  4886.            prior to any statements which do not begin with a # sign. It
  4887.            also should follow any #MAX_QUOTES statement that is in the
  4888.            script.
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.            INCLUDE Command
  4896.  
  4897.  
  4898.           The #INCLUDE command will "include" another file  into the
  4899.           current script as if that file were part of the script . Once the
  4900.           included file is read into TAS,  the original script is
  4901.           continued. You can include up to 8 levels of includes, that is,
  4902.           the included file can contain a #include and that file can
  4903.           contain one, etc., up to 8 levels.
  4904.  
  4905.           The format of the #include command is
  4906.                #INCLUDE filename
  4907.           where filename is the name of a file in the current directory.
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.                  Technical Analysis Scanner (TAS)               Page 82
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.                                  TAS Script Examples
  4925.  
  4926.           Included with the TAS package are several sample .TAS script
  4927.           files. Check your directory after you install TAS to see the
  4928.           samples included.
  4929.  
  4930.  
  4931.  
  4932.            Putting Them Together
  4933.  
  4934.  
  4935.           If the script has the statements:
  4936.  
  4937.           todays_ma := mov(c,21,'E');
  4938.           diff  := CLOSE OF TODAY- todays_ma;
  4939.           if diff IS GREATER THAN 0 then
  4940.             writeln(TICKER, ' IS ABOVE 21 DAY EMA BY ',diff);
  4941.           else
  4942.             writeln(TICKER, ' IS BELOW 21 DAY EMA BY ',diff);
  4943.  
  4944.           The script will print out the ticker name followed by the message
  4945.           indicating whether the latest close is above or below the 21 day
  4946.           EMA, and by how much.
  4947.  
  4948.           In this particular example, let's take a closer look at what is
  4949.           going on. In the first line,
  4950.  
  4951.           todays_ma := mov(c,21,'E');
  4952.  
  4953.           we are computing the 21 day Exponential Moving Average of the
  4954.           Closing Price Array. Once computed, we are assigning the latest
  4955.           value of this moving average to the "variable" named 'todays_ma'.
  4956.           You could call it anything you want, but giving it a name that
  4957.           reminds you of what it contains is useful.
  4958.  
  4959.           If you wanted to keep the 21-day EMA in its own array. You could
  4960.           declare the variable as follows (before using it the first time):
  4961.           big_ma_array : ARRAY;
  4962.           This tells TAS that "big_ma_array" is an array of values, not
  4963.           just one value. So, if you now said:
  4964.           big_ma_array := mov(c,21,'E');
  4965.           the contents of big_ma_array would be ALL of the Moving Average
  4966.           values up to the latest day. To refer to the value of the 21 day
  4967.           EMA yesterday, we would write "big_ma_array[-1]" where the "[-1]"
  4968.           refers to the contents of the array "-1" days from now (in other
  4969.           words, one day ago). If you wanted to refer to the 21 day EMA 10
  4970.           days ago, it would be "big_ma_array[-10]". If you wanted to refer
  4971.           to the latest day's 21 day EMA, it would be "big_ma_array[0]"
  4972.  
  4973.  
  4974.  
  4975.                  Technical Analysis Scanner (TAS)               Page 83
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.           (zero days ago).
  4985.  
  4986.           The next statement in the example is:
  4987.             diff  := c[0] - todays_ma;
  4988.           which assigns to the variable "diff" the value of the latest
  4989.           closing price, "c[0]", minus the latest 21 day EMA as computed
  4990.           and assigned to the variable "todays_ma" in the previous
  4991.           statement.
  4992.  
  4993.  
  4994.  
  4995.            New High/New Low Example
  4996.  
  4997.  
  4998.           The following script is contained in file "NHNL.TAS".
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.                  Technical Analysis Scanner (TAS)               Page 84
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.           Script Contents
  5045.           { NHNL.TAS-
  5046.           This script example will show the 52 week high and low for each
  5047.           ticker. If the current day's high is equal to the highest high
  5048.           or the current low is equal to the lowest low, then we have a
  5049.           probable new high or new low. It might also be the case that
  5050.           today's
  5051.           high or low is just equal to the previous high or low.
  5052.  
  5053.           Just to make the script slightly more interesting, we will also
  5054.           compute the "percentage off from high", a frequently used metric
  5055.           seen in financial tables.
  5056.           }
  5057.           if first_ticker then
  5058.           begin
  5059.           writeln('              - CURRENT -       - 52 WEEK -     OFF');
  5060.           writeln('TICKER       HIGH      LOW     HIGH      LOW    HIGH');
  5061.           end;
  5062.           high_value := HHV(h,52*5);        { compute high over 52 weeks }
  5063.           low_value  := LLV(L,52*5);        { compute low over 52 weeks }
  5064.  
  5065.           off_high_value := ((high_value - c) / high_value) * 100;
  5066.           write(TICKER,' ',h,' ',l,' ',high_value,' ',low_value,
  5067.           '\t',INT(off_high_value),'%');
  5068.  
  5069.           if (high_value <= h) then       { today's high is new high  }
  5070.             write(' New High ');
  5071.  
  5072.           if (low_value >= l) then        { today's low is new low }
  5073.             write(' New Low  ');
  5074.  
  5075.           write('\n');        { end the line with a 'newline'}
  5076.  
  5077.           Script Output
  5078.           - CURRENT -       - 52 WEEK -     OFF
  5079.           TICKER       HIGH      LOW     HIGH      LOW    HIGH
  5080.           ABX        21.875   21.375   24.750   15.875 13%
  5081.           AAPL       28.000   26.000   50.375   26.000 47% New Low
  5082.           ARIX        1.062    0.938    5.625    0.875 81%
  5083.           BP%        12.500   11.125   14.500    6.000 17%
  5084.           CMNT        2.312    2.188    3.500    2.063 33%
  5085.           GR         32.125   31.875   57.500   29.500 44%
  5086.           SWZ        12.125   11.750   17.500   10.875 32%
  5087.           LA         11.625   10.375   50.375    9.750 77%
  5088.           MXTR        5.625    5.250   16.500    5.250 66% New Low
  5089.           PCG        22.375   22.000   23.500   18.750 4%
  5090.           TX         61.625   60.125   68.500   49.875 12%
  5091.           UAL       110.000   99.000  286.750   87.250 64%
  5092.  
  5093.  
  5094.  
  5095.                  Technical Analysis Scanner (TAS)               Page 85
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.            TICKER Symbol Processing
  5106.  
  5107.  
  5108.           The following example shows how you could create a special script
  5109.           to notify you when certain stocks had reached prices you had set.
  5110.           This script is in "LIMIT.TAS".
  5111.  
  5112.           Script Contents
  5113.           { limit.tas
  5114.           This is an example of using a TAS script to watch your
  5115.           stocks.
  5116.  
  5117.           It checks the ticker symbol against one of several
  5118.           which you might (and I do) own. If the current close
  5119.           (shown as 'c[0]' is greater than the limit for profit
  5120.           or less than the stop loss, a message is generated.
  5121.           }
  5122.  
  5123.           stop_loss := 0;
  5124.           sell_profit := 0;
  5125.           if ticker = 'aapl' then
  5126.             if c > 47 then
  5127.                sell_profit := 1;
  5128.             else
  5129.             if c < 41 then
  5130.                stop_loss := 1;
  5131.           if ticker = 'gr' then
  5132.             if c > 43 then
  5133.                sell_profit := 1;
  5134.             else
  5135.             if c < 38 then
  5136.                stop_loss := 1;
  5137.           if ticker = 'la' then
  5138.             if c > 27 then
  5139.                sell_profit := 1;
  5140.             else
  5141.             if c < 10 then
  5142.                stop_loss := 1;
  5143.  
  5144.           if stop_loss = 1 then
  5145.             writeln(ticker, ' has reached your STOP LOSS limit. SELL');
  5146.           if sell_profit = 1 then
  5147.             writeln(ticker, ' has reached your Profit target. SELL');
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.                  Technical Analysis Scanner (TAS)               Page 86
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.            Directional Movement Example
  5166.  
  5167.  
  5168.           The following script is contained in file "DM.TAS".
  5169.  
  5170.  
  5171.            NOTE : This script will only work with the REGISTERED VERSION
  5172.            of TAS.
  5173.  
  5174.  
  5175.  
  5176.           Script Contents
  5177.           #output_file 'dm.lst'
  5178.           { DM.TAS
  5179.           Wilder's Directional Movement Trading Example
  5180.           This script will indicate
  5181.           a BUY signal
  5182.           if the +DI(14) crosses above -DI(14) and ADXR > 25
  5183.           a SELL signal
  5184.           if the -DI(14) crosses above +DI(14) and ADXR > 25
  5185.           }
  5186.           { declare the +DI (Positive Directional Movement array}
  5187.           pdi_array : array;
  5188.  
  5189.           { declare the -DI (Negative Directional Movement array}
  5190.           mdi_array : array;
  5191.  
  5192.           pdi_array := pdi(14);   { calculate +DI}
  5193.           mdi_array := mdi(14);   { calculate -DI}
  5194.           adxr_14 := adxr(14);
  5195.           adx_14  = adx(14);
  5196.           dx_14  = dx(14);
  5197.           if first_ticker then
  5198.             writeln('TICKER     ADXR   DX  ADX  +DI  -DI     ACTION');
  5199.  
  5200.           write(ticker,'  ',int(adxr_14),
  5201.             int(dx_14),
  5202.             int(adx_14),
  5203.              int(pdi_array[0]),
  5204.             int(mdi_array[0]));
  5205.           action = '';
  5206.  
  5207.           if (adxr_14 > 25)   then        { AVG DX Rate of Change > 25 }
  5208.           begin
  5209.           if (over(pdi_array,mdi_array) = 0) then
  5210.             action = '** BUY SIGNAL';
  5211.           else
  5212.  
  5213.  
  5214.  
  5215.                  Technical Analysis Scanner (TAS)               Page 87
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.           if (over(mdi_array,pdi_array) = 0) then
  5225.             action = '** SELL SIGNAL';
  5226.           end;
  5227.           writeln(action);
  5228.  
  5229.           Script Output
  5230.           TICKER     ADXR   DX  ADX  +DI  -DI     ACTION
  5231.           AA           33   28   33   25   14
  5232.           ALD          22   15   22   30   22
  5233.           AXP          34   59   34   39   10
  5234.           T            30   41   30   29   12
  5235.           BS           26   42   26   32   13
  5236.           BA           22    8   22   27   23
  5237.           CHV          17    4   17   27   29
  5238.           KO           27   49   27   32   11
  5239.           DD           21   23   21   29   18
  5240.  
  5241.  
  5242.  
  5243.            Modified "Binary Wave"
  5244.  
  5245.  
  5246.           The file "SELCT.TAS" contains a rather lengthy script which
  5247.           contains the logic for computing a 6 point "binary wave". The
  5248.           first 4 "points" of the wave are those described in the
  5249.           "MetaStock User's Manual" in Chapter 7, section 7.7.2 "Example
  5250.           Binary Waves".
  5251.  
  5252.           The final 2 points of the "binary wave" are included to show how
  5253.           you can extend the original example to compute additional
  5254.           indicators (Chaikin's Oscillator and Commodity Channel Index)
  5255.           which are used to further refine the selection.
  5256.  
  5257.           Since the file is large, it is not included in this
  5258.           documentation, but the file is included in the TAS package.
  5259.  
  5260.  
  5261.  
  5262.  
  5263.            Profit Test Example Using RSI(14)
  5264.  
  5265.  
  5266.           The TAS Script file 'RSIPT.TAS' shows a Profit Test using the
  5267.           14-day RSI.  It serves as a simple example of the kind of profit
  5268.           testing available with TAS.
  5269.  
  5270.           Script Contents (RSIPT.TAS)
  5271.           {
  5272.  
  5273.  
  5274.  
  5275.                  Technical Analysis Scanner (TAS)               Page 88
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.           RSIPT.TAS
  5285.           RSI PROFIT TEST SCRIPT EXAMPLE
  5286.           This script will signal a SELL when the
  5287.           RSI(14) crosses under 'rsi_upper' and a BUY when
  5288.           RSI(14) crosses above 'rsi_lower'.
  5289.           }
  5290.           #PROFIT_TEST LONG 1000          { long positions with $1000}
  5291.           #MAX_QUOTES 300                 { only read in 300 quotes }
  5292.           #OUTPUT_FILE 'RSIPT.LST'        { assign output listing to
  5293.           rsipt.lst}
  5294.  
  5295.           RSI_VALUES : ARRAY;             { array containing plotted
  5296.           points }
  5297.           RSI_UPPER := 75;                { Upper range of RSI - point to
  5298.           SELL
  5299.           Change this if
  5300.           you want to test different value}
  5301.           RSI_LOWER := 50;                { Lower range of RSI - point to
  5302.           BUY
  5303.           Change this if you want to test different value}
  5304.  
  5305.           PLOT BEGIN      { This begins the "plot" of the RSI }
  5306.           RSI_VALUES := RSI(14);  { COMPUTE THE RSI(14) PLOT }
  5307.           END;
  5308.  
  5309.           BUY WHEN RSI_VALUES[-1] < RSI_LOWER AND RSI_VALUES > RSI_LOWER;
  5310.  
  5311.           SELL WHEN RSI_VALUES[-1] > RSI_UPPER  AND RSI_VALUES <
  5312.           RSI_UPPER;
  5313.  
  5314.           Script Output
  5315.           The following report shows the output of the Profit Tester for a
  5316.           single stock.
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.                  Technical Analysis Scanner (TAS)               Page 89
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.                           Technical Analysis Scanner (TAS 3.64)
  5345.                           File Date  : 05/08/90
  5346.                           Run  Date  : Wed May 29 22:28:00 1991
  5347.                           Script Name: RSIPT
  5348.                           Ticker Name: T
  5349.  
  5350.                       Amdahl (AMH) From 03/20/90 To 05/29/91
  5351.                       Initial Cash $ 1000.00. (Long Positions Only)
  5352.                   Share Purchases use All Available Cash with NO
  5353.           Commissions
  5354.  
  5355.                                         |-----Current Trade-------| |--
  5356.           Cumulative--|
  5357.             Date   Action Shrs    Price Points  Cash   Comm  Profit
  5358.           Points   Profit
  5359.           -------- ----- ----- -------- ------ ------ ----- ------- ------
  5360.           -  -------
  5361.           05/09/90 Buy      70   14.250  0.000      2     0       0
  5362.           0.000        0
  5363.           05/22/90 Sell     70   15.625  1.375   1096     0      96
  5364.           1.375       96
  5365.           06/12/90 Buy      69   15.750  0.000     10     0       0
  5366.           1.375       96
  5367.           07/18/90 Sell     69   18.250  2.500   1269     0     172
  5368.           3.875      269
  5369.           09/07/90 Buy      97   13.000  0.000      8     0       0
  5370.           3.875      269
  5371.  
  5372.                                    Summary for AMH
  5373.                   |--Trades-----| |-Runs-|  Percent  |---Maximum--|
  5374.           Total %
  5375.                   Tot Win Los Stp  Win Los  Win Los  Profit    Loss Commn
  5376.           Profit Gain
  5377.           Long      2   2   0   0    2   0 100%   0%    269       0     0
  5378.           269   27%
  5379.           Short     0   0   0   0    0   0   0%   0%      0       0     0
  5380.           0    0%
  5381.           Closed    2   2   0   0    2   0 100%   0%    269       0     0
  5382.           269   27%
  5383.           Open      1   1   0   0    1   0 100%   0%    315       0     0
  5384.           315   32%
  5385.           Total     3   3   0   0    2   0 100%   0%    315       0     0
  5386.           584   58%
  5387.  
  5388.  
  5389.  
  5390.                                    Summary for ALL SYMBOLS
  5391.                   |--Trades-----| |-Runs-|  Percent  |---Maximum--|
  5392.  
  5393.  
  5394.  
  5395.                  Technical Analysis Scanner (TAS)               Page 90
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.           Total %
  5405.                   Tot Win Los Stp  Win Los  Win Los  Profit    Loss Commn
  5406.           Profit Gain
  5407.           Long      2   2   0   0    2   0 100%   0%    269       0     0
  5408.           269   27%
  5409.           Short     0   0   0   0    0   0   0%   0%      0       0     0
  5410.           0    0%
  5411.           Closed    2   2   0   0    2   0 100%   0%    269       0     0
  5412.           269   27%
  5413.           Open      1   1   0   0    1   0 100%   0%    315       0     0
  5414.           315   32%
  5415.           Total     3   3   0   0    2   0 100%   0%    315       0     0
  5416.           584   58%
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422.  
  5423.  
  5424.  
  5425.  
  5426.  
  5427.  
  5428.  
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.                  Technical Analysis Scanner (TAS)               Page 91
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.                                   TAS Error Message
  5465.  
  5466.           TAS has extensive error checking features that attempt to detect
  5467.           and isolate errors as close to the source as possible. The
  5468.           following section is a list of the error messages that can be
  5469.           exhibited by TAS.
  5470.  
  5471.           The Error Message list is in alphabetic sequence, so you can look
  5472.           up the message by the first letter of the first word of the
  5473.           message. Most messages have  an error number associated with them
  5474.           as well. This number should be used when communicating the
  5475.           problem to FlexSoft.
  5476.  
  5477.           For each error message, there are three sections, The first
  5478.           section is the actual text of the message including an error
  5479.           number  (Ennn) , the second section is the cause of the message,
  5480.           and the third section is the recommendation, or action to resolve
  5481.           the error.
  5482.  
  5483.           At the end of the list of error messages is a list of Diagnostic
  5484.           Actions. These are described in the error message recommendation
  5485.           as Action Dx, where the x is a diagnostic action number. A
  5486.           Diagnostic Action is a sequence of steps necessary to resolve the
  5487.           problem or to gather and provide enough information for
  5488.           resolution by FlexSoft Technical Support.
  5489.  
  5490.  
  5491.  
  5492.            Error Messages
  5493.  
  5494.  
  5495.           E72,'(', number value or variable expected.
  5496.           Cause:
  5497.           In trying to decipher an arithmetic expression, TAS found a
  5498.           sequence where it expected to find either an expression in
  5499.           parentheses, a number or a variable. It found nothing it could
  5500.           make sense of.
  5501.  
  5502.           Recommendation:
  5503.           Examine the line where the error was flagged and correct the
  5504.           mistake.
  5505.  
  5506.           E68,')' expected.
  5507.           Cause:
  5508.           In trying to decipher an arithmetic expression, TAS found a
  5509.           sequence that is missing a right parenthesis.
  5510.           Recommendation:
  5511.           Examine the line where the error was flagged and correct the
  5512.  
  5513.  
  5514.  
  5515.                  Technical Analysis Scanner (TAS)               Page 92
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.           mistake.
  5525.  
  5526.           A <tttt> Math Error (code <cc>) has occurred
  5527.           while processing symbol <ticker>
  5528.           in TAS Script File <script>, line <ll>.
  5529.           TAS cannot continue. Fix the problem and try again.
  5530.           Cause:
  5531.           The TAS script has encountered a "math" error of the type shown
  5532.           in the message text as <tttt>  while processing ticker name
  5533.           <ticker> at line <ll>.
  5534.           Recommendation:
  5535.           This may be the result of faulty data in your ticker file. Verify
  5536.           that the ticker data is valid (high >= close >= low), then note
  5537.           the script line where the error occurred.
  5538.           Try another function on that ticker to see if the problem
  5539.           persists.
  5540.           Action D1
  5541.  
  5542.           E101,ALPHA requires 'D','W' or 'M'
  5543.           Cause:
  5544.           An incorrect parameter was given to the ALPHA function. It must
  5545.           be one of the ones shown in the message.
  5546.           Recommendation:
  5547.           Fix the function parameter list.
  5548.  
  5549.           E140,Argument <aa> is the wrong type for <ff>
  5550.           function. Should be <tt>
  5551.           Cause:
  5552.           The <aa>th argument to the function named  <ff> in the message
  5553.           was the wrong type of argument. If should have been an argument
  5554.           type as shown in <tt>. For example,  this message would occur if
  5555.           you tried to do a moving average (mov) of a number, rather than
  5556.           an array.
  5557.           Recommendation:
  5558.           Look at the argument number shown by the <aa> part of the
  5559.           message. Then check the function description. Make sure that the
  5560.           value passed in that argument is of the correct type.
  5561.  
  5562.           E3,Badly formed number
  5563.           Cause:
  5564.           An invalid number expression was found.
  5565.           Recommendation:
  5566.           Fix the number in the script
  5567.  
  5568.           E102,BETA argument error
  5569.           Cause:
  5570.           An incorrect parameter was given to the BETA function. It must be
  5571.           'D','W' or 'M' or no parameter at all.
  5572.  
  5573.  
  5574.  
  5575.                  Technical Analysis Scanner (TAS)               Page 93
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.           Recommendation:
  5585.           Fix the function parameter list.
  5586.  
  5587.           E104,BETA requires an INDEX file
  5588.           Cause:
  5589.           The BETA function requires an INDEX ticker file to be specified
  5590.           by a #INDEX command or in the OPTIONS MENU of SELECTION or PROFIT
  5591.           TEST BUILD.
  5592.           Recommendation:
  5593.           Specify an INDEX ticker.
  5594.  
  5595.           E230,BREAK hit
  5596.           Cause:
  5597.           While a script was executing, you hit the CTRL-BREAK or CTRL-C
  5598.           key. The script terminates and TAS attempts to continue.
  5599.           Note that hitting the BREAK key is not a graceful way to stop a
  5600.           running script and you may have to restart TAS afterwards.
  5601.           Recommendation:
  5602.           Wait until the script finishes or use a smaller ticker list.
  5603.  
  5604.           E223,Cannot sort on type given
  5605.           Cause:
  5606.           A SORTOUT function was called, but one of the parameters is not
  5607.           'sortable'. For example, you cannot sort on a variable into which
  5608.           you have not assigned a value. Until you assign a value to it,
  5609.           TAS does not know what kind of variable it is, number, string or
  5610.           array.
  5611.           Recommendation:
  5612.           Examine your script to be sure you are assigning a value to the
  5613.           argument you are passing to the SORTOUT function.
  5614.  
  5615.           E2,Constant string too long
  5616.           Cause:
  5617.           You have a constant string (a literal value enclosed in single
  5618.           quotes) that is longer than 128 characters. This may be caused by
  5619.           forgetting to terminate a quoted string on a prior line.
  5620.           Recommendation:
  5621.           Examine the script and add any missing single quotes. Break up
  5622.           the constant into two or more pieces if necessary.
  5623.  
  5624.           EXXX,Could not create window. Error <e>
  5625.           Cause:
  5626.           TAS internal window error.
  5627.           Recommendation:
  5628.           Action D2
  5629.  
  5630.           E127,Not enough storage. Decrease MAX_QUOTES
  5631.           Cause:
  5632.  
  5633.  
  5634.  
  5635.                  Technical Analysis Scanner (TAS)               Page 94
  5636.  
  5637.  
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.           You have specified too high a value for MAXIMUM QUOTES in the TAS
  5645.           CONFIGURATION screen. Reduce this value so that TAS can load all
  5646.           the necessary data for a ticker.
  5647.           Recommendation:
  5648.           If you are doing a profit test, you can use the START DATE and
  5649.           END DATE options to reduce the number of quotes TAS reads for
  5650.           each ticker.
  5651.  
  5652.           E243,EMS Memory overflow
  5653.           Cause:
  5654.           Not applicable to TAS at this time.
  5655.           Recommendation:
  5656.           None.
  5657.           Error creating ticker file :
  5658.           Cause:
  5659.           TAS could not create the ticker file.
  5660.           Recommendation:
  5661.           Check that the directory in which you are writing the ticker file
  5662.           exists and that the file, if it exists, is not READ ONLY.
  5663.  
  5664.           Error occurred during process of <ssss>
  5665.           Cause:
  5666.           An error occurred while running SELECTION <ssss>. There might be
  5667.           a message to explain it prior to this point.
  5668.           Recommendation:
  5669.           Run the .SEL file again and watch for any other error messages.
  5670.  
  5671.  
  5672.           E59,expected assignment ':='
  5673.           Cause:
  5674.           The script has a syntax error in it. Probably there is a sequence
  5675.           like
  5676.                                          A B
  5677.            where A and B are variables. TAS expects an assignment to
  5678.           variable A.
  5679.           Recommendation:
  5680.           Examine the script and fix the error.
  5681.  
  5682.           E52,Expected LONG or SHORT
  5683.           Cause:
  5684.           A Profit Test STOP statement was found but it was not followed by
  5685.           the type of stop, either LONG or SHORT.
  5686.           Recommendation:
  5687.           Examine the script and fix the error.
  5688.  
  5689.           E62,Expected WHEN
  5690.           Cause:
  5691.           A Profit Test BUY, SELL or STOP statement was found but it was ot
  5692.  
  5693.  
  5694.  
  5695.                  Technical Analysis Scanner (TAS)               Page 95
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.           followed by the word WHEN.
  5705.           Recommendation:
  5706.           Examine the script and fix the error.
  5707.  
  5708.           E119,GOTO LABEL not defined
  5709.           Cause:
  5710.           A GOTO statement names a label that is not defined in the script.
  5711.           For example, it says GOTO ABC, but there is no label ":ABC" in
  5712.           the script.
  5713.           Recommendation:
  5714.           Examine the script and fix the error.
  5715.  
  5716.           E152,GRAPHS not registered
  5717.           Cause:
  5718.           An OPENGRAPH function was called for the third time when the
  5719.           GRAPH feature is not registered. No more graphs can be run until
  5720.           TAS is restarted.
  5721.           Recommendation:
  5722.           Register the GRAPH feature.
  5723.  
  5724.           E122,Heap Corrupted
  5725.           Cause:
  5726.           TAS internal error. The TAS memory 'heap' structure has become
  5727.           unusable.
  5728.           Recommendation:
  5729.           Restart TAS.
  5730.           Action D2
  5731.  
  5732.  
  5733.           E131,Incorrect argument count to <ff> function
  5734.           Cause:
  5735.           The function <ff> was called with more or less arguments than it
  5736.           requires.
  5737.           Recommendation:
  5738.           Refer to the function description for the correct number and type
  5739.           of arguments (parameters).
  5740.  
  5741.           E224,Incorrect # of parameters for SORTGET
  5742.           Cause:
  5743.           The number of parameters to the SORTGET function does not match
  5744.           the number of arguments passed to the SORTOUT function. There
  5745.           must be a one for one relationship between the argument counts
  5746.           for both functions.
  5747.           Recommendation:
  5748.           Examine the script and fix the error.
  5749.  
  5750.           E150,Incorrect SIZEGRAPH
  5751.           Cause:
  5752.  
  5753.  
  5754.  
  5755.                  Technical Analysis Scanner (TAS)               Page 96
  5756.  
  5757.  
  5758.  
  5759.  
  5760.  
  5761.  
  5762.  
  5763.  
  5764.           The number of parameters to the SIZEGRAPH function must be equal
  5765.           to the number of graphs specified in the preceding OPENGRAPH
  5766.           function.
  5767.           Recommendation:
  5768.           Examine the script and fix the error.
  5769.  
  5770.           E250,Incorrect ZigZag type
  5771.           Cause:
  5772.           The third parameter to the ZIG function must be either '%' or
  5773.           '$'.
  5774.           Recommendation:
  5775.           Examine the script and fix the error.
  5776.  
  5777.           E175,Incorrect 'type' parameter to pt_init
  5778.           Cause:
  5779.           The PT_INIT function was called with an incorrect 'type' field.
  5780.           Recommendation:
  5781.           Examine the script and fix the error.
  5782.  
  5783.           EXXX,Incorrect Graph Type
  5784.           Cause:
  5785.           The GRAPH function was called with an incorrect type of item to
  5786.           graph. See the  graph function for the valid types of graph. .
  5787.           Recommendation:
  5788.           Examine the script and fix the error.
  5789.  
  5790.           E150,Incorrect Start/End
  5791.           Cause:
  5792.           An OPENGRAPH function was called with the start and end array
  5793.           indices specified, but 1) the start was later than the end or
  5794.           (2)one of the specifications was not a number.
  5795.           Recommendation:
  5796.           Examine the script and fix the error.
  5797.  
  5798.           E150,Incorrect OPENGRAPH
  5799.           Cause:
  5800.           The OPENGRAPH function was called with an incorrect number of
  5801.           parameters.
  5802.           Recommendation:
  5803.           Examine the script and fix the error.
  5804.  
  5805.           E150,Incorrect DRAWLINE parameters
  5806.           Cause:
  5807.           The DRAWLINE function was called with an incorrect number of
  5808.           parameters.
  5809.           Recommendation:
  5810.           Examine the script and fix the error.
  5811.  
  5812.  
  5813.  
  5814.  
  5815.                  Technical Analysis Scanner (TAS)               Page 97
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824.           E51,Incorrect placement of # command
  5825.           Cause:
  5826.           A # symbol was found in some column other than the first column
  5827.           of a line.
  5828.           The # symbol is used to distinguish "Pound" commands from other
  5829.           parts of the script. It cannot be used in any other context
  5830.           (except as part of a string).
  5831.           Recommendation:
  5832.           Check that the "Pound" Command begins in the first column of the
  5833.           line.
  5834.  
  5835.           E123,Intermediate operand stack overflow
  5836.           Cause:
  5837.           This can be caused by a TAS internal error or a very complex
  5838.           expression in a script.
  5839.           Recommendation:
  5840.           If the error occurs in a statement containing a complex algebraic
  5841.           expression, try breaking the expression into smaller pieces. For
  5842.           example, if the statement is
  5843.                   A = (B+5)*(C+2/(1+C))
  5844.           you might break it into
  5845.                   A1 = B + 5
  5846.                   A2 = C+2/(1+C)
  5847.                   A = A1 * A2
  5848.           If the problem does not occur on a complex statement, then
  5849.           see ACTION D2.
  5850.  
  5851.           E129,Intermediate array stack underflow
  5852.           Cause:
  5853.           TAS internal error.
  5854.           Recommendation:
  5855.           Action D1
  5856.  
  5857.           E124,Intermediate operand stack underflow
  5858.           Cause:
  5859.           TAS internal error.
  5860.           Recommendation:
  5861.           Action D1
  5862.  
  5863.           E138,internal flag error in check_types
  5864.           Cause:
  5865.           TAS internal error.
  5866.           Recommendation:
  5867.           Action D1
  5868.  
  5869.  
  5870.           E100,Invalid 3rd parameter to mov()
  5871.           Cause:
  5872.  
  5873.  
  5874.  
  5875.                  Technical Analysis Scanner (TAS)               Page 98
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.           An incorrect third parameter was given in a MOV function call.
  5885.           Recommendation:
  5886.           Examine the script and fix the error.
  5887.  
  5888.           E176,Invalid argument to pt_price
  5889.           Cause:
  5890.           An incorrect parameter was given in a PT_PRICE function call.
  5891.           Recommendation:
  5892.           Examine the script and fix the error.
  5893.  
  5894.           E116,Invalid array subscript
  5895.           Cause:
  5896.           A reference was made to an array element that is outside the
  5897.           range of quotes in the ticker file. For example, if 200 days were
  5898.           loaded, and a reference is made to C[202] or C[-301].
  5899.           Recommendation:
  5900.           Examine the script and fix the error.
  5901.  
  5902.           E01,Invalid character
  5903.           Cause:
  5904.           Some character not in the TAS character set was encountered
  5905.           outside of a string constant (anything between single quotes is
  5906.           allowed).
  5907.           Recommendation:
  5908.           Examine the script and fix the error.
  5909.  
  5910.           EXXX,INVALID KEYWORD 'wwww'
  5911.           Cause:
  5912.           A keyword in the TAS.CNF file was not recognized.
  5913.           Recommendation:
  5914.           Remove the line with the word 'wwww' from the TAS.CNF file.
  5915.  
  5916.           E121,Invalid operator
  5917.           Cause:
  5918.           TAS internal error.
  5919.           Recommendation:
  5920.           Action D1
  5921.  
  5922.           E231,Invalid option to LOAD
  5923.           Cause:
  5924.           A LOAD function was given an invalid data array name in the
  5925.           second parameter.
  5926.           Recommendation:
  5927.           Examine the script and fix the error.
  5928.  
  5929.  
  5930.           E200,Invalid SEL file
  5931.           Cause:
  5932.  
  5933.  
  5934.  
  5935.                  Technical Analysis Scanner (TAS)               Page 99
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.           In the SELECTION BUILD section, a .SEL file was loaded, but TAS
  5945.           was not able to recognize it as a valid .SEL file.
  5946.           Recommendation:
  5947.           Make sure that the .SEL file has not been modified by some means
  5948.           other than TAS SELECTION BUILD.
  5949.  
  5950.           E141,Invalid string function
  5951.           Cause:
  5952.           TAS internal error.
  5953.           Recommendation:
  5954.           Action D1
  5955.  
  5956.           EXXX,INVALID VALUE for <vvvv>
  5957.           Cause:
  5958.           A keyword in the TAS.CNF file has an invalid value.
  5959.           Recommendation:
  5960.           Remove the line with the word 'vvvv' from the TAS.CNF file and
  5961.           reconfigure TAS.
  5962.  
  5963.           EXXX,KEYWORD '<vvvv>' HAS NO VALUE
  5964.           Cause:
  5965.           A keyword in the TAS.CNF file has an no value.
  5966.           Recommendation:
  5967.           Remove the line with the word 'vvvv' from the TAS.CNF file
  5968.           and reconfigure TAS.
  5969.  
  5970.           E55,LABEL name expected
  5971.           Cause:
  5972.           A GOTO statement was not followed by the LABEL to 'go to'
  5973.           Recommendation:
  5974.           Examine the script and fix the error.
  5975.  
  5976.           E235,LOAD not supported for CHARTPRO
  5977.           Cause:
  5978.           The LOAD function is not supported for the ChartPro data format.
  5979.           Recommendation:
  5980.           None.
  5981.  
  5982.           E65,Missing function argument list
  5983.           Cause:
  5984.           A function name was not immediately followed by  a left
  5985.           parenthesis, an optional argument list, and then a right
  5986.           parenthesis. Even a function that  has no arguments must be
  5987.           followed by at least '()'.
  5988.           Recommendation:
  5989.           Examine the script and fix the error. Make sure there are no
  5990.           blanks or other characters between the function name and the left
  5991.           parenthesis.
  5992.  
  5993.  
  5994.  
  5995.                  Technical Analysis Scanner (TAS)               Page 100
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.           If you have inadvertantly used the name of a function for a
  6005.           variable name, then you should change the name of the variable.
  6006.  
  6007.           EXXX,MSP_FILE_SEEK - error in direction
  6008.           Cause:
  6009.           TAS internal error.
  6010.           Recommendation:
  6011.           Action D1
  6012.  
  6013.           EXXX,MSP_FILE_SEEK
  6014.           Cause:
  6015.           TAS internal error.
  6016.           Recommendation:
  6017.           Action D1
  6018.  
  6019.           EXXX,MSP_MASTER_SEEK - error in direction
  6020.           Cause:
  6021.           TAS internal error.
  6022.           Recommendation:
  6023.           Action D1
  6024.  
  6025.           E20,Nesting level too deep
  6026.           Cause:
  6027.           This message occurs when 20 BEGIN statements occur without an
  6028.           intervening END statement.
  6029.           Recommendation:
  6030.           Look for missing END statements or simplify the nesting structure
  6031.           of the statements leading up to the error.
  6032.  
  6033.           E242,No more internal array storage
  6034.           Cause:
  6035.           TAS is out of memory and cannot perform any more calculations.
  6036.           This can be caused by too high a value for MAXIMUM QUOTES PER
  6037.           SYMBOL or by the use of too many permanent  ARRAYS (those
  6038.           variables declared with " : ARRAY" in a script).
  6039.           Recommendation:
  6040.           Action D4
  6041.  
  6042.           No Syntax Errors in this script. Congratulations!
  6043.           Cause:
  6044.           This message is produced when a SYNTAX CHECK is done from within
  6045.           the TAS Editor. The script has no errors that can be found by
  6046.           examining the "syntax" of the script. In other words, there are
  6047.           no invalid symbols, GOTO's without labels, bad characters, and
  6048.           other errors that violate the syntax rules of a TAS script.
  6049.           On the other hand, there may still be errors in the script that
  6050.           can only be detected by  actually running the script. These
  6051.           errors might be logical errors, memory errors, math errors or
  6052.  
  6053.  
  6054.  
  6055.                  Technical Analysis Scanner (TAS)               Page 101
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.           function parameter errors.
  6065.           Recommendation:
  6066.           Run the script, since it seems to be correct at this time.
  6067.  
  6068.           E241,Not enough Data Arrays
  6069.           Cause:
  6070.           Internal Error. EMS version of TAS only
  6071.           Recommendation:
  6072.           Action D1
  6073.  
  6074.           E127,Not enough storage. Decrease MAX_QUOTES
  6075.           Cause:
  6076.           TAS is out of memory and cannot perform any more calculations.
  6077.           This can be caused by too high a value for MAXIMUM QUOTES PER
  6078.           SYMBOL or by the use of too many permanent  ARRAYS (those
  6079.           variables declared with " : ARRAY" in a script).
  6080.  
  6081.           Recommendation:
  6082.           Action D4
  6083.  
  6084.           E24,Not enough memory available for symbol table
  6085.           Cause:
  6086.           The script is too large to run with the current setting of SYMBOL
  6087.           TABLE SIZE. The Symbol Table is used to keep the "run time
  6088.           machine language" version of the script while it is executing. If
  6089.           the CONFIGURATION SCREEN setting for SYMBOL TABLE SIZE is
  6090.           too low, there is not enough room to build the run time script.
  6091.           Recommendation:
  6092.           Action D3
  6093.  
  6094.           E154,not enough heap space in save_screen()
  6095.           Cause:
  6096.           TAS does not have enough memory available to save the screen
  6097.           before saving a graph.
  6098.           Recommendation:
  6099.           Action D2
  6100.  
  6101.           E155, not enough heap space in restore_screen()
  6102.           Cause:
  6103.           In attempting to restore a graph, TAS has detected that it is out
  6104.           of memory.
  6105.           Recommendation:
  6106.           Action D2
  6107.  
  6108.           Not supported in TRIAL version
  6109.           Cause:
  6110.           The script is using a function or feature that is not part of the
  6111.           TRIAL (or evaluation) version of TAS. The function or feature is
  6112.  
  6113.  
  6114.  
  6115.                  Technical Analysis Scanner (TAS)               Page 102
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.           enabled after TAS is registered. This error can occur if your
  6125.           registration code is entered incorrectly.
  6126.  
  6127.           Recommendation:
  6128.           Register TAS and obtain a Registration Code.
  6129.  
  6130.           E110,operand stack overflow
  6131.           Cause:
  6132.           This can be caused by a TAS internal error or a very complex
  6133.           expression in a script.
  6134.           Recommendation:
  6135.           If the error occurs in a statement containing a complex algebraic
  6136.           expression, try breaking the expression into smaller pieces. For
  6137.           example, if the statement is
  6138.                   A = (B+5)*(C+2/(1+C))
  6139.           you might break it into
  6140.                   A1 = B + 5
  6141.                   A2 = C+2/(1+C)
  6142.                   A = A1 * A2
  6143.           If the problem does not occur on a complex statement, then
  6144.           see ACTION D2.
  6145.  
  6146.           E111,operand stack underflow
  6147.           Cause:
  6148.           TAS internal error.
  6149.           Recommendation:
  6150.           Action D2
  6151.  
  6152.           <filename> read error
  6153.           Cause:
  6154.           TAS could not read the Metastock or Chartpro file named
  6155.           <filename>
  6156.           Recommendation:
  6157.           Verify that the data file is correct and readable. If not,
  6158.           correct it.
  6159.           If it is correctable, see Action D1
  6160.  
  6161.           E69,Right Brace (]) missing
  6162.           Cause:
  6163.           A subscript after an array was not followed by a Right Brace ']'.
  6164.           For example,
  6165.             A = B[-3;
  6166.           would produce this error.
  6167.           Recommendation:
  6168.           Examine the script and fix the error.
  6169.  
  6170.           E153,script terminated
  6171.           Cause:
  6172.  
  6173.  
  6174.  
  6175.                  Technical Analysis Scanner (TAS)               Page 103
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.           The script has completed for some reason indicated in a prior
  6185.           message, such as "BREAK HIT".
  6186.           Recommendation:
  6187.           None.
  6188.  
  6189.           E58,semi-colon expected after ARRAY
  6190.           Cause:
  6191.           A script statement declaring an ARRAY was not terminated by a
  6192.           semi-colon. For example,
  6193.             B : ARRAY
  6194.           would cause this error.
  6195.           Recommendation:
  6196.           Examine the script and fix the error.
  6197.  
  6198.  
  6199.           E58,semi-colon expected after NUMBER
  6200.           Cause:
  6201.           A script statement declaring a NUMBER was not terminated by a
  6202.           semi-colon. For example,
  6203.             B : NUMBER
  6204.           would cause this error.
  6205.           Recommendation:
  6206.           Examine the script and fix the error.
  6207.  
  6208.           E226,sorton : Incorrect column number
  6209.           Cause:
  6210.           The SORTON function was called with a column number that is not
  6211.           valid. The only valid column numbers are from 1 to the number of
  6212.           parameters in the prior SORTOUT function(s).
  6213.           Recommendation:
  6214.           Examine the script and fix the error.
  6215.  
  6216.           E225,sorton: Incorrect direction
  6217.           Cause:
  6218.           The SORTON function was called with a direction that was neither
  6219.           'A' for ascending, or 'D' for descending.
  6220.           Recommendation:
  6221.           Examine the script and fix the error.
  6222.  
  6223.           E221,sortout : cannot allocate sort storage
  6224.           Cause:
  6225.           When a SORTOUT function was executed, there was not enough memory
  6226.           left to create a sort buffer equal to F*T*4+(S*L),
  6227.             where
  6228.             F = number of fields in the SORTOUT function call
  6229.             T = number of tickers in the ticker list
  6230.             S = number of fields in the SORTOUT function call that are
  6231.                strings
  6232.  
  6233.  
  6234.  
  6235.                  Technical Analysis Scanner (TAS)               Page 104
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.             L = average length of the string constants
  6245.  
  6246.           Recommendation:
  6247.           Action D4
  6248.  
  6249.           E22,Symbol Overflow. Increase SYMBOL TABLE SIZE
  6250.           Cause:
  6251.           The script is too large to run with the current setting of SYMBOL
  6252.           TABLE SIZE. The Symbol Table is used to keep the "run time
  6253.           machine language" version of the script while it is executing. If
  6254.           the CONFIGURATION SCREEN setting for SYMBOL TABLE SIZE is
  6255.           too low, there is not enough room to build the run time script.
  6256.           Recommendation:
  6257.           Action D3
  6258.  
  6259.  
  6260.           TAS error code <ccc>
  6261.           Cause:
  6262.           TAS ended with an error. There was a prior message explaining the
  6263.           type of error. The code <ccc> is a code internal to TAS.
  6264.           Generally, it is -1.
  6265.  
  6266.           Recommendation:
  6267.           If the problem persists,record the code <ccc>.
  6268.           Then perform Action D1
  6269.  
  6270.           TAS Profit Test ended with error <ccc>
  6271.           Cause:
  6272.           TAS Profit Test ended with an error. There was a prior message
  6273.           explaining the type of error. The code <ccc> is a code internal
  6274.           to TAS.
  6275.           Generally, it is -1.
  6276.  
  6277.           Recommendation:
  6278.           If the problem persists,record the code <ccc>.
  6279.           Then perform Action D1
  6280.  
  6281.           E125,Temporary result released out of order
  6282.           Cause:
  6283.           TAS internal error.
  6284.           Recommendation:
  6285.           Action D1
  6286.  
  6287.           E130,Temporary array released out of order
  6288.           Cause:
  6289.           TAS internal error.
  6290.           Recommendation:
  6291.           Action D1
  6292.  
  6293.  
  6294.  
  6295.                  Technical Analysis Scanner (TAS)               Page 105
  6296.  
  6297.  
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.  
  6304.  
  6305.           E128,Too many arrays declared
  6306.           Cause:
  6307.           More than the maximum number of permanent arrays were declared
  6308.           (with the ":ARRAY")  declaration. The maximum number of permanent
  6309.           arrays is 26.
  6310.           Recommendation:
  6311.           Reuse some of the permanent arrays for other uses. For example,
  6312.           if you had an array that held a moving average and an array that
  6313.           held a stochastic oscillator, you might use the same array for
  6314.           both (at different times in the script, of course).
  6315.           Alternatively, you could just recompute the value rather than
  6316.           putting the result in an array.
  6317.  
  6318.           E21,Too many END statements
  6319.           Cause:
  6320.           The number of END statements is greater than the number of BEGIN
  6321.           statements.
  6322.           Recommendation:
  6323.           Examine the script and fix the error.
  6324.  
  6325.           E152,Too many GRAPHs requested
  6326.           Cause:
  6327.           An OPENGRAPH function specified less graphs than the number of
  6328.           GRAPH functions which follow it.
  6329.           Recommendation:
  6330.           Examine the script and fix the error.
  6331.  
  6332.           E63,Too many IF-ELSE or GOTO statements.
  6333.           Cause:
  6334.           TAS has run out of room to hold all of the IF-ELSE and GOTO
  6335.           labels.
  6336.           Recommendation:
  6337.           Simplify the script by removing or combining IF-ELSE statements.
  6338.  
  6339.           E126,Too many intermediate arrays needed
  6340.           Cause:
  6341.           A "nested" function call is too complex for TAS to handle. This
  6342.           type of call is a function that calls a function that calls a
  6343.           function....etc.
  6344.           For example,
  6345.             A = MOV(MOV(MOV(ROC(C,12,'%'),21,'E'),21,'E'),21,'E')
  6346.           is a "nested" function call. For each of the internal function
  6347.           calls, TAS has to create an "intermediate" array. TAS has between
  6348.           5 and 12 of these arrays available depending on the value of
  6349.           MAXIMUM QUOTES PER SYMBOL.
  6350.  
  6351.           Recommendation:
  6352.  
  6353.  
  6354.  
  6355.                  Technical Analysis Scanner (TAS)               Page 106
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.           Use permanent arrays (named arrays declared with ":ARRAY") to
  6365.           hold intermediate results.
  6366.            or
  6367.           Action D4
  6368.  
  6369.           E133,Too many parameters for function WRITE
  6370.           Cause:
  6371.           The WRITE and WRITELN functions can accept up to 40 parameters.
  6372.           This is caused by exceeding that number.
  6373.           Recommendation:
  6374.           Break the WRITELN into a WRITE followed by a WRITELN with half
  6375.           the parameters in each function call.
  6376.  
  6377.           E134.Too many parameters for DUMP_ARRAY
  6378.           Cause:
  6379.           The DUMP_ARRAY function can accept up to 12 parameters. This is
  6380.           caused by exceeding that number.
  6381.           Recommendation:
  6382.           Use less parameters for DUMP_ARRAY.
  6383.  
  6384.           E222,Too many parameters for function SORTOUT
  6385.           Cause:
  6386.           The SORTOUT function can accept up to 40 parameters. This is
  6387.           caused by exceeding that number.
  6388.           Recommendation:
  6389.           Use less parameters for SORTOUT.
  6390.  
  6391.           E115,Too many RETURN stmts
  6392.           Cause:
  6393.           TAS has encountered a RETURN statement for which there is no
  6394.           GOSUB or script entry. Every script is run with an "implied"
  6395.           GOSUB, so one RETURN can always be used.
  6396.           Recommendation:
  6397.           Examine the script and fix the error.
  6398.  
  6399.           E114,Too many subroutine calls
  6400.           Cause:
  6401.           The maximum number of GOSUB statements has been executed. If a
  6402.           script does a GOSUB to a subroutine that does a GOSUB to another
  6403.           subroutine, etc, the number of these GOSUBs without intervening
  6404.           RETURN statements is 40.
  6405.           Recommendation:
  6406.           Examine the script and fix the error.
  6407.           If the script is not in error, for example, subroutine A calling
  6408.           subroutine B which calls subroutine A again, then simplify the
  6409.           subroutine nesting.
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.                  Technical Analysis Scanner (TAS)               Page 107
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.           E73,Too many statements to compile procedure.
  6425.           Cause:
  6426.           The TAS script is too large for TAS to handle. The maximum sized
  6427.           script can be over 1000 lines of instructions (comments not
  6428.           included), so this script is "too large".
  6429.           Recommendation:
  6430.           Reduce the size of the script by breaking it into smaller
  6431.           scripts.
  6432.  
  6433.           E53,Unknown word or placement of word
  6434.           Cause:
  6435.           In the process of checking a script for syntax errors, TAS
  6436.           encountered a word that it did not recognize in the location it
  6437.           found it.
  6438.           Recommendation:
  6439.           Examine the script and fix the error.
  6440.  
  6441.           E234, Unable to find ticker <tttttt>
  6442.           Cause:
  6443.           An INDEX command or a LOAD function requested a ticker name that
  6444.           could not be found.
  6445.           Recommendation:
  6446.           Make sure that you have specified the correct ticker symbol for
  6447.           your #INDEX command or your LOAD function. If the ticker name is
  6448.           correctly spelled, check your TAS CONFIGURATION setting for the
  6449.           INCLUDE TICKER PERIOD parameter. If this is set to "Y", then you
  6450.           need to add the "period" to the end of the ticker symbol as shown
  6451.           when you pull up a ticker list.
  6452.  
  6453.  
  6454.  
  6455.            Diagnostic Actions
  6456.  
  6457.  
  6458.           Action D1
  6459.             1.   Create a MetaStock or Chartpro directory containing the
  6460.                ticker file in which the error was discovered (in the case
  6461.                of Metastock, you can do this with the COPY SECURITY
  6462.                command.
  6463.             2.   Copy the script in error to the directory you created in
  6464.                step 1
  6465.             3.   Copy the ticker list used when the error occurred to the
  6466.                directory created in step 1.
  6467.             4.   Use PKZIP or LHARC to compress the files in the directory
  6468.                created in step 1.
  6469.             5.   Upload the file to the FlexSoft BBS AREA J
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.                  Technical Analysis Scanner (TAS)               Page 108
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.           Action D2
  6485.           Record the sequence of commands and actions performed up to the
  6486.           point where the problem occurs as well as the script used.
  6487.           Report the problem to FlexSoft.
  6488.  
  6489.           Action D3
  6490.  
  6491.             1. Increase SYMBOL TABLE SIZE setting in the CONFIGURATION
  6492.                SCREEN. As a good start, double it.
  6493.             2. Then run the script that caused the error.
  6494.             3.   After the script completes, type the ALT-M key while in a
  6495.                TAS menu and record the value of Maximum Symbol Table Size.
  6496.                This is the amount of Symbol Table the script actually used.
  6497.             4. Go back to the CONFIGURATION SCREEN and lower the SYMBOL
  6498.                TABLE SIZE to be a couple of thousand more than the maximum
  6499.                value used.
  6500.           Under no circumstances should you increase the Symbol Table size
  6501.           above 32,000.
  6502.           If increasing the SYMBOL TABLE SIZE leads to other out of memory
  6503.           errors, you may have to reduce the MAXIMUM QUOTES PER SYMBOL
  6504.           setting on the CONFIGURATION SCREEN.
  6505.  
  6506.           Action D4
  6507.             1. Remove any unneeded TSRs.
  6508.             2. Reduce MAXIMUM QUOTES PER SYMBOL in the CONFIGURATION
  6509.                SCREEN.
  6510.             3. Reuse permanent arrays when they are no longer needed.
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.                  Technical Analysis Scanner (TAS)               Page 109
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544.                                         Index
  6545.  
  6546.  
  6547.           ".PRO"  13
  6548.           "batch mode"  9
  6549.           "MASTER"  13
  6550.           "periods"  13
  6551.           "tuning"  13
  6552.           "upgrade releases"  4
  6553.           ALT-M key  10
  6554.           ALT-X key  10
  6555.           Angle(a)  50
  6556.           Argument  82, 83, 85, 87, 88
  6557.           Array  17, 24, 34, 35, 36, 37, 40, 43, 44, 46, 47, 48, 49, 50,
  6558.               51, 52, 53, 54, 55, 58, 61, 63, 66, 67, 72, 74, 77, 79, 82,
  6559.               83, 86, 87, 88, 89, 90, 91, 93, 94
  6560.           Array indices  34
  6561.           Back test
  6562.             see Profit Test  2
  6563.           Bbandt(p,s)  51
  6564.           BEGIN..END  39, 40, 61
  6565.           Beta  51, 82
  6566.           Black box" system  2
  6567.           CASH  22, 23, 24, 79
  6568.           ChartPro  2, 3, 6, 11, 12, 13, 16, 48, 88
  6569.           ChartPro.i.ChartPro  2, 6, 11, 12, 13
  6570.           Color  9, 67, 68
  6571.           Companion products  5
  6572.           Compuserve  5
  6573.           Computrac  3
  6574.           Configuration and Setup  11
  6575.           Configuration Menu  11
  6576.           Configuring TAS  15
  6577.           Context sensitive helpSee HELP Key  10
  6578.           CTRL-BRK  10
  6579.           DAILY data  13
  6580.           DATA DIRECTORY(S)  12
  6581.           DATAPATH  43
  6582.           Date  17, 18, 22, 24, 29, 40, 43, 51, 52, 54, 55, 59, 71, 79, 83
  6583.           Decimal point  34, 52, 56, 59
  6584.           DEFINE TICKER LIST.i.TICKER LIST  15
  6585.           Diagnostic  81, 95
  6586.           DowJones  5
  6587.           EMA  43, 74
  6588.           EMS  3, 12, 14, 83, 90
  6589.           END PHASE  64
  6590.           ENTER  5, 7, 8, 12, 15, 16, 18, 20, 22, 26, 27, 28
  6591.           ESC key  7, 8, 10
  6592.  
  6593.  
  6594.  
  6595.                  Technical Analysis Scanner (TAS)               Page 110
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.           Expanded Memory  3
  6605.           Expanded Memory System  3
  6606.           Expression  31, 36, 37, 38, 42, 62, 63, 81, 82, 86, 91
  6607.           F1 key  10
  6608.           FIRST_TICKER  43, 59, 60, 75, 77
  6609.           FlexSoft BBS  4
  6610.           FOR statement  39
  6611.           FORMAT function  56
  6612.           Format specifier  56
  6613.           Format string  59
  6614.           Formfeed  56
  6615.           FULLNAME  43, 56
  6616.           Function  7, 8, 17, 21, 27, 31, 32, 36, 37, 43, 45, 46, 49, 50,
  6617.               51, 52, 53, 54, 55, 56, 57, 58, 59, 64, 66, 67, 68, 82, 83,
  6618.               84, 85, 86, 87, 88, 89, 90, 92, 93, 94
  6619.           GEnie  5, 6
  6620.           GOSUB  41, 42, 95
  6621.           GOTO  40, 84, 88, 94
  6622.           Graph  48, 52, 64, 66, 67, 68, 69, 84, 85, 94
  6623.           Hardware configuration  3
  6624.           Heap  85, 90
  6625.           HELP Key  7, 10, 22, 27, 28
  6626.           Historical data  2
  6627.           INCLUDE TICKER PERIOD  13
  6628.           INDEX  17, 43, 44
  6629.           INDEX Command  72
  6630.           Indices
  6631.             See Array Indices  34
  6632.           Installation of TAS  7
  6633.             Sample Selection  8
  6634.           Integer  34, 52, 56, 59
  6635.           Intermixing directories  13
  6636.           Investograph Plus  3
  6637.           Iterate
  6638.             see loop  39
  6639.           LAST_TICKER  43, 57
  6640.           Linear regression  49, 51, 52, 53
  6641.           LONG  13, 20, 22, 23, 63, 64, 72, 78, 79, 80, 83, 84
  6642.           Long or complex script  13
  6643.           Loop  38, 39, 58
  6644.           MAX_QUOTES  29, 34, 71, 72, 78, 83, 90
  6645.           MAXIMUM QUOTES  17, 71, 83, 89, 90, 94, 96
  6646.           Maximum value of an "integer" field  59
  6647.           MegaTech  3
  6648.           Memory  3, 10, 14, 83, 85, 89, 90, 92, 96
  6649.           Memory - minimum  3
  6650.           Metastock  3, 11, 12, 13
  6651.           MetaStock data files  5
  6652.  
  6653.  
  6654.  
  6655.                  Technical Analysis Scanner (TAS)               Page 111
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.           MetaStock Pro "Custom Formulas"  2
  6665.           MetaStock Professional  6
  6666.           Minumum Configuration  3
  6667.           MONEY  22, 24, 53, 72
  6668.           Monitor  3
  6669.           Monochrome  9
  6670.           More than 10 Metastock directories  13
  6671.           Mouse  3, 8, 15, 26
  6672.           Nested  94
  6673.           New Line  56, 59
  6674.           New page  56
  6675.           New Ticker List See DEFINE TICKER LIST.i.TICKER LIST  15
  6676.           New versions of TAS  4
  6677.           Number  8, 14, 17, 18, 21, 24, 27, 29, 34, 42, 43, 44, 46, 47,
  6678.               48, 49, 52, 53, 54, 56, 58, 59, 60, 66, 71, 81, 82, 83, 85,
  6679.               86, 92, 93, 94, 95
  6680.           Numeric array  34
  6681.           Old Ticker List See DEFINE TICKER LIST.i.TICKER LIST  15
  6682.           Online order system  4
  6683.           OPTION SETTINGS  22
  6684.           OUTPUT_FILE  70, 78
  6685.           OUTPUT_FILE.i.OUTPUT_FILE  70, 78
  6686.           P  18, 43, 46, 48, 49, 51, 53
  6687.           Parameter  13, 14, 27, 45, 50, 53, 54, 55, 58, 59, 64, 66, 67,
  6688.               82, 85, 87, 88, 89
  6689.           PDL  5
  6690.           Permanent arrays  93, 94, 96
  6691.           PLOT  61
  6692.           PLOT PHASE  64
  6693.           PML  5
  6694.           POUND  70
  6695.           POUND commands  70
  6696.           PRINTER
  6697.             See OUTPUT_FILE  70
  6698.           Prodigy  5, 6
  6699.           Profit test  17, 20, 23, 24, 61, 64, 72, 83
  6700.           PROFIT_TEST  72
  6701.           Pt_buy  64
  6702.           Pt_price  64
  6703.           Pt_sell  64
  6704.           Pt_setprice  64
  6705.           Pt_stop  64
  6706.           QUOTE_COUNT  34, 42, 43
  6707.           QUOTE_RANGE  43
  6708.           QUOTES PER SYMBOL  14
  6709.             processing time  14
  6710.           Rank  7, 8, 16
  6711.           Real number  34
  6712.  
  6713.  
  6714.  
  6715.                  Technical Analysis Scanner (TAS)               Page 112
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.           Redistribution of TAS  5
  6725.           REGISTER.DOC  15
  6726.           Registration Code  4, 15
  6727.             encrypted code  15
  6728.           Running TAS  10
  6729.           SCAN_DATE  71
  6730.           Semi-colon  30, 38, 70, 91, 92
  6731.           SHORT  20, 22, 23, 59, 63, 64, 72, 80, 84
  6732.           Software configuration  3
  6733.           Sort buffer  57, 58, 92
  6734.           Statement  30, 31, 36, 37, 38, 39, 40, 41, 42, 60, 61, 62, 63,
  6735.               68, 69, 72, 74, 75, 84, 86, 88, 89, 91, 92, 94
  6736.           String constant  59, 87
  6737.           Subroutine  41, 42, 95
  6738.           Subscript  35, 87, 91
  6739.           Support  4
  6740.           Suppressing TAS Report Heading  70
  6741.           Switches
  6742.             See Starting TAS  9
  6743.           SYMBOL TABLE SIZE  13, 14, 90, 92, 96
  6744.           SYMBOL TABLE SIZE.i.SYMBOL TABLE SIZE  13
  6745.           Syntax  27, 30, 84, 89, 95
  6746.           SYNTAX CHECK  89
  6747.           Tab  22, 56
  6748.           Tab stops  56
  6749.           TAS Editor  89
  6750.           TAS Main Menu  9
  6751.           TAS.CNF  13
  6752.           Technical Analysis References  6
  6753.           TEST PHASE  64
  6754.           TICKER LIST  15, 18, 29
  6755.           TICKER LISTS  13
  6756.           Trading rules  2
  6757.           TRIM function  33
  6758.           TSRs  96
  6759.           Updates to TASsee new version of TAS  4
  6760.           Upgrade Registration Fee  4
  6761.           Variable  32, 33, 34, 35, 36, 37, 43, 44, 51, 52, 53, 56, 58, 59,
  6762.               60, 64, 74, 75, 81, 83, 84, 89
  6763.           Warranty  6
  6764.           WEEKLY data  13
  6765.           WHILE  58
  6766.           WHILE statement  38
  6767.           Wilder  6
  6768.           XMS  3
  6769.           Yesterday  36, 52, 74
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.                  Technical Analysis Scanner (TAS)               Page 113
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.             ".PRO"  15
  6788.             "batch mode"  9
  6789.             "MASTER"  15
  6790.             "periods"  15
  6791.             "tuning"  16
  6792.             "upgrade releases"  4
  6793.             ALT-M key  11
  6794.             ALT-X key  11
  6795.             Angle(a)  57
  6796.             Argument  93, 94, 96, 99, 100
  6797.             Array  20, 27, 38, 39, 40, 41, 42, 45, 49, 50, 52, 53, 55,
  6798.                 56, 57, 58, 59, 60, 61, 62, 63, 66, 69, 71, 75, 82, 83,
  6799.                 87, 88, 89, 93, 94, 97, 98, 99, 101, 102, 103, 104, 105,
  6800.                 106, 107
  6801.             Array indices  39
  6802.             Back test
  6803.               see Profit Test  2
  6804.             Bbandt(p,s)  57
  6805.             BEGIN..END  44, 45, 46, 69
  6806.             Beta  58, 93, 94
  6807.             Black box" system  2
  6808.             CASH  25, 26, 28, 90
  6809.             ChartPro  2, 3, 6, 13, 14, 15, 18, 55, 100
  6810.             ChartPro.i.ChartPro  2, 6, 13, 14, 15
  6811.             Color  9, 75, 76, 77
  6812.             Companion products  5
  6813.             Compuserve  5
  6814.             Computrac  3
  6815.             Configuration and Setup  13
  6816.             Configuration Menu  13
  6817.             Configuring TAS  17
  6818.             Context sensitive helpSee HELP Key  11
  6819.             CTRL-BRK  12
  6820.             DAILY data  15
  6821.             DATA DIRECTORY(S)  14
  6822.             DATAPATH  49
  6823.             Date  20, 25, 28, 33, 45, 49, 58, 59, 61, 63, 67, 80, 90, 95
  6824.             Decimal point  38, 59, 64, 68
  6825.             DEFINE TICKER LIST.i.TICKER LIST  17
  6826.             Diagnostic  92, 108
  6827.             DowJones  5
  6828.             EMA  49, 83, 84
  6829.             EMS  3, 14, 16, 17, 95, 102
  6830.             END PHASE  72
  6831.             ENTER  5, 7, 8, 15, 17, 18, 19, 21, 23, 25, 29, 31, 32
  6832.             ESC key  7, 8, 11
  6833.             Expanded Memory  3
  6834.             Expanded Memory System  3
  6835.             Expression  35, 41, 42, 43, 48, 70, 71, 92, 93, 98, 103
  6836.             F1 key  11
  6837.             FIRST_TICKER  49, 68, 85, 87
  6838.             FlexSoft BBS  4
  6839.             FOR statement  44
  6840.             FORMAT function  64
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.             Format specifier  64
  6854.             Format string  68
  6855.             Formfeed  64
  6856.             FULLNAME  49, 64
  6857.             Function  7, 8, 19, 24, 31, 35, 36, 41, 42, 49, 51, 52, 56,
  6858.                 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 72, 74, 75, 76,
  6859.                 93, 94, 96, 97, 99, 100, 101, 102, 104, 106, 107
  6860.             GEnie  5, 6
  6861.             GOSUB  46, 47, 48, 107
  6862.             GOTO  45, 46, 96, 100, 106
  6863.             Graph  55, 59, 72, 74, 75, 76, 77, 78, 96, 97, 106
  6864.             Hardware configuration  3
  6865.             Heap  96, 102
  6866.             HELP Key  7, 11, 25, 31, 32
  6867.             Historical data  2
  6868.             INCLUDE TICKER PERIOD  15
  6869.             INDEX  20, 49, 50
  6870.             INDEX Command  82
  6871.             Indices
  6872.               See Array Indices  39
  6873.             Installation of TAS  7
  6874.               Sample Selection  8
  6875.             Integer  38, 59, 64, 67, 68
  6876.             Intermixing directories  15
  6877.             Investograph Plus  3
  6878.             Iterate
  6879.               see loop  44
  6880.             LAST_TICKER  49, 65
  6881.             Linear regression  56, 58, 60
  6882.             LONG  16, 23, 25, 26, 71, 72, 81, 89, 90, 91, 94, 95
  6883.             Long or complex script  16
  6884.             Loop  43, 44, 67
  6885.             MAX_QUOTES  33, 39, 80, 81, 82, 89, 94, 102
  6886.             MAXIMUM QUOTES  20, 80, 95, 101, 102, 106, 109
  6887.             Maximum value of an "integer" field  68
  6888.             MegaTech  3
  6889.             Memory  3, 11, 16, 95, 96, 101, 102, 104, 109
  6890.             Memory - minimum  3
  6891.             Metastock  3, 13, 14, 15
  6892.             MetaStock data files  5
  6893.             MetaStock Pro "Custom Formulas"  2
  6894.             MetaStock Professional  6
  6895.             Minumum Configuration  3
  6896.             MONEY  25, 26, 27, 28, 61, 81
  6897.             Monitor  3
  6898.             Monochrome  9
  6899.             More than 10 Metastock directories  15
  6900.             Mouse  3, 8, 17, 29
  6901.             Nested  106
  6902.             New Line  64, 68
  6903.             New page  64
  6904.             New Ticker List See DEFINE TICKER LIST.i.TICKER LIST  17
  6905.             New versions of TAS  4
  6906.             Number  8, 16, 20, 21, 24, 27, 31, 33, 38, 48, 49, 50, 52,
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.                 53, 55, 56, 59, 60, 61, 64, 65, 66, 67, 68, 74, 80, 92,
  6920.                 93, 94, 95, 96, 97, 104, 106, 107
  6921.             Numeric array  38
  6922.             Old Ticker List See DEFINE TICKER LIST.i.TICKER LIST  17
  6923.             Online order system  4
  6924.             OPTION SETTINGS  25
  6925.             OUTPUT_FILE  79, 80, 89
  6926.             OUTPUT_FILE.i.OUTPUT_FILE  79, 89
  6927.             P  21, 49, 52, 53, 55, 56, 57, 58, 61
  6928.             Parameter  15, 16, 31, 51, 56, 60, 61, 63, 66, 67, 72, 74,
  6929.                 75, 93, 94, 97, 98, 99, 102
  6930.             PDL  5
  6931.             Permanent arrays  106, 107, 109
  6932.             PLOT  69
  6933.             PLOT PHASE  72, 73
  6934.             PML  5
  6935.             POUND  79
  6936.             POUND commands  79
  6937.             PRINTER
  6938.               See OUTPUT_FILE  79
  6939.             Prodigy  5, 6
  6940.             Profit test  20, 24, 26, 27, 28, 69, 72, 81, 95
  6941.             PROFIT_TEST  81
  6942.             Pt_buy  72
  6943.             Pt_price  72
  6944.             Pt_sell  72
  6945.             Pt_setprice  72
  6946.             Pt_stop  72
  6947.             QUOTE_COUNT  39, 47, 49
  6948.             QUOTE_RANGE  49
  6949.             QUOTES PER SYMBOL  16
  6950.               processing time  16
  6951.             Rank  7, 8, 18
  6952.             Real number  38
  6953.             Redistribution of TAS  5
  6954.             REGISTER.DOC  17
  6955.             Registration Code  4, 17
  6956.               encrypted code  17
  6957.             Running TAS  12
  6958.             SCAN_DATE  80
  6959.             Semi-colon  34, 43, 79, 104
  6960.             SHORT  23, 26, 67, 71, 72, 81, 90, 91, 95
  6961.             Software configuration  3
  6962.             Sort buffer  65, 66, 67, 104
  6963.             Statement  34, 35, 41, 42, 43, 44, 45, 46, 47, 68, 69, 70,
  6964.                 71, 77, 82, 84, 95, 96, 98, 100, 101, 103, 104, 107
  6965.             String constant  67, 99
  6966.             Subroutine  46, 47, 48, 107
  6967.             Subscript  40, 99, 103
  6968.             Support  4
  6969.             Suppressing TAS Report Heading  80
  6970.             Switches
  6971.               See Starting TAS  9
  6972.             SYMBOL TABLE SIZE  16, 102, 105, 109
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.             SYMBOL TABLE SIZE.i.SYMBOL TABLE SIZE  16
  6986.             Syntax  31, 34, 95, 101, 108
  6987.             SYNTAX CHECK  101
  6988.             Tab  25, 64
  6989.             Tab stops  64
  6990.             TAS Editor  101
  6991.             TAS Main Menu  9
  6992.             TAS.CNF  15
  6993.             Technical Analysis References  6
  6994.             TEST PHASE  72, 73
  6995.             TICKER LIST  17, 20, 33
  6996.             TICKER LISTS  15
  6997.             Trading rules  2
  6998.             TRIM function  38
  6999.             TSRs  109
  7000.             Updates to TASsee new version of TAS  4
  7001.             Upgrade Registration Fee  4
  7002.             Variable  36, 37, 38, 40, 41, 49, 50, 58, 59, 60, 64, 67,
  7003.                 68, 72, 83, 84, 92, 94, 95, 101
  7004.             Warranty  6
  7005.             WEEKLY data  15
  7006.             WHILE  67
  7007.             WHILE statement  43
  7008.             Wilder  6
  7009.             XMS  3
  7010.             Yesterday  41, 59, 83
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.  
  7042.  
  7043.  
  7044.  
  7045.