home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / finance / tas515dm.zip / TAS514.EXE / lha / TAS.TXT < prev    next >
Text File  |  1993-05-15  |  264KB  |  8,908 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                  This document and all accompanying written and disk based
  8.                  notes and specifications are copyrighted by FlexSoft.
  9.                                           7:12 PM
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.                                     FlexSoft
  32.                            7172 Regional Street, #276
  33.                                 Dublin, CA 94568
  34.        Voice                           510-829-9733
  35.        BBS                            510-829-2293
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.        Page ii   
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  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.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.        TAS       Page 3    
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.                                 Table of Contents
  206.  
  207.        Table of Contents                     3
  208.        Preface                               9
  209.        Introduction                         11
  210.         TAS Features                        11
  211.        System Requirements                  13
  212.         Hardware                            13
  213.         Software                            13
  214.         Data                                13
  215.        Support and Upgrades                 15
  216.         Support                             15
  217.         Updates to TAS (Upgrades)           15
  218.         Redistribution of TAS               16
  219.          Registration Code Secrecy          16
  220.         Other FlexSoft Products             16
  221.          PDL (Prodigy Down Loader)          17
  222.          PTT (Personal Ticker Tape)         17
  223.         Credits                             17
  224.         Disclaimers                         18
  225.         Technical Analysis References       18
  226.        Installing TAS                       19
  227.         Quick Start Installation            19
  228.         Creating and Running a Sample Selection     21
  229.        Running TAS                          22
  230.         Starting TAS from DOS               22
  231.         TAS Main Menu                       23
  232.          Activities                         23
  233.          Activity File Submenu              23
  234.           Run                               24
  235.           Edit                              24
  236.           New                               24
  237.           List                              24
  238.           Delete                            25
  239.           Rename                            25
  240.           Copy                              25
  241.           Prompt for a File Name            25
  242.         Quit                                26
  243.         Error Processing                    26
  244.         Special Keys within TAS             28
  245.        Activity Editors                     29
  246.         Scripts - Editing TAS Scripts       29
  247.          Editor Function Keys               30
  248.          Editor Control Keys                30
  249.         Selections - Scan and Report        31
  250.          Selection Run Options              32
  251.           Index Ticker                      32
  252.           Maximum Quotes                    32
  253.           Start Date                        32
  254.           End Date                          32
  255.          Running Your Selection             32
  256.           Sorting on Selected Columns       33
  257.           Printing Your Selection Report    33
  258.           Creating a Ticker List            33
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.          Errors In Selection Formulas       33
  272.         Profit Tests - Test a system        34
  273.          Profit Test Options                35
  274.          Profit Test Option Settings        35
  275.           Initial Cash                      35
  276.           Test Type                         36
  277.           Commissions                       36
  278.           Share Purchases                   36
  279.           Price Slippage                    37
  280.           Output File Name                  38
  281.           Report Detail                     38
  282.           Maximum Quotes                    38
  283.           Index Ticker                      38
  284.           Reinvest Profits                  38
  285.           Start Date                        38
  286.           End Date                          39
  287.          Running the Profit Test            39
  288.          Errors In Profit Test Formulas     39
  289.         Ticker Lists - Group Securities     40
  290.        Setup TAS                            41
  291.         Data Directories                    41
  292.         Program Options                     42
  293.          Include Ticker Period              42
  294.          Symbol Table Size                  43
  295.          Quotes Per Symbol                  43
  296.          Use EMS Arrays                     44
  297.          Editor Command                     44
  298.          Chart Command                      44
  299.         File Directories                    44
  300.          Script Directory                   45
  301.          Selection Directory                45
  302.          Profit Test Directory              45
  303.          Ticker List Directory              45
  304.          Output Files                       45
  305.          ASCII I/O Directory                45
  306.          Historical Data Directory          45
  307.          Chart Program Directory            46
  308.         Printer Setup                       46
  309.          Printer Type                       46
  310.          Printer Port                       46
  311.          Resolution                         46
  312.          Orientation                        46
  313.          Page Size                          46
  314.          Reverse                            47
  315.         Register Program                    47
  316.         Save Configuration                  47
  317.        Utilities                            48
  318.         DOS Shell                           48
  319.         Run Chart Program                   48
  320.         View A File                         48
  321.        TAS Script Processing                50
  322.        TAS Script Language                  51
  323.         Syntax                              51
  324.         Building Blocks                     52
  325.  
  326.  
  327.        TAS       Page 5    
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.          Variables                          54
  338.           Creation of Variables             54
  339.           TAS Variable Types                54
  340.        "String" Variables  54
  341.        "Numeric" Variables 54
  342.        "Numeric Array" Variables     55
  343.          Assignment Statement               58
  344.          Arithmetic Operators               59
  345.          Functions                          59
  346.          IF Statement                       59
  347.          WHILE Statement                    60
  348.          FOR Statement                      60
  349.          FOR EACH POINT Statement           61
  350.          BREAK Statement                    61
  351.          BEGIN..END Statement               62
  352.          GOTO Statement and LABELS          62
  353.          GOSUB statement                    63
  354.          RETURN statement                   64
  355.          STOP Statement                     65
  356.          PROLOG statement                   65
  357.          EPILOG statement                   65
  358.          Logical Operators                  65
  359.          Relational Operators               66
  360.          Comments                           66
  361.         Pre-Defined Variables               67
  362.         Pre-Defined DATA Arrays             68
  363.        Pre-defined Functions                70
  364.         Technical Indicators available in Metastock 70
  365.          ad Accumulation/Distribution       70
  366.          adx      Average Directional Movement 71
  367.          adxr Average Directional Movement Rating   71
  368.          add                    Add two arrays 71
  369.          cci     Commodity Channel Index Array 71
  370.          co Chaikin's Oscillator            72
  371.          cos              Trigonometric cosine 72
  372.          cum       Cumulative Sum of Array "a" 73
  373.          div                 Divide two arrays 73
  374.          dmi        Directional Movement Index 73
  375.          exp              Exponential Function 73
  376.          hhv                Highest High Value 74
  377.          llv                  Lowest Low Value 74
  378.          log             Exponential Logarithm 74
  379.          macd MACD indicator                74
  380.          mdi  Minus Directional Movement (-DI) 74
  381.          mo Momentum Array                  75
  382.          mov                    Moving Average 75
  383.          mul               Multiply two arrays 76
  384.          neg             Negative of Array "a" 77
  385.          nvi         Negative Volume Indicator 77
  386.          obv                 On Balance Volume 77
  387.          oscp Price Oscillator              78
  388.          oscv Volume Oscillator             78
  389.          pdiPositive Directional Movement (+DI)     78
  390.          per             Performance Indicator 79
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.          pvi         Positive Volume Indicator 79
  404.          ref                Reference function 79
  405.          rsi        Wilder's Relative Strength 79
  406.          roc              Rate Of Change Array 80
  407.          sar                Wilder's Parabolic 80
  408.          sin                Trigonometric sine 80
  409.          sqrt Square root                   80
  410.          std   Statistical Standard Deviation. 81
  411.          stoch           Stochastic Oscillator 81
  412.          sub   Subtract one array from another 81
  413.          sum             Sum array over period 81
  414.          tan             Trigonometric tangent 82
  415.          trix TRIX Function                 82
  416.          tsf              Time Series Forecast 82
  417.          var              Statistical Variance 82
  418.          vol             Volatility Indicator. 83
  419.          wc Weighted Close                  83
  420.          willa                   William's A/D 83
  421.          willr                    William's %R 84
  422.          zig                  Zig Zag Function 84
  423.         TAS Functions                       85
  424.          addto             Add number to array 85
  425.          angle                 Angle of a line 85
  426.          alpha                  Alpha function 85
  427.          avgprc                  Average Price 86
  428.          bbandt             Top Bollinger Band 86
  429.          bbandb          Bottom Bollinger Band 86
  430.          beta "Beta" function               86
  431.          compress             Date Compression 86
  432.          const                  Constant Array 87
  433.          corrcoef      Correlation Coefficient 87
  434.          datestr       Create a formatted date 87
  435.          daymon          Day of Month function 87
  436.          daywk            Day of Week function 88
  437.          defined      Check if variable exists 88
  438.          divby          Divide array by number 88
  439.          dump_array Dump Array Contents     88
  440.          expand        Expand formatted string 88
  441.          findfst              Find first value 89
  442.          findlst               Find last value 89
  443.          findstr                Find substring 89
  444.          future           Future array element 89
  445.          int                    Create Integer 90
  446.          isect         Find array intersection 90
  447.          linreg              Linear Regression 90
  448.          linreg2       2 Way Linear Regression 90
  449.          load Load a data array             91
  450.          macdx                   MACD Extended 91
  451.          max           Maximum value of a pair 91
  452.          maxPair   Maximum value of two arrays 91
  453.          maxVal         Maximum value in array 92
  454.          maxQuotes     Set Maximum Data Points 92
  455.          memleft         Show remaining memory 92
  456.          mfi                  Money Flow Index 92
  457.  
  458.  
  459.        TAS       Page 7    
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.          min           Minimum value of a pair 92
  470.          minPair   Minimum value of two arrays 93
  471.          minVal         Minimum value in array 93
  472.          month                  Month function 93
  473.          mulby              Multiply by number 93
  474.          now  Current date                  93
  475.          outputFile       Specify listing file 94
  476.          over Over function                 94
  477.          pause         Wait for keyboard input 94
  478.          peak Find Peak in Array            94
  479.          per1 Performance using Array       96
  480.          redo Rerun profit test             96
  481.          redo_count         Profit Test Reruns 96
  482.          set                Set Array to Value 96
  483.          sign Sign of array entries         96
  484.          slope                   Slope of Line 97
  485.          strlen                  String Length 97
  486.          strrep                 String Replace 97
  487.          subfrom    Subtract number from array 97
  488.          substr             Substring function 98
  489.          trendline          Create a Trendline 98
  490.          trendpar           Parallel Trendline 98
  491.          trough           Find Trough in Array 98
  492.          tr Wilder's True Range             98
  493.          trim Trim blanks from a string     99
  494.          year Year function                 99
  495.          zero Zero Array                    99
  496.        Input/Output Functions              100
  497.         WRITE and WRITELN  Functions       100
  498.         FORMAT Function                    100
  499.         Format Specifiers                  101
  500.         SORT Functions                     101
  501.          SORTOUT                           102
  502.          SORTON                            102
  503.          SORTGET                           102
  504.          SORTPRINT                         103
  505.         Column Headings                    104
  506.         ASCII File Functions               105
  507.          AOpen                 Open ASCII file 105
  508.          AClose               Close ASCII file 105
  509.          APut Put Line to ASCII file       105
  510.          AGet Get Line from ASCII file     106
  511.         User Input Function                106
  512.          Ask  Get User Input               106
  513.          VMenu                  Vertical  Menu 107
  514.        Profit Test Statements              108
  515.         PLOT statement: Define Technical Indicators 108
  516.         BUY WHEN - Define BUY Conditions   109
  517.         SELL WHEN - Define SELL Conditions 109
  518.         STOP (LONG or SHORT) Condition     110
  519.         TAS Profit Tester Functions        110
  520.          Profit Test Phases - Advanced Use Only     111
  521.        GRAPH Functions                     113
  522.         OPENGRAPH                          113
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.         SIZEGRAPH                          113
  536.         GRAPH                              114
  537.         DRAWLINE                           114
  538.         CLOSEGRAPH                         115
  539.         PRINTGRAPH                         116
  540.         ANNOTATE                           116
  541.         HLINE                              117
  542.         VLINE                              117
  543.         GRAPH EXAMPLES                     117
  544.        TAS "POUND" (#) Commands            121
  545.         OUTPUT_FILE Command                121
  546.          Appending to Output File          121
  547.          Suppressing TAS Report Heading    122
  548.         MAX_QUOTES Command                 122
  549.         SCAN_DATE Command                  122
  550.         PROFIT_TEST Command                123
  551.         INDEX Command                      124
  552.         INCLUDE Command                    124
  553.         TITLE Command                      125
  554.        TAS Script Examples                 126
  555.         Putting Them Together              126
  556.         New High/New Low Example           127
  557.          Script Contents                   128
  558.          Script Output                     128
  559.         TICKER Symbol Processing           129
  560.          Script Contents                   129
  561.         Directional Movement Example       130
  562.          Script Contents                   130
  563.          Script Output                     131
  564.         Modified "Binary Wave"             131
  565.         Profit Test Example Using RSI(14)  131
  566.          Script Contents (RSIPT.TAS)       131
  567.          Script Output                     132
  568.        TAS Error Message                   135
  569.         Error Messages                     135
  570.         Diagnostic Actions                 149
  571.        Supported Graph Output Devices      151
  572.         Graphics Device Names              151
  573.         Drawing Colors and Output Support  154
  574.         Setting Up The Environment for GP  154
  575.        Index                               157
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.        TAS       Page 9    
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                                      Preface
  602.  
  603.  
  604.        TAS grew out of a personal requirement. Thanks to the recent
  605.        explosive growth in the availability of relatively inexpensive
  606.        daily quote services, I was able to gather daily price and volume
  607.        data on potentially thousands of stocks and indices each day.
  608.        Unfortunately, I did not have time to examine this data regularly
  609.        before it had already changed.  I needed some way to scan my data
  610.        to find the opportunities I might be missing otherwise.  As a user
  611.        of technical analysis, I had to be able to use classic technical
  612.        indicator functions that would provide more than just price or
  613.        volume information.  I also needed a system that would allow me to
  614.        test my strategies with historical data on many securities.
  615.        Finally, I needed a system flexible enough to allow me to test and
  616.        scan for any system that might be conceived.  As both a
  617.        professional programmer and a technical analyst, I felt that the
  618.        best way to fill these needs was to write my own program.  While I
  619.        was researching the project and discussing it with others, many of
  620.        my friends and acquaintances as well as professional contacts asked
  621.        me to make the program available to them.  Since then the interest
  622.        has continued to spread widely.
  623.        I wish to thank all TAS users for your support and especially your
  624.        suggestions and ideas on how to make TAS a better product.
  625.                                                          Martin Moore
  626.                                                       Dublin, CA 1993
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.                                   Introduction
  671.  
  672.        Technical Analysis Scanner (TAS) is a computer program that lets
  673.        you scan and analyze your stock, commodity, mutual fund or market
  674.        index (collectively termed "securities" in this manual) data base
  675.        using the power of you computer.
  676.  
  677.        You may base your own analysis on popular strategies, or you may
  678.        modify them or develop your own strategies.  Thus you have at your
  679.        fingertips a powerful tool which can be of help when you make deci-
  680.        sions about your securities portfolio.
  681.  
  682.  
  683.  
  684.         TAS Features
  685.  
  686.  
  687.        TAS includes numerous special features that make scanning and
  688.        analysis of your securities database easier than ever:
  689.  
  690.        ¿ Complete Control - TAS is a generalized technical analysis "tool
  691.          box".  It is not a "black box" system where you have no knowledge
  692.          of the rules or control over its decision making process.  With
  693.          TAS, you have complete control over the indicators chosen, their
  694.          interpretation, and the output formatting of your reports.
  695.  
  696.        ¿ High-Level Analysis - With TAS, you can combine over 60 built-in
  697.          technical indicators, compare their values against other
  698.          indicators or values, make decisions based on the result of those
  699.          comparisons, and ultimately, create a report which shows you what
  700.          you want to see.
  701.  
  702.        ¿ Massive Power - TAS is designed to enable you to go beyond the
  703.          simpler analytical power available with other charting or
  704.          scanning programs. TAS lets you apply your simple or complex
  705.          trading system to all, or any part of, the data in your
  706.          historical price/volume Data Base.  If you have a trading strat-
  707.          egy that relies on technical indicators or price action, but you
  708.          do not have the time to chart all of your stocks everyday, then
  709.          TAS is the tool you need.
  710.  
  711.        ¿ Custom Reports - TAS can also be used to create custom reports on
  712.          your stocks. For example, you can use it to notify you when a
  713.          particular stock has reached a certain price, volume or technical
  714.          indicator value.
  715.  
  716.        ¿ Profit Testing - With the Profit Tester feature, you can confirm
  717.          the profitability of your trading system.  TAS goes back through
  718.          your historical data, a day at a time, applying your trading
  719.          rules to the indicators and conditions you specify.  It keeps
  720.          track of the days you bought, sold or were stopped out of
  721.  
  722.  
  723.        TAS       Page 11   
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.          positions, tabulating the results on a daily basis, or in a
  734.          summary report which tells you how your system performed.
  735.  
  736.        The rest of this book tells you how to take advantage of the TAS
  737.        features listed above.
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.                                System Requirements
  800.  
  801.        In order to use TAS, you should have the following software and
  802.        hardware configuration.
  803.  
  804.  
  805.  
  806.  
  807.         Hardware
  808.  
  809.  
  810.        Any IBM PC processor type (8088, 8086, 80x86)
  811.        A CGA, EGA, or VGA Monitor (EGA or VGA required for Charts)
  812.        Hard Disk (optional)
  813.        Microsoft or Logitech Mouse (optional)
  814.        512K minimum memory (640K better)
  815.        Expanded Memory (XMS) will be used on 286/386/486 class machines if
  816.        there is an Expanded Memory System (EMS) driver or actual LIM 4.0
  817.        EMS memory installed.
  818.  
  819.  
  820.  
  821.  
  822.  
  823.         Software
  824.  
  825.  
  826.        DOS 2.1 or later
  827.  
  828.  
  829.  
  830.         Data
  831.  
  832.  
  833.        Historical Price/Volume Data in any of the following formats:
  834.        + "Computrac" Format historical data files  used by Metastock,
  835.          Investograph Plus, and Computrac, among others
  836.        + ChartPro or MegaTech data files
  837.        + Commodity Systems Incorporated (CSI) format
  838.  
  839.             
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.        TAS       Page 13   
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                               Support and Upgrades
  866.  
  867.  
  868.  
  869.  
  870.         Support
  871.  
  872.  
  873.        You can get support for TAS problems or questions by contacting
  874.        FlexSoft at its mailing address below:
  875.        FlexSoft
  876.        7172 Regional St, #276
  877.        Dublin, CA 94568
  878.  
  879.        or by telephone at 510-829-9733
  880.        or by Email on the following services:
  881.  
  882.          OnLine Service      Userid
  883.          GEnie                M.MOORE41
  884.          Prodigy              JBMD65A
  885.          FlexSoft BBS (510-829-2293)                             SYSOP
  886.          Compuserve           76447,2367
  887.  
  888.  
  889.  
  890.  
  891.         Updates to TAS (Upgrades)
  892.  
  893.  
  894.        New releases of TAS may  be defined as "upgrade releases". An
  895.        Upgrade Release will require a new Registration Code and  an
  896.        Upgrade Registration Fee. When a major feature is added to TAS,
  897.        there will be a "Feature Upgrade" cost as well.
  898.  
  899.        Update versions of TAS are available , on the FlexSoft BBS at
  900.        510-829-2293.
  901.  
  902.        The FlexSoft BBS has an online order system which you can use to
  903.        purchase your new TAS update.  You will need a VISA , Mastercard,
  904.        or American Express credit card number to order your update to TAS
  905.        when using the online order system. Once your order is confirmed,
  906.        you will be given access to the "area" of the BBS that contains the
  907.        TAS update version.
  908.  
  909.        You can also obtain updates to TAS by U.S. Mail. If you need an
  910.        update by U.S. Mail, please send $5 for shipping and handling in
  911.        addition to the Update and/or Upgrade Registration Fee. Methods of
  912.        payment are by check,  money order, or VISA,  Mastercard, or
  913.        American Express credit card number (include expiration date).
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.         Redistribution of TAS
  933.  
  934.  
  935.        You may re-distribute TAS to BBS systems or other public locations
  936.        as long as you distribute the entire package (either .ZIP or self-
  937.        extracting .EXE file format).
  938.  
  939.        Registration Code Secrecy
  940.        You may not divulge or redistribute your registration code , nor
  941.        may you transfer it to anyone else.
  942.  
  943.        If you divulge or publish your registration code to an unregistered
  944.        party, or parties, that registration code will be invalidated and
  945.        your code will not work for future upgrades to TAS or any other
  946.        FlexSoft product until a new code is obtained at the full price for
  947.        the product whose code was compromised.
  948.  
  949.  
  950.  
  951.         Other FlexSoft Products
  952.  
  953.  
  954.        FlexSoft also has two companion products for users who wish to
  955.        order them. The first product is called PTT (Personal Ticker Tape),
  956.        and the second is called PDL. With the combination of TAS, PTT and
  957.        PDL, you have "end to end" access to your stock market data. PDL
  958.        downloads the quotes, PTT updates the database, and TAS allows you
  959.        to search, analyze, report, and chart the data.  PTT and PDL are
  960.        described below.
  961.  
  962.        Each of these programs can be ordered from FlexSoft or downloaded
  963.        from GEnie or Compuserve.
  964.  
  965.        PDL (Prodigy Down Loader)
  966.        PDL is a program that downloads, or captures, daily quote data and
  967.        market indices from the Prodigy Information Service. PDL can
  968.        download up to 4,000 daily quotes in a single run. If you need to
  969.        download more quotes, then you can run PDL several times. It uses
  970.        the Quote Track and/or Market Close features of Prodigy to obtain
  971.        the quotes, so there is no need to go into Prodigy and enter the
  972.        quotes by hand, as some systems require you do. The creation of the
  973.        ticker list of quotes to download can be done with a simple TAS
  974.        script.
  975.  
  976.        PDL also has a "vacation mode" that will enable you to go on
  977.        vacation or leave town for extended periods and still gather daily
  978.        quote data.
  979.  
  980.  
  981.        PTT (Personal Ticker Tape)
  982.        PTT converts quotes from GEnie, DowJones, Prodigy and Compuserve
  983.        into MetaStock data files and an ASCII format for input to
  984.        spreadsheets. PTT produces summary reports on all your Metastock
  985.  
  986.  
  987.        TAS       Page 15   
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.        files whether you update the files with PTT or not. Colors are used
  998.        to highlight those stocks which exceed either PRICE or VOLUME
  999.        limits you set in the installation procedure. PTT also creates a
  1000.        Summary Report file.
  1001.        PTT can also be used to download closing quotes directly from
  1002.        either Compuserve or GEnie data services.
  1003.  
  1004.  
  1005.  
  1006.  
  1007.         Credits
  1008.  
  1009.  
  1010.        MetaStock Professional is a stock charting program from Equis Inc.
  1011.  
  1012.        ChartPro and MegaTech are stock charting programs written by David
  1013.        Rettger.
  1014.  
  1015.        GEnie is a trademark of General Electric Co.
  1016.  
  1017.        Prodigy is a trademark of Prodigy Services Co.
  1018.  
  1019.  
  1020.  
  1021.  
  1022.         Disclaimers
  1023.  
  1024.  
  1025.        In no event will FlexSoft (or any of  its employees or owners) be
  1026.        liable to you for any damages, including any lost profits, lost
  1027.        savings, or other incidental or consequential damages arising out
  1028.        of the use of, or inability to use the program.  This product is
  1029.        distributed "as is" with no warranty expressed or implied.
  1030.  
  1031.        FlexSoft reserves the right to make modifications at any time.
  1032.        Prices are subject to change without notice.
  1033.  
  1034.  
  1035.  
  1036.  
  1037.         Technical Analysis References
  1038.  
  1039.  
  1040.        The Encyclopedia of Technical Market Indicators, Colby & Meyers,
  1041.        Dow Jones Irwin Press, 1988, ISBN 1-55623-049-4
  1042.        New Concepts in Technical Trading Systems, J. Welles Wilder Jr.,
  1043.        Trend Research, 1978, ISBN 0-89459-027-8
  1044.        The New Commodity Trading Systems and Methods, Perry J. Kaufman,
  1045.        John Wiley and Sons 1987, ISBN 0-471-87879-0
  1046.        Metastock Professional Users Guide, Equis International
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                  Installing TAS
  1064.  
  1065.        TAS is distributed as an "LHA" compressed collection of files. The
  1066.        name of the file will be based on the version and release level of
  1067.        TAS. For version 5, release 00, the name will be 'TAS500.EXE', and
  1068.        in general, the name will be 'TASvrr.EXE' where 'v' is the Version
  1069.        and 'r' is the Release.
  1070.  
  1071.  
  1072.  
  1073.         Quick Start Installation
  1074.  
  1075.  
  1076.        The following "quick start" documentation shows how to get TAS up
  1077.        and running on your system initially. The file name for the TAS
  1078.        file is referred to as "TASvrr.EXE".
  1079.  
  1080.        If you received TAS on a floppy disk, follow the installation
  1081.        instructions that came with the disk. You should place the diskette
  1082.        the appropriate floppy drive, "log" to that drive (e.g., type
  1083.        A:<Enter>), then type INSTALL.
  1084.  
  1085.        Otherwise, if you have received TAS by downloading it from a
  1086.        Bulletin Board System (BBS) or some other means, you should perform
  1087.        the following steps:
  1088.  
  1089.        1.   Create a directory to contain TAS software. It can be any name
  1090.        you choose. The following instructions assume the subdirectory name
  1091.        is "\TAS". To create a directory named \TAS on your C: drive, type
  1092.        "MD C:\TAS"
  1093.        2.   You should copy TASvrr.EXE into directory \TAS  by typing
  1094.                  COPY TASvrr.EXE C:\TAS
  1095.        3.   CD \TAS
  1096.        4.   Type TASvrr, e.g, if the file is TAS500.EXE, type 'TAS500'.
  1097.        This will start a file extraction procedure that sets up the files
  1098.        necessary for running TAS. You should reply "Y" to the prompt tha
  1099.        tinitially appears.
  1100.  
  1101.        Once the files are installed in the TAS subdirectory.
  1102.  
  1103.        1.   Type TAS  and press ENTER.
  1104.        2.   You will be presented with an initial screen which tells you
  1105.        that you have not run TAS before. Hit the ESC key after reading the
  1106.        message.  You will see another message indicating you have a trial
  1107.        version of TAS. Once again, hit the ESC key to move to the next
  1108.        screen.
  1109.        3.   You will now be placed in the  Main Menu screen of TAS. Choose
  1110.        Setup to go to the program setup menu.
  1111.        4.   Now choose File Directories to set your default historical
  1112.        data directory DOS path. For example, if your data is in Metastock
  1113.        format, you can set the Historical Data Path setting to the "top"
  1114.        part of your DOS path. For example, suppose all your data
  1115.        directories are under the major directory E:\MS\DATA in directories
  1116.        A_E, F_P, and Q_Z, by entering the directory E:\MS\DATA, you will
  1117.  
  1118.  
  1119.        TAS       Page 17   
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.        not have to repeat that part of the path when you fill in the list
  1130.        of data directories in the next step. Similarly, if you have
  1131.        Technical Tools data, the path to those directories can also be
  1132.        specified here. Specify your top path and hit Enter, then hit F10
  1133.        to save the results.
  1134.        5.   Now choose Data Directories from the Setup menu. You will see
  1135.        a list of 5 groups of 10 directories you can specify. Choose Data
  1136.        Directories 1-10 first. Enter each data directory name (without the
  1137.        top part entered in the previous step). Move over to the Historical
  1138.        Data Format box and type the first letter of the type (e.g,  M for
  1139.        Metastock). Then hit Enter and move to the next row.
  1140.             When done, hit the F3 key to save this list.
  1141.        6.   Repeat the previous step for each 10 data directories.
  1142.        7.   Finally, if you have registered TAS, it is now time to enter
  1143.          your registration code and name. Choose the Register Program menu
  1144.          option from the Setup menu. Enter your name (using upper and
  1145.          lower case as a proper name should be entered), and then enter
  1146.          your registration code as given to you on yourr FlexSoft invoice
  1147.          or by other means. This code need not be all upper case. Hit the
  1148.          F10 key to save your settings. Now leave the program to make the
  1149.          registration procedure take effect. The next time you enter TAS,
  1150.          it should indicate you are registered at the bottom of the
  1151.          screen.
  1152.  
  1153.        TAS is now installed .  The following section shows how to do a
  1154.        build and run a simple selection that will perform the same
  1155.        function as the Metastock Utility Rank feature.
  1156.  
  1157.  
  1158.  
  1159.  
  1160.         Creating and Running a Sample Selection
  1161.  
  1162.  
  1163.          1. Go to the Activities Menu item. Select Ticker List by moving
  1164.             the cursor bar down to that selection and pressing ENTER. If
  1165.             you have a mouse, you can click on the menu item itself.
  1166.          2. Select New from the Files prompt.
  1167.          3. You will see a prompt box asking for the name of the new file.
  1168.             Enter the name "MYTICKS" . This will be the name of a ticker
  1169.             list for testing.
  1170.          4. After a moment, TAS will present you with a list of all the
  1171.             tickers it found in the Data Directories you defined in the
  1172.             Data Directories screen. Move the cursor to each ticker symbol
  1173.             you want to run a script against. Hit the SPACE bar on the
  1174.             symbol.  It should highlight (indicating it is selected). Hit
  1175.             F3 when all desired symbols are selected. This will save the
  1176.             ticker list you just created.
  1177.        5.   At the Main Menu, select Activities, then Selections.
  1178.        6.   Select Edit from the Files Menu
  1179.        7.   Type MSURANK and hit ENTER.
  1180.        8.   Hit the F4 function key to RUN the MSURANK selection. TAS will
  1181.        now display a screen containing all the ticker lists available to
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.        use. You will be asked which ticker list you wish to use when you
  1196.        run this script.
  1197.        9.   Pick the ticker list you just created "MYTICKS.TCK" by moving
  1198.        the cursor or mouse to the file name and pressing ENTER or clicking
  1199.        on the filename.  This particular selection  will create a report
  1200.        like the one Metastock Utility (MSU) creates when you select "Rank"
  1201.        using a 26 day Rate of Change and a 10 day Moving Average.
  1202.        10.  Now TAS runs the script with the ticker symbols you put in the
  1203.        ticker list. As each ticker is processed, you will see a line in
  1204.        the "run" window. Once all tickers are processed, the report will
  1205.        be presented on the screen, sorted by ticker.
  1206.        11.  Hit F1 now to see the choices you have. By hitting F1, you can
  1207.        read the help and see what you can do from here. You can sort your
  1208.        tickers on the value of any column shown, either ascending or
  1209.        descending order. To sort on the values in the second column, press
  1210.        the key sequence Alt-2 (hold the ALT key and hit the number 2 at
  1211.        the same time).
  1212.        12.  To exit from the report screen, hit the ESC key.
  1213.  
  1214.        The documentation for the system is in the online help file
  1215.        available by hitting the F1 key at any time.
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.        TAS       Page 19   
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                                    Running TAS
  1262.  
  1263.  
  1264.  
  1265.  
  1266.         Starting TAS from DOS
  1267.  
  1268.  
  1269.        In general, you can start TAS with the following format command:
  1270.         TAS [switches] [scriptName] [tickerListName]  [@parameters]
  1271.  
  1272.        The options in brackets are optional and need not be specified.
  1273.  
  1274.        You can start TAS in "MENU MODE" by simply typing "TAS" by itself.
  1275.        TAS has switches available which you can specify on the command
  1276.        line. They are:
  1277.  
  1278.        -c   Eliminate CGA "snow"
  1279.  
  1280.          -b Use BIOS to write to video screen. This may be necessary on
  1281.             some systems which are not 100% compatible.
  1282.  
  1283.        -m   Use Monochrome color scheme
  1284.  
  1285.        If you are a registered user of TAS, you can also start TAS in
  1286.        "batch mode" by specifying the name of a SCRIPT, the scriptName,
  1287.        and the Ticker List, the tickerName, on the command line. So, if
  1288.        you had a TAS script named "SELECT.TAS" and a Ticker List named
  1289.        "MYSTOCK.TCK", you could run the SELECT script against the stocks
  1290.        in the list MYSTOCK by typing:
  1291.  
  1292.          TAS SELECT MYSTOCK
  1293.  
  1294.        If you wanted TAS to process all of the stock symbols (Tickers) in
  1295.        your data base, you can omit the Ticker List name.
  1296.  
  1297.        You can also specify initial script statements to be executed at
  1298.        the beginning of the script by specifying parameters on the command
  1299.        line, preceded by the "@" sign. Each statement should be terminated
  1300.        by a semi-colon, just as it would be if it were inserted at the
  1301.        beginning of the script. See the section titled "Syntax" beginning
  1302.        on page 44 for a description of script statements.
  1303.  
  1304.  
  1305.  
  1306.  
  1307.         TAS Main Menu
  1308.  
  1309.  
  1310.  
  1311.  
  1312.        The TAS Main Menu is the starting point when you work with TAS. It
  1313.        contains a horizontal menu with four items, Activities, Setup,
  1314.        Utilities, and Quit.
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.        When you first use TAS, you should go immediately to the Setup menu
  1332.        item and prepare the program for use. See the Installation section
  1333.        (page 17) for a discussion of TAS Installation and Setup.
  1334.  
  1335.        Activities
  1336.        The Activities menu  item contains a pulldown menu that shows you
  1337.        the "activities" which you can perform while using TAS. The
  1338.        activities are
  1339.        +    General Scripts
  1340.        +    Selections
  1341.        +    Profit Tests
  1342.        +    Ticker List
  1343.  
  1344.  
  1345.        Activity File Submenu
  1346.        Once you select a particular activity, you are presented with a
  1347.        File menu that lists the actions that can be applied to the
  1348.        activity of  your choice.The options available for each activity
  1349.        are:
  1350.        +    List all files matching the activity type
  1351.        +    Edit or modify an existing activity file using the activity
  1352.        editor
  1353.        +    Create a new activity file
  1354.        +    Run or execute a specific activity file
  1355.        +    Delete a specific activity file
  1356.        +    Rename a specific activity file
  1357.        +    Copy a specific activity file
  1358.  
  1359.  
  1360.        Run
  1361.        If you have an existing activity you want to run, you can use the
  1362.        Run file item to tell TAS to run the file. Once you enter the name
  1363.        of the file to be run, you will be asked which ticker list you want
  1364.        to use for this run.
  1365.  
  1366.        Edit
  1367.        The Edit file item will bring up the activity-specific editor for
  1368.        the particular file you are working with. See the section
  1369.        describing Activity Editors (page 25 ) for a description of the
  1370.        operation of each of these editors.
  1371.        For example, if you are in the Ticker List activity, you will be
  1372.        shown a ticker list screen where you can add and delete items from
  1373.        your ticker list.
  1374.  
  1375.        New
  1376.        The New file item can be used to create a new activity file. Once
  1377.        you type in the new name (without the file extension, please), the
  1378.        Activity Editor is brought up for you to complete the creation of
  1379.        the file.
  1380.  
  1381.  
  1382.  
  1383.        TAS       Page 21   
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.        List
  1397.        The List menu item allows you to see a list of all the files
  1398.        available for the particular activity you have previously chosen to
  1399.        work with (by selecting from the Activity menu prior to this menu).
  1400.        When you select List, an extended  File Selection Screen will
  1401.        appear which contains the names of all the files in the file
  1402.        directory ending with the file extension of the type of file you
  1403.        have chosen. (e.g., ".TAS" for script files).
  1404.        Next to each file's name is a title description for the file. This
  1405.        title is obtained from the #TITLE command at the beginning of the
  1406.        file (if there is one), or *Untitled* if no title line is found in
  1407.        the file1.
  1408.  
  1409.        You can modify the file's title by using the Alt-T key combination
  1410.        while the cursor is positioned on the file name whose title is to
  1411.        be modified.
  1412.        If you are viewing Script files, while presented with this list,
  1413.        and if you have defined your user editor,  the Alt-E will invoke
  1414.        your own editor with this file as input.
  1415.        To use the TAS built-in editor, move the cursor or mouse over to
  1416.        the file name you choose and press Enter (or double-click with the
  1417.        mouse). Once you do this, you will be placed in the Edit mode for
  1418.        the activity file.
  1419.  
  1420.        Delete
  1421.        You can use the Delete file item to delete a file. Type in the file
  1422.        name (without the extension always) and hit ENTER. The file will be
  1423.        deleted.
  1424.  
  1425.        Rename
  1426.        You can rename a file by choosing this item. You will first be
  1427.        prompted for the name of the existing file. After entering that
  1428.        name, you will be asked for the new name of the file.
  1429.  
  1430.        Copy
  1431.        Choose this item to copy a file. You will first be prompted for the
  1432.        name of the existing file. After entering that name, you will be
  1433.        asked for the new name of the file to which it is to be copied.
  1434.  
  1435.  
  1436.        Prompt for a File Name
  1437.        For all menu choices in the File menu (except the List item), if
  1438.        you don't recall the name of the file, you can hit ENTER at the
  1439.        prompt, and the List screen will appear. Move the cursor or the
  1440.        mouse over to the file you want to choose and hit ENTER. The List
  1441.  
  1442.  
  1443.        ____________________
  1444.        1 Because it is necessary to open and read the first line of each
  1445.         matching file in your directory, you may have to wait a few
  1446.         moments for the extended list to display.
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.        screen will close and your file name will appear in the prompt box.
  1460.        Just hit ENTER at this point to perform the action you choose.
  1461.  
  1462.  
  1463.  
  1464.  
  1465.         Quit
  1466.  
  1467.  
  1468.        This option will exit from TAS. If you want to go to DOS and return
  1469.        to what you were doing within TAS, use the ALT-X key.
  1470.  
  1471.  
  1472.  
  1473.         Error Processing
  1474.  
  1475.  
  1476.        When an error is detected in a TAS script, selection, or profit
  1477.        test, TAS will attempt to isolate the cause of the error and dis-
  1478.        play an error message as well as an information screen that de-
  1479.        scribes the cause of the error and a recommendation for fixing the
  1480.        error.
  1481.  
  1482.        The script line number and column where the error was detected is
  1483.        also given to you to further isolate the problem.  Below is an
  1484.        example of an error detected in a Selection Script. Note the error
  1485.        message next to the line in error and the explanation at the bottom
  1486.        of the page.
  1487.  
  1488.        #MAX_QUOTES 31
  1489.        F1 : ARRAY;
  1490.        F1 = MOV(c,10,'S')x; { <----- ERROR#60:Don't know what to do with
  1491.        "X" }
  1492.        F2 : ARRAY;
  1493.        F2 = MOV(c,30,'S');
  1494.        F3 : ARRAY;
  1495.        F3 = f2-f1;
  1496.        C1 = ISECT(f1,f2)=0;
  1497.        +--------------------------TAS ERROR 60 Has Occurred---------------
  1498.        ---------------+
  1499.        The following error has been detected around Line 3, Column 20
  1500.        ERROR#60:Don't know what to do with "X"
  1501.  
  1502.                               Press ESC to continue
  1503.  
  1504.        -----------------------Explanation for Error Number 60-------------
  1505.        -------------------+
  1506.        Cause:
  1507.        TAS syntax check has encountered a symbol or word that is either
  1508.        misplaced, mis-spelled, or preceded by a word that might be
  1509.        mis-spelled.
  1510.        Recommendation:
  1511.        Check the spelling of the word pointed out and the previous word.
  1512.        Also, check that you are using it in accordance with the
  1513.  
  1514.  
  1515.        TAS       Page 23   
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.        description given in the User's Guide.
  1526.  
  1527.  
  1528.  
  1529.  
  1530.         Special Keys within TAS
  1531.  
  1532.  
  1533.  
  1534.          F1      The F1 key is the HELP Key. This key will cause a help
  1535.                  screen to be display when you press it. The help topic
  1536.                  will be for the current cursor location (i.e., "context
  1537.                  sensitive help").
  1538.  
  1539.          ALT-X   The ALT-X key will exit from TAS to DOS. This will allow
  1540.                  you to do a few things outside of TAS. Because TAS is a
  1541.                  large program, you won't have a a great deal of storage
  1542.                  left when  you exit to DOS. To return to TAS from DOS,
  1543.                  type "EXIT".
  1544.  
  1545.          ALT-M   The ALT-M key will tell you how much memory is available
  1546.                  to TAS and the maximum size used of the SYMBOL TABLE.
  1547.                  This key will also display the amount of EMS memory used
  1548.                  by the program as well as the video display parameters
  1549.                  detected by the program.
  1550.  
  1551.          ESC     The ESC key will always leave the screen or prompt you
  1552.                  are in and  immediately "pop" you back to the previous
  1553.                  menu. If a TAS script is running, a prompt window will
  1554.                  open, asking you if you want to abort the run.
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.                                 Activity Editors
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.        TAS       Page 25   
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.        The following sections will describe each of the activity types
  1660.        along with their editor screens.
  1661.  
  1662.  
  1663.  
  1664.         Scripts - Editing TAS Scripts
  1665.  
  1666.  
  1667.        TAS has a built-in text editor which can be used to create and
  1668.        modify TAS script files. All TAS script files end with the suffix
  1669.        ".TAS".
  1670.  
  1671.        The editor screen will then appear with the contents of the file
  1672.        displayed.
  1673.  
  1674.        If the file is New, you will see a shaded portion after the first
  1675.        empty line in the file. This shaded area is used to show unused
  1676.        lines in the file. To "expand" the file with blank lines, use
  1677.        either the Alt-I key or the INS key as described below.
  1678.  
  1679.        The TAS editor cannot handle lines larger than 78 characters . If
  1680.        the line is longer than that, it will be broken at column 78 and
  1681.        continued onto the next line. If the total length of the line is
  1682.        more than 256 characters, the last part of the line will be lost if
  1683.        the file is saved. You should be aware of this when creating a
  1684.        script in another editor and then using the TAS editor to modify
  1685.        it. An arbitrary "break" at column 76 might cause a word to be
  1686.        split in the middle, thus introducing an error into the script.
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.        Editor Function Keys
  1724.          F1      HELP Key
  1725.                  If you need help with the editor, hit the F1 (Help) Key.
  1726.                  You will see a list of editor commands.
  1727.          F3      Save Script File Key
  1728.                  When you are done with your editing, you can save the
  1729.                  file by hitting the F3 (Save) Key. If you do not want to
  1730.                  save the file, hit the ESC (Abort) Key.
  1731.  
  1732.          F4      Run Script Key
  1733.                  The Run Script key will run the script you are currently
  1734.                  editing without saving it back to its original script
  1735.                  file.     
  1736.                  
  1737.          F5      Check Script Key
  1738.                  If you wish to check your script file for errors in
  1739.                  syntax, press the F5 key. If there are errors in the
  1740.                  script which can be detected by the Check Script
  1741.                  function, an error message showing the type of error
  1742.                  encountered and the line and column number on which the
  1743.                  error occurred will appear in a window at the bottom of
  1744.                  the screen. This window will disappear after a few
  1745.                  seconds or when you hit a key. Then the script file will
  1746.                  be positioned so that the cursor is on the line where the
  1747.                  error was detected. It is usually the case that the error
  1748.                  is somewhere either on that line or on the previous line.
  1749.  
  1750.          F7      Formula Builder Key
  1751.                  One key available in the editor is the Formula Builder
  1752.                  Key. This key will bring up a list of Technical Indicator
  1753.                  functions and Pre-defined Data Arrays. If you select one
  1754.                  of the functions or arrays, the subsequent parameters of
  1755.                  the function (e.g. MOV "Moving Average" requires 3
  1756.                  additional parameters) will be prompted. Enter each
  1757.                  parameter. When you are done, the formula and parameters
  1758.                  will be placed into your script file at the location of
  1759.                  the cursor when you hit F7.
  1760.  
  1761.        Editor Control Keys
  1762.          Alt-R   Rename script file. You will be asked to provide a new
  1763.                  name for the script file. When you save the script, it
  1764.                  will be saved with the new name.
  1765.          Alt-S   Save script file.  The script file will be saved to disk
  1766.                  under the name shown at the top of the edit screen. You
  1767.                  can continue editing the script after it is saved.
  1768.          Alt-I   Insert a new line into the script following the cursor
  1769.                  location.
  1770.          Alt-D   Delete the line containing the cursor.
  1771.          Alt-E   Invoke your own Editor with the current contents of the
  1772.                  file. Once you save your changes from within your own
  1773.                  editor, the modified file will be restored to the builtin
  1774.                  editor with your changes.
  1775.  
  1776.  
  1777.  
  1778.  
  1779.        TAS       Page 27   
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.          INS     Toggle Insert mode. When in insert mode, the cursor is a
  1791.                  large block. Pressing the ENTER  key while in insert mode
  1792.                  will cause a new line to be inserted into the file with
  1793.                  the characters to the right of the cursor on which the
  1794.                  ENTER key was pressed.
  1795.  
  1796.  
  1797.  
  1798.  
  1799.         Selections - Scan and Report
  1800.  
  1801.  
  1802.        Using the Selection activity of TAS, you can create your own report
  1803.        containing up to 7 columns of calculated formulas or data values.
  1804.        In addition, you can use the Condition entry areas (below the
  1805.        Formulas) to specify which conditions must be satisfied for a
  1806.        ticker to be included in the report output.
  1807.  
  1808.        The figure below shows the equivalent of the MetaStock Utility
  1809.        "Rank" option where the first formula is the Current Price ("C" is
  1810.        the Closing Price), the second formula is the 26 day Rate of Change
  1811.        (ROC). The third formula is the 10 day Simple Moving Average of the
  1812.        price. The fourth is the 10 day Simple Moving Average of "F2",
  1813.        where "F2" is the 26 day ROC. Finally, the last formula F5 is the
  1814.        percentage by which the Price is above or below the moving average
  1815.        contained in F3.
  1816.  
  1817.  
  1818.  
  1819.  
  1820.        You can place any formulas or data value in each of the Formula
  1821.        areas. If you hit the F7 key, a list of functions included in TAS
  1822.        will be shown on the screen and you will be prompted for the
  1823.        parameters of the function.
  1824.  
  1825.        The CONDITION entries are used to "select" only those tickers that
  1826.        match all the conditions specified. The conditions are specified in
  1827.        terms of the formulas given above. In the example above, if you
  1828.        only wanted to see tickers whose ROC (Formula 'F2') was greater
  1829.        than 50, then you could set
  1830.          CONDITION 1    F2 > 50
  1831.  
  1832.        Also, if you had another condition, for example the current price
  1833.        of the ticker is greater than $5, you could place that condition as
  1834.        follows
  1835.          CONDITION 2    C > 5
  1836.  
  1837.        and that would select only tickers whose ROC is greater than 50 and
  1838.        whose price is greater than 5.
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.        Selection Run Options
  1858.        The OPTION Key (F5) allows you to set options for the SELECTION,
  1859.        such as the MAXIMUM QUOTES to read, and any INDEX file you might
  1860.        want to use. Be sure to use the F3 key (SAVE) if you are in the
  1861.        OPTION screen to save your options.
  1862.  
  1863.  
  1864.        Index Ticker
  1865.        If you want to run a profit test that uses some index, such as the
  1866.        SP-500, you can specify the ticker here. Then, in your profit test,
  1867.        you refer to the index ticker's value with the INDEX array name.
  1868.  
  1869.        Maximum Quotes
  1870.        You can specify the maximum number of quotes to load for the profit
  1871.        test. This number should be less than or equal to the Maximum
  1872.        Quotes per Symbol setting in your Configuration Menu.
  1873.  
  1874.  
  1875.        Start Date
  1876.        If you want to start your test on a specific date, specify that
  1877.        date here. Make sure that the date is a date you have in the file.
  1878.        If it is not, the test will begin on the first date prior to that
  1879.        date.
  1880.  
  1881.        End Date
  1882.        If you want to end your test on a specific date, specify that date
  1883.        here. Make sure that the date is one you have in the file. If it is
  1884.        not, the test will end on the first date prior to the end date.
  1885.  
  1886.        Running Your Selection
  1887.        Once your SELECTION is built, you can run it using the F4 Key. You
  1888.        will be asked for a TICKER LIST against which to run the SELECTION.
  1889.        Choose one.
  1890.  
  1891.        Once the SELECTION starts running, there is no output to the main
  1892.        part of the screen until the SELECTION completes. At that point, a
  1893.        "report" will display on your screen with the TICKER in the first
  1894.        column and the formula values you set up for F1 through F7 in each
  1895.        column.
  1896.  
  1897.  
  1898.        Sorting on Selected Columns
  1899.        You can SORT your report by the contents of any column by typing
  1900.        the ALT key at the same time as you hold down the number over the
  1901.        column you want to sort on.
  1902.  
  1903.        For example, to sort on the contents of the column next to TICKER
  1904.        (this would be column numbered "2"), you would type ALT-2 key pair.
  1905.        If you want to change the order of the sorting from ascending order
  1906.        to descending order, type ALT-D (for "Descending"). To go back to
  1907.  
  1908.  
  1909.  
  1910.  
  1911.        TAS       Page 29   
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.        ascending order, type ALT-A. Once you have set the sorting
  1923.        direction, you can then resort using a ALT-column_number again.
  1924.  
  1925.  
  1926.        Printing Your Selection Report
  1927.        To PRINT the contents of your report in the current sort order,
  1928.        type ALT-P. If you want to print to a file, enter a file name.
  1929.  
  1930.  
  1931.  
  1932.         To print to your PRINTER, type LPT1 or PRN (or whatever address
  1933.         your printer is hooked up to) in the file name prompt.
  1934.  
  1935.  
  1936.  
  1937.        Creating a Ticker List
  1938.        If you want to create a ticker list from the securities selected,
  1939.        you can press the Alt-T key combination. You will be prompted for
  1940.        the name of the ticker list to be created.
  1941.  
  1942.        Errors In Selection Formulas
  1943.        If you have any errors in the SELECTION you have created, you will
  1944.        be told about them when you try to run the SELECTION. An error
  1945.        message  will be displayed and then the TAS EDITOR will be run with
  1946.        a dummy file called _RUNSEL.TAS. This file is the file that is
  1947.        created from your SELECTION. It is a special form of a TAS script.
  1948.        You should recognize the formulas though, since they are the ones
  1949.        you entered in your SELECTION.
  1950.  
  1951.        The EDIT screen will redisplay the error message and the ex-
  1952.        planation of the error at the bottom of the screen. Hit the ESC key
  1953.        and the cursor will be placed near the place where the error was
  1954.        found. In addition, the error message will be placed in the file to
  1955.        the right of the line in error. Look at the formula or condition
  1956.        and try to figure out what the problem is.
  1957.  
  1958.        You are only half done though. Now you have to go back to your
  1959.        SELECTION Editor screen (by typing ESC) and fix the formula(s) in
  1960.        that screen. Do not try to fix the problem in the Script Editor
  1961.        screen, since this is just a temporary view of the actual Selection
  1962.        file. Once you have corrected the error in the Selection screen, be
  1963.        sure to save (by hitting F3) your file.
  1964.  
  1965.  
  1966.  
  1967.         Profit Tests - Test a system
  1968.  
  1969.  
  1970.        The Profit Test activity editor screen is similar in appearance  to
  1971.        the  Selection editor screen. Shown below is a sample of the Profit
  1972.        Test Modification screen.
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.        You can fill in the FORMULAs (F1 to F8) with indicators (or
  1990.        combinations of indicators) you want to 'plot' for the profit test.
  1991.        Then, in the CONDITION entry areas (COND C1 to C6), you fill in
  1992.        conditions you would use in a BUY, SELL or STOP loss signal.
  1993.  
  1994.        To switch between Formulas, Conditions, and When screens, use the
  1995.        F6 function key.
  1996.  
  1997.        Once you have entered your FORMULAS and the CONDitions, you can
  1998.        choose which conditions you want to use for the BUY, SELL and STOP
  1999.        signals.
  2000.  
  2001.        In the example above, only RSI(14) is being plotted. The condition
  2002.        C1 tests to see if the RSI has crossed from below 30 to above 30
  2003.        (Buy Signal). Condition C2 tests if the RSI has crossed from above
  2004.        70 to below 70 (Sell Signal). Notice how C1 is entered below BUY
  2005.        WHEN, indicating the Profit Tester should buy if condition C1 is
  2006.        true (and the stock is not already held). And, then C2 is below
  2007.        SELL WHEN, indicating a similar SELL strategy.
  2008.  
  2009.        Profit Test Options
  2010.  
  2011.        Profit Test has a number of options which are set by hitting the F5
  2012.        Function Key in this screen. You will see the following screen.
  2013.        Each of the items in bold represent one of several choices
  2014.        available for the option.
  2015.  
  2016.  
  2017.        When you bring up this screen, you can choose options by using the
  2018.        TAB key to move to each field and selecting the appropriate option.
  2019.        Type the HELP Key (F1) at each field to see the meaning of the
  2020.        choices. When you are done with changes to this screen, hit the F3
  2021.        key to save the options. If you are in a "pop-up" window, hit
  2022.        ENTER, then hit F3.
  2023.  
  2024.  
  2025.        Profit Test Option Settings
  2026.  
  2027.        Initial Cash
  2028.        This is the amount of "money" the trading should start with. It
  2029.        must be sufficient to buy the amount of shares specified by the
  2030.        Share Purchase option below. For example, if you start with $1,000
  2031.        and you are buying Round Lots (100 shares), your stock had better
  2032.        not sell for more than $10 per share or you won't have enough money
  2033.        to buy a round lot.
  2034.  
  2035.        Test Type
  2036.        There are 3 choices for this option. You can perform a LONG ,
  2037.        SHORT or BOTH test.
  2038.        A LONG test only takes long positions, that is, it only buys to
  2039.        open a position and sells to close it.
  2040.  
  2041.  
  2042.  
  2043.        TAS       Page 31   
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.        A SHORT test only takes short positions, selling to open and buying
  2055.        to close ("cover") the position.
  2056.  
  2057.        A BOTH test opens a long or short position and reverses each time a
  2058.        signal is generated to "go the other way". This is essentially a
  2059.        "stop and reverse" system.
  2060.  
  2061.        Commissions
  2062.        You can use several commission structures for your simulated
  2063.        trading. The commissions for Charles Schwab,  OLDE Discount, and
  2064.        PCFN brokerages are built into the profit tester. These commissions
  2065.        are accurate as of 1/1/91. You can also specify a percentage
  2066.        commission amount  for each trade. Finally, you can ignore
  2067.        commissions altogether.
  2068.  
  2069.        Share Purchases
  2070.        You can elect to purchase shares of the security in either Round
  2071.        Lots or using all available cash. If you choose round lots, your
  2072.        profit test will purchase or sell stocks in groups of 100. This is
  2073.        important if you are using a real commission schedule, since the
  2074.        commission per share is reduced when you trade in round lots.
  2075.  
  2076.  
  2077.        Price Slippage
  2078.        Price Slippage refers to the price at which you want to exercise
  2079.        the trade. Generally, you cannot execute a trade at the exact price
  2080.        you want, nor can you always trade at the previous day's closing
  2081.        price. So, you have several options for choosing the trade price.
  2082.  
  2083.             Price Slippage  Meaning
  2084.             Type
  2085.              0 - TODAYS     Today's
  2086.             CLOSE           closing price
  2087.              1 - NEXT       Tomorrow's
  2088.             AVERAGE         (High+Low+Clos
  2089.                             e)/3
  2090.              2 - NEXT OPEN  Tomorrow's
  2091.                             Open Price
  2092.              3 - NEXT       Tomorrow's
  2093.             CLOSE           Close Price
  2094.              4 - NEXT HIGH  Tomorrow's
  2095.                             High Price
  2096.              5 - NEXT LOW   Tomorrow's Low
  2097.                             Price
  2098.  
  2099.        The prices at which the BUY, SELL and STOP transactions occur are
  2100.        obtained from the choices given on the Profit Test Build Options
  2101.        screen. There are several choices, one of which is to buy at the
  2102.        close for the prior day. This is the default. If you have OPEN
  2103.        data, you should choose the option to buy at the OPEN price. If
  2104.        not, then you can choose an average of the price range, or several
  2105.        other choices.
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.        Just to elaborate on the profit testing, suppose on day 2/15/90,
  2120.        your buy signal is reached..in other words, the BUY WHEN is true.
  2121.        The price at which your buy is made is most accurately at the OPEN
  2122.        of the next day (since you
  2123.        are using CLOSING data for your test up to 2/15/90, you wouldn't
  2124.        have been able to really buy at the CLOSE for 2/15/90). If you
  2125.        don't have OPEN data, you can use some other choice from the prices
  2126.        on 2/16, the following day.
  2127.  
  2128.        But, in every case, the actual BUY takes place on 2/16/90, the day
  2129.        following the date the signal was given (can't buy after the
  2130.        close).
  2131.  
  2132.  
  2133.        Output File Name
  2134.        If you want the output report from the profit test to go to a file,
  2135.        specify the name here.
  2136.  
  2137.        Report Detail
  2138.        There are three choices for this option: DETAIL, TICKERSUMMARY, and
  2139.        TOTALSUMMARY.
  2140.  
  2141.           DETAIL           Show every trade
  2142.           TICKERSUMMARY    Show totals for
  2143.                            each ticker
  2144.           TOTALSUMMARY     Show totals only
  2145.                            for all tickers
  2146.  
  2147.  
  2148.        Maximum Quotes
  2149.        You can specify the maximum number of quotes to load for the profit
  2150.        test. This number should be less than or equal to the Maximum
  2151.        Quotes per Symbol setting in your Configuration Menu.
  2152.  
  2153.        Index Ticker
  2154.        If you want to run a profit test that uses some index, such as the
  2155.        SP-500, you can specify the ticker here. Then, in your profit test,
  2156.        you refer to the index ticker's value with the INDEX array name.
  2157.  
  2158.        Reinvest Profits
  2159.        This option determines how much money you want the profit tester to
  2160.        use for each trade.
  2161.        If you specify "Y", the profit test will use your current cash po-
  2162.        sition, including profits, minus losses and commissions to de-
  2163.        termine how much money you have available to trade.
  2164.        If you specify "N", the profit tester will initiate each trade with
  2165.        the same amount of cash, regardless of your prior profits, losses
  2166.        or commissions.
  2167.  
  2168.        Start Date
  2169.        If you want to start your test on a specific date, specify that
  2170.        date here. Make sure that the date is a date you have in the file.
  2171.        If it is not, the test will begin on the first date prior to that
  2172.        date.
  2173.  
  2174.  
  2175.        TAS       Page 33   
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.        End Date
  2186.        If you want to end your test on a specific date, specify that date
  2187.        here. Make sure that the date is a date you have in the file. If it
  2188.        is not, the test will begin on the first date prior to that date.
  2189.  
  2190.        Running the Profit Test
  2191.        To run the Profit Test hit the F4 key (once you leave the Options
  2192.        screen). If you want to save the Profit Test formulas, save it with
  2193.        the F3 key and then reselect it to run it.
  2194.  
  2195.        Errors In Profit Test Formulas
  2196.        If you have any errors in the Profit Test you have created, you
  2197.        will be told about them when you try to run the PROFIT TEST. An
  2198.        error message  will be displayed and then the TAS EDITOR will be
  2199.        run with a file called _RUNPT.TAS. This file is the file that is
  2200.        created from your PROFIT TEST. It is a special form of a TAS
  2201.        script. You should recognize the formulas though, since they are
  2202.        the ones you entered in your PROFIT TEST.
  2203.  
  2204.        The EDIT screen will redisplay the error message and the ex-
  2205.        planation of the error at the bottom of the screen. Hit the ESC key
  2206.        and the cursor will be placed near the place where the error was
  2207.        found. In addition, the error message will be placed in the file to
  2208.        the right of the line in error. Look at the formula or condition
  2209.        and try to figure out what the problem is.
  2210.  
  2211.        Now you have to go back to your Profit Test Editor screen (by
  2212.        typing ESC) and fix the formula(s) in that screen. Do not try to
  2213.        fix the problem in the Script Editor screen, since this is just a
  2214.        temporary view of the actual Selection file. Once you have
  2215.        corrected the error in the Profit Test screen, be sure to save (by
  2216.        hitting F3) your file.
  2217.  
  2218.  
  2219.  
  2220.         The file that is built when you create (or modify) a Profit Test
  2221.         has a special file extension ".PTS" (Profit Test Script). This
  2222.         file has a special format that can be read by the Build/Run
  2223.         Profit Test menu. If you go in with an editor and change any
  2224.         part of the .PTS file, it is very likely that the .PTS file WILL
  2225.         NO LONGER WORK when you pull it up into the Profit Test screen.
  2226.         If you want to change a .PTS file, copy it to a file .TAS file
  2227.         name and edit that file. Once you do that, you have to run the
  2228.         file as a TAS SCRIPT, not a Profit Test.
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.         Ticker Lists - Group Securities
  2256.  
  2257.  
  2258.        You can create "ticker lists" with TAS. A "ticker list" is a list
  2259.        of stock or ticker symbols which you can name as a group. This
  2260.        allows you to create individualized lists of symbols against which
  2261.        you can run your TAS scripts. As an example, you could create a
  2262.        ticker list containing the Dow Jones 30 Industrials, or a list
  2263.        containing only stocks you hold.
  2264.  
  2265.        When you choose the Ticker List/Edit activity item, the Ticker List
  2266.        screen will appear with all the ticker symbols contained in the
  2267.        Data Directories you have configured. Each symbol that is
  2268.        highlighted in YELLOW has been "selected" for inclusion in the
  2269.        ticker list. To select or unselect a symbol, move the cursor to the
  2270.        symbol and hit the SPACE Bar. If the symbol is selected, it becomes
  2271.        unselected or vice versa.
  2272.  
  2273.  
  2274.  
  2275.        If you want to Select All Tickers, hit the F9 (SELECT ALL) Key.
  2276.  
  2277.        To Unselect All Tickers, hit the F8 (UnSELECT ALL) Key.
  2278.  
  2279.        Once you have created the ticker list, hit the F3 (Save) Key to
  2280.        save it. If you do not want to save the list, hit the ESC (Abort)
  2281.        Key.
  2282.  
  2283.        If you want to run a TAS script against all of your data, create a
  2284.        new Ticker List called "ALL". Hit the F9 Key to select all symbols.
  2285.        Then hit the F3 Key to save the list.
  2286.  
  2287.  
  2288.         If you have set the Setup/Program Options option Include Ticker
  2289.         Period to "Yes", your ticker names will be followed by a slash
  2290.         and the period of the file, e.g. "AAPL/D" for APPLE COMPUTER
  2291.         Daily data. The period is not available with ChartPro data
  2292.         files.
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.        TAS       Page 35   
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.                                     Setup TAS
  2321.  
  2322.        The Setup Menu is used to tell TAS the location of your Data
  2323.        Directory(ies), your specific program options, and where TAS is to
  2324.        look for each activity file type. Up to fifteen directories can be
  2325.        defined on the Configuration Menu, and up to forty directories can
  2326.        be added if needed.
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.         Data Directories
  2333.  
  2334.  
  2335.        The Data Directory menu choice presents a panel that appears as
  2336.        shown below:
  2337.  
  2338.        You should fill in the names of your Historical Data Directories,
  2339.        one per line.  Next to each directory name, choose the directory
  2340.        format type from the pick list that appears when you tab or move
  2341.        over to the field to the right of the name.
  2342.        If all your historical data directories are subdirectories of a
  2343.        common higher leveled directory, you can use the Setup/File
  2344.        Directories/Historical Data (page 39) setup option to save yourself
  2345.        some work. Go to that menu item first, fill in the full path name
  2346.        to the higher level directory, and then save that setting. Then,
  2347.        when you enter the directory names in this panel, you need not
  2348.        specify the path up to the point of your subdirectory.
  2349.        For example, if you have the directories
  2350.          D:\MS\DATA1
  2351.          D:\MS\DATA2
  2352.          D:\MS\DATA3
  2353.        you would place "D:\MS" in your Setup/File Directories/Historical
  2354.        Data setting. Then, in this panel, you would only need to enter
  2355.          DATA1
  2356.          DATA2
  2357.          DATA3
  2358.        If you do not use the procedure above, be sure to include the full
  2359.        path name, including the first backslash character and the drive
  2360.        identification if necessary for each directory you enter in this
  2361.        panel.
  2362.        If you have more than one directory of data files, you can enter
  2363.        the other directory names on the second thru fifteenth lines.
  2364.        Next to the data directory name, choose the historical data format
  2365.        for the data.  Press the first letter of the data format choice and
  2366.        then hit the Enter key to select it.
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.         Program Options
  2389.  
  2390.  
  2391.        The Program Options menu item opens a new menu which can be used to
  2392.        modify settings used within TAS.
  2393.  
  2394.  
  2395.        Include Ticker Period
  2396.        If you only have one type of data file (Daily or Weekly or
  2397.        Monthly), you should leave this value set at "No".
  2398.  
  2399.        Otherwise, this parameter should be set to "Yes" if you have
  2400.        multiple tickers with the same ticker symbol but different
  2401.        "periods". For example, if you have a DAILY and a WEEKLY file for
  2402.        the symbol AAPL, you will need to set this value to "Yes" in order
  2403.        to distinguish between the daily and weekly ticker files.
  2404.  
  2405.  
  2406.         If you have TICKER LISTS created with this value set to "Yes",
  2407.         they will not work if you change this value to "No" (and vice
  2408.         versa). You will have to re-select the tickers again. TAS is
  2409.         distributed with this value unset (which means "No"). Note also,
  2410.         that if you have this value set to "Yes", you must include the
  2411.         ticker file period in every reference to a ticker name,
  2412.         including references on the #INDEX command.
  2413.  
  2414.  
  2415.  
  2416.  
  2417.        Symbol Table Size
  2418.        The Symbol Table Size parameter is a "tuning" value which
  2419.        determines the size of the internal tables for TAS. You may need to
  2420.        increase the value if you write a particularly long or complex
  2421.        selection script. If you specify any value less than 9000, TAS will
  2422.        use 9000 as the value.
  2423.        It is recommended that you set this value at 32000 or more.
  2424.  
  2425.  
  2426.         If you want to see the amount of SYMBOL TABLE your TAS scripts
  2427.         are using, you can type the ALT-M key to display the memory
  2428.         usage of TAS. One of the values shown is the maximum Symbol
  2429.         Table Size used so far.
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.        TAS       Page 37   
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.        Quotes Per Symbol
  2450.        The QUOTES PER SYMBOL parameter specifies how many quotes you want
  2451.        TAS to read into memory when performing the selection. The higher
  2452.        this number, the longer the selection will take.
  2453.        See the section below under Use EMS Arrays for the effect of this
  2454.        setting on the usage of EMS memory and processing time.
  2455.  
  2456.  
  2457.         This parameter has a very significant impact on the processing
  2458.         time that TAS uses for each symbol. It should be set to as low a
  2459.         value as possible (based on the time periods you use in your
  2460.         indicators) so that the TAS processing is minimized.
  2461.  
  2462.  
  2463.  
  2464.        Use EMS Arrays
  2465.        If you have EMS (Expanded Memory) or XMS (eXtended Memory)
  2466.        installed with suitable driver software2, you can set this value to
  2467.        Y to take advantage of the extra memory you have above the 640K DOS
  2468.        limit.
  2469.  
  2470.        TAS will automatically determine if you have EMS memory installed,
  2471.        and if so, it will always use that memory for a "swapping area",
  2472.        reducing the amount of disk reads required to run the program.
  2473.  
  2474.        In addition, if you set this parameter to Yes, and you have re-
  2475.        quested more arrays or set  Quotes per Symbol high enough so that
  2476.        product of all the array sizes times the number of arrays needed is
  2477.        greater than the amount of  memory available in the DOS  640K
  2478.        region, TAS will swap arrays into and out of EMS memory. This
  2479.        swapping of arrays can slow TAS processing somewhat, but it allows
  2480.        you to set Quotes per Symbol to a maximum value.
  2481.  
  2482.        Editor Command
  2483.        If you have your own preferred ASCII editor that you would rather
  2484.        use than the TAS editor, you can use it instead for editing script
  2485.        files. To inform TAS that you have your own editor, specify the
  2486.        editor's file name in this item. For example, if your editor is
  2487.        MYEDIT.EXE, you would specify that full name in the Editor Command
  2488.        entry. Now, it is important that the editor program directory be in
  2489.        the DOS PATH variable so that it can be found by TAS.
  2490.  
  2491.        Chart Command
  2492.        If you want to use your own Charting program, such as Metastock,
  2493.        from within TAS, you can define the program name in this entry. For
  2494.        MetaStock, you would say "MS.EXE".
  2495.  
  2496.        ____________________
  2497.        2 Most systems today do not actually have EMS memory., but instead
  2498.         have Extended Memory (XMS), the kind that is built-in to new 386
  2499.         and 486 systems. The term EMS actually refers to a
  2500.         software/hardware standard that is emulated by driver programs
  2501.         from various vendors, such as QuarterDeck Office Systems (QEMM and
  2502.         DesqView/386) as well as Microsoft's EMM386 program.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.        Because some charting programs require that they be invoked from
  2516.        their own directory, you might need to set the Chart Program
  2517.        Directory in the File Directories menu (see page 40)
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.         File Directories
  2524.  
  2525.  
  2526.        The File Directories menu enables you to set default directory
  2527.        locations for the various types of  files that TAS will access.
  2528.        This is not required, but you might find it neater to separate your
  2529.        scripts from you selections from profit tests, etc.
  2530.        In addition, by using the Historical Data Directory, you can define
  2531.        a top level directory for your data files without re-entering the
  2532.        directory names into the Data Directory section of  the Setup Menu.
  2533.  
  2534.  
  2535.        Script Directory
  2536.        This is the directory that will be accessed when you specify a
  2537.        script name without a directory qualifier.
  2538.  
  2539.        Selection Directory
  2540.        This is the directory that will be accessed when you specify a
  2541.        selection without a directory qualifier.
  2542.  
  2543.        Profit Test Directory
  2544.        This is the directory that will be accessed when you specify a
  2545.        profit test without a directory qualifier.
  2546.  
  2547.        Ticker List Directory
  2548.        This is the directory that will be accessed when you specify a
  2549.        ticker list without a directory qualifier.
  2550.  
  2551.        Output Files
  2552.        This is the directory in which your listing files will be placed in
  2553.        the absence of a directory name on the #OUTPUT_FILE specifier.
  2554.  
  2555.        ASCII I/O Directory
  2556.        This is the directory where the AOpen  (ASCII File Open) function
  2557.        looks for the file being opened.
  2558.  
  2559.        Historical Data Directory
  2560.        This is the "top level" directory for your historical data files.
  2561.        For example, if your data files are subdirectories of  "D:\MS", you
  2562.        could specify "D:\MS" here and then only specify the subdirectory
  2563.        name in the Data Directory Setup screen.
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.        TAS       Page 39   
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.        Chart Program Directory
  2582.        The Chart Program directory is used to tell TAS the drive and
  2583.        directory where your charting program is located. This is used in
  2584.        conjunction with the Chart Command setting (page 38).
  2585.  
  2586.  
  2587.  
  2588.  
  2589.         Printer Setup
  2590.  
  2591.  
  2592.        In order to use the PrintGraph function or the "P" key while
  2593.        displaying a graph to print a graph with TAS,  you need to prepare
  2594.        TAS with the Printer Setup screen. The values you need to set are
  2595.        described below.
  2596.        For additional information on Printer Device Support, see page 80.
  2597.        Each of the fields on the Printer Setup menu are toggled by hitting
  2598.        the SPACE or ENTER key to select the next option available. Once
  2599.        all options have been set correctly, hit the F10 key to save the
  2600.        settings.
  2601.  
  2602.        Printer Type
  2603.        The Printer Type field describes the printer or printer capture
  2604.        file to which you want to send your PrintGraph output. The choices
  2605.        are shown in the table beginning on page 80.
  2606.  
  2607.        Printer Port
  2608.        Choose the printer port to which your printer is attached. If you
  2609.        intend to create PCX or EPS files rather than printing directly to
  2610.        your printer, set this field to None.
  2611.  
  2612.        Resolution
  2613.        Choose a resolution from Low to High.
  2614.  
  2615.        Orientation
  2616.        The orientation choice is either Portrait or Landscape. Portrait
  2617.        orientation will print the graph with the shorter side of the paper
  2618.        at the top of the graph. Landscape is usually better for graph
  2619.        printing.
  2620.  
  2621.        Page Size
  2622.        Specify Quarter, Half, or Full. TAS prints as many graphs per page
  2623.        as you specify in this setting. If you specify Quarter, TAS will
  2624.        print four graphs on a single page.
  2625.  
  2626.        Reverse
  2627.        The Reverse setting is either Yes or No. Unless you wish to print
  2628.        most of the graph in black, you should choose No. If your printer
  2629.        type is set to PCXxxxx, you should specify Yes for this setting to
  2630.        get a white background.
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.         Register Program
  2649.  
  2650.  
  2651.        When you register TAS , you will receive a Registration Code based
  2652.        on your Name. Whatever name you include in the file REGISTER.DOC
  2653.        will be used to form an encrypted code. Use the same name as sent
  2654.        in the  REGISTER.DOC file. Place the Registration Code sent to you
  2655.        in the appropriate field.
  2656.        If you received an invoice with your TAS order, your name as it is
  2657.        expected to be entered, is shown on the invoice. You must use the
  2658.        same upper and lower case settings as shown on the invoice for your
  2659.        name to match the coded registration code.
  2660.  
  2661.  
  2662.  
  2663.         Save Configuration
  2664.  
  2665.  
  2666.        Use this command (or the F10 key) to save any changes you have made
  2667.        to your configuration when in the Setup menu.
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.        TAS       Page 41   
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.                                     Utilities
  2714.  
  2715.  
  2716.  
  2717.  
  2718.        The Utilities menu is used to access functions outside of TAS. You
  2719.        can use this menu to switch to DOS, view a file, or run your own
  2720.        charting program.
  2721.        The Utilities menu appears as shown below:
  2722.  
  2723.  
  2724.  
  2725.         DOS Shell
  2726.  
  2727.  
  2728.        The DOS Shell command can bring up a DOS shell from which you can
  2729.        return to TAS by typing EXIT. This command will only work if you
  2730.        have at least 128Kb free memory available while in TAS.
  2731.  
  2732.  
  2733.  
  2734.         Run Chart Program
  2735.  
  2736.  
  2737.        Once you have setup your chart command (page 38) and your Chart
  2738.        Directory (page 40), you can use this menu item to invoke your
  2739.        chart program. When you exit from that program, you will be
  2740.        returned to TAS.
  2741.  
  2742.  
  2743.  
  2744.         View A File
  2745.  
  2746.  
  2747.        If you want to view any file (smaller than 64Kb), you can use this
  2748.        menu item. Choose the file you want to view from the list which
  2749.        appears when you select this item. To return from View Mode, use
  2750.        the ESC key.
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.                               TAS Script Processing
  2780.  
  2781.        TAS reads each security name in the TICKER LIST from the historical
  2782.        data file. It reads the quotes for the file into the pre-defined
  2783.        data arrays up to the lower of either (1) the number specified in
  2784.        the QUOTES PER SYMBOL (in the Configure TAS Menu) (2) the number
  2785.        specified in #MAX_QUOTES in the script file itself,  (3) all the
  2786.        quotes in the file, or (4), the number of quotes between the
  2787.        SCAN_DATE or Start Date and End Date.
  2788.  
  2789.        Once all the price history has been read into the data arrays, TAS
  2790.        "executes" the statements in the TAS script file. Once all
  2791.        statements in the file have been executed, TAS moves on to the next
  2792.        security's symbol in the TICKER LIST.
  2793.  
  2794.        This process continues until all the symbols in the TICKER LIST
  2795.        have been read or until an error is encountered in the script file.
  2796.  
  2797.  
  2798.  
  2799.         The order in which TAS processes the securities in the ticker
  2800.         list is in the order in which the security files are found in
  2801.         the Metastock directories or in the Chartpro directories, not
  2802.         the order of the ticker list.
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.        TAS       Page 43   
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.                                TAS Script Language
  2846.  
  2847.        The TAS Script Language makes it possible for you  to tell TAS what
  2848.        you want to look for, compute, print, graph, and test. TAS scripts
  2849.        are simply text files that contain statements of what you want the
  2850.        program to do. These files can then be run to perform specific
  2851.        searching or computational tasks.
  2852.  
  2853.        The choices made in the way you  tell TAS to do something are what
  2854.        can be called the "syntax" or grammar of the Script language.  In a
  2855.        way, this language is similar to English, where you would say "If a
  2856.        is greater than b then tell me about it", except, as you will see,
  2857.        TAS also has abbreviations for relationships like "is greater
  2858.        than". Other than that, however, the language can be read like
  2859.        English and algebraic notation combined. The following topics will
  2860.        give an explanation of the TAS script language.
  2861.  
  2862.        The TAS package contains numerous examples of TAS Scripts. You
  2863.        should print them and look at them while reading the next section.
  2864.        The sample scripts contain "comments" which explain what the script
  2865.        is doing at each point of the script.
  2866.  
  2867.  
  2868.  
  2869.         Syntax
  2870.  
  2871.  
  2872.        In the subsequent discussion, the word "statement" is used. A
  2873.        "statement" is like a sentence in English. Like a sentence, it is
  2874.        composed of "words".
  2875.  
  2876.        A semi-colon (;) is generally used to tell TAS that the statement
  2877.        you just entered is done. Every statement should be terminated by a
  2878.        semi-colon, though TAS does not enforce this rule in every case.
  2879.  
  2880.        In the syntax descriptions below, words you must use are in UPPER
  2881.        CASE, and parts of the statement that are up to you are in lower
  2882.        case.
  2883.  
  2884.  
  2885.  
  2886.         Building Blocks
  2887.  
  2888.  
  2889.        The "Building Blocks" of TAS scripts are the following types of
  2890.        items:
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.          Variables
  2912.                  Variables are where you put values or, in the case of
  2913.                  "pre-defined" variables, where you get them. The names
  2914.                  are anything you choose, but they have to start with a
  2915.                  letter of the alphabet and must consist of characters
  2916.                  from the following set {A to Z, 0 to 9, and underscore}.
  2917.                  Other characters are not allowed in the variable name.
  2918.  
  2919.          Assignment Statement
  2920.                  The ASSIGNMENT statement ("=") is how you can move a
  2921.                  value from one place to another.
  2922.  
  2923.          Arithmetic Operators
  2924.                  These are the usual ADD(+), SUBTRACT (-), MULTIPLY(*) and
  2925.                  DIVIDE(/) and EXPONENTIATION (^).
  2926.  
  2927.          Functions
  2928.                   A "function" is a built-in TAS technical indicator ,
  2929.                  math function, or "output" function which usually returns
  2930.                  a value.
  2931.  
  2932.          IF statement
  2933.                  An "IF" statement is used to test a condition or value.
  2934.                  Once the condition is tested, you can perform certain
  2935.                  actions "if" it is TRUE or "if" it is false.
  2936.  
  2937.          WHILE statement
  2938.                  The WHILE statement is used to control the execution of a
  2939.                  sequence of instructions that need to be repeated until
  2940.                  some condition is false.
  2941.          FOR statement
  2942.                  The FOR statement is used to describe the values to be
  2943.                  used for a "loop" or sequence of statements that need to
  2944.                  be executed a certain number of times.
  2945.  
  2946.          BEGIN-END Blocks
  2947.                  A BEGIN-END block is a way to "group" several statements
  2948.                  into one. For example, the IF statement only allows you
  2949.                  to execute the following "statement". However, if you use
  2950.                  a BEGIN followed by multiple statements, followed by an
  2951.                  END, the whole series of statements from the BEGIN
  2952.                  through the END is considered to be ONE statement. It is
  2953.                  similar to putting parentheses around an arithmetic ex-
  2954.                  pression.
  2955.  
  2956.          Logical AND
  2957.                  The AND word takes a left-hand side and a right-hand
  2958.                  side. If both are TRUE, the whole is TRUE.
  2959.  
  2960.          Logical OR      
  2961.                  The OR word also has a left and right side. If either is
  2962.                  TRUE, the whole is TRUE.
  2963.  
  2964.  
  2965.  
  2966.  
  2967.        TAS       Page 45   
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.          Relational Operators
  2979.                  These are how you test the "relation" between two values.
  2980.                  The English language form of the operators and the
  2981.                  symbolic form for the operators are shown in the table
  2982.                  below. You may use either form for expressing an equality
  2983.                  or inequality relationship.
  2984.          
  2985.             English Language
  2986.             Keyword form
  2987.                                Symbolic
  2988.                                form
  2989.             EQUAL
  2990.                                =
  2991.             GREATER THAN
  2992.                                >
  2993.             GREATER THAN OR
  2994.             EQUAL
  2995.                                >=
  2996.             LESS THAN
  2997.                                <
  2998.             LESS THAN OR EQUAL
  2999.                                <=
  3000.             NOT EQUAL
  3001.                                <>
  3002.  
  3003.          Comments
  3004.                  These are used to "document" the TAS script. They perform
  3005.                  no function, but only help to understand what is going on
  3006.                  in the general area of the script. They are good to use
  3007.                  and should be included in the script to make it easier to
  3008.                  understand.
  3009.  
  3010.        Variables
  3011.        A Variable  is a name given to a "place" to put a "value". Think of
  3012.        it as a "name for a value"3.
  3013.        Except for pre-defined variables (see page 58) you can make up the
  3014.        names for the variables in your script.
  3015.  
  3016.        A variable name must start with an alphabetic letter, contain only
  3017.        letters, numbers and underscores ("_"). Some valid names are:
  3018.  
  3019.             my_stuff, my_122999, my999, m9, M32_togo, Beethoven, etc
  3020.  
  3021.        Generally, you first use variables in "assignment statements", that
  3022.        is, you first "put" something into them. Subsequently, you can use
  3023.        them as values passed to functions or another statement such as an
  3024.        IF statement or a WHILE statement.
  3025.        ____________________
  3026.        3 The variable names are anything you choose, but they have to
  3027.         start with a letter of the alphabet and must consist of characters
  3028.         from the following set {A to Z, 0 to 9, and underscore}. Other
  3029.         characters are not allowed in the variable name.
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.        Creation of Variables
  3046.        TAS variables are created in one of two ways. You can "declare"
  3047.        them before using them, as you must do with ARRAY's, or you can
  3048.        just assign some value to them.
  3049.  
  3050.        TAS Variable Types
  3051.  
  3052.        "String" Variables
  3053.        These are variables to hold text information, like 'IBM', or 'THIS
  3054.        IS A STICK-UP'.  String variables must be surrounded by single-
  3055.        quote (') characters.  String variables can be different lengths,
  3056.        depending on what you put into them. They can contain blanks at the
  3057.        end of the variable, which you may need to remove with the TRIM
  3058.        function.
  3059.  
  3060.        "Numeric" Variables 
  3061.        These are variables that hold numbers, like 32, or -75.69, or
  3062.        10000034.
  3063.  
  3064.        There are two types of numeric variables, INTEGERS and REAL
  3065.        numbers. An INTEGER is a number which has no decimal point and must
  3066.        be smaller than 32,767 in value.
  3067.  
  3068.  
  3069.  
  3070.         An INTEGER can be NO LARGER THAN 32,767 in value. If you need to
  3071.         use a number larger than 32,767 then you must include a decimal
  3072.         point followed by at least one zero in the number. For example,
  3073.         if you want to use the number 1 million in your script, you
  3074.         cannot say 10000000 because the number is larger than 32,767 and
  3075.         it does not contain a decimal point. In this case, you must say
  3076.         1000000.0 to tell TAS that the number is a REAL number.
  3077.  
  3078.  
  3079.  
  3080.        "Numeric Array" Variables
  3081.        These are variables that hold many numbers in an "array"  (or
  3082.        collection of numbers). All of the numbers in the array have the
  3083.        same variable name; however, you cannot "look" at them all at once.
  3084.        You must pick out one of the numbers of the array by specifying its
  3085.        "location" in the array.
  3086.  
  3087.        Each array has exactly QUOTE_COUNT entries. The variable
  3088.        QUOTE_COUNT is "filled in" by TAS when the script runs for the
  3089.        ticker file.  Given a ticker that has 100 quotes (or the maximum
  3090.        number of quotes to load, MAX_QUOTES, set to 100) the following
  3091.        indices are usable for any array in the ticker file:
  3092.          
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.        TAS       Page 47   
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.             English    Index   Index
  3110.             Language  Relativ  Relativ
  3111.             Index      e to    e to
  3112.                        Today   First
  3113.                                Day
  3114.             Today     0        100
  3115.             Yesterday -1       99
  3116.             2 Days    -2       98
  3117.             Ago
  3118.             3 Days    -3       97
  3119.             Ago
  3120.             .........  .....    .....
  3121.             .........
  3122.                ..
  3123.             99 Days   -99      1
  3124.             Ago
  3125.  
  3126.        An example of an array that is always available when a ticker is
  3127.        processed is the Closing Price array,"C". Obviously, there are many
  3128.        Closing Prices (one for each quote, in fact), and in order to refer
  3129.        to the Closing Price on a particular day, there must be some way to
  3130.        reference it.
  3131.  
  3132.        In the absence of any explicit reference to a particular day in an
  3133.        array, TAS will assume the reference is for the entire array. In
  3134.        other words,  the statement below
  3135.             X = H + C;
  3136.        means
  3137.             X = ADD(H, C);
  3138.  
  3139.        Performing a calculation on an entire array can be time-consuming
  3140.        if it is not necessary. If, for example, you only wanted to add the
  3141.        High and the Close for the latest day, you would say
  3142.             X = H[0] + C[0];
  3143.             or
  3144.             X = High of Today + Close of Today
  3145.  
  3146.        If you need to know what the value of the Closing Price was two
  3147.        days before the last quote's day, you have to tell TAS that you
  3148.        want the quote two days before. You can do this in one of three
  3149.        ways. Suppose you have 100 days of data loaded. To get the Closing
  3150.        Price quote from two days  prior to the last day, you could say:
  3151.  
  3152.        1)   C[-2]     
  3153.        2)   C[98]     
  3154.        3)   C 2 DAYS AGO   
  3155.        Methods (1) and (2) above use "subscript" notation to tell TAS
  3156.        which number in the array is needed. In the first case, you are
  3157.        saying "give me the Closing Price array entry 2 days backward from
  3158.        the last entry". The negative number says to start "counting" back
  3159.        days from the last day.
  3160.  
  3161.        The second version, shown in (2), says "give me the Closing Price
  3162.        array entry 98 days from the first day loaded". Since we had
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.        stipulated 100 days were loaded, this is the same as the price two
  3176.        days ago (100-98 = 2).
  3177.  
  3178.        Finally, the last expression, shown in (3), says in English that
  3179.        you want to retrieve the Closing Price 2 days ago. In the interest
  3180.        of readability, this version is the best, but it is more wordy and
  3181.        does incur a very slight performance penalty when you run the
  3182.        script, since TAS has extra work to do in order to interpret the
  3183.        English phrase.
  3184.  
  3185.        In addition, you can also describe the current day's Closing value
  3186.        by saying
  3187.             CLOSE OF TODAY
  3188.        and you can refer to yesterday's Closing price by saying
  3189.             CLOSE OF YESTERDAY
  3190.  
  3191.        Other pre-defined data arrays, like H, L, C, V (for High Price, Low
  3192.        Price, Closing Price and Volume) are examples of arrays.
  3193.  
  3194.        If you want to refer to a closing price 10 days ago (using our
  3195.        earlier example of 100 days loaded), you can say
  3196.                       C[-10] or C[90] or CLOSE 10 DAYS AGO
  3197.        Each time you refer to an "element" of an array, you need to either
  3198.        provide the "subscript" in square brackets, e.g. [-10], which means
  3199.        "subscript minus ten" or say "xx DAYS AGO".
  3200.  
  3201.        You can define your own variable array by "declaring" it (prior to
  3202.        first using it) as follows:
  3203.  
  3204.        variable_name : ARRAY;
  3205.             OR
  3206.        variable_name IS AN ARRAY;
  3207.  
  3208.        where 'variable_name' is the name by which you want to refer to the
  3209.        array.
  3210.  
  3211.        You might wonder "Why would I define my own array?". The answer to
  3212.        that depends on what you are trying to do. Generally, you define
  3213.        your own array because you want to put some indicator value into
  3214.        it.
  3215.  
  3216.        Most indicators create arrays of numbers. When using a charting
  3217.        program, you can see these numbers as a line on a graph. Each of
  3218.        the points on the line are values of the indicator for a particular
  3219.        day. Now, suppose you wanted to know what the value of the
  3220.        indicator was two days ago.
  3221.  
  3222.        Normally, when an indicator is computed, it returns (or creates) an
  3223.        array. However, if you don't put the result of the indicator
  3224.        function into an array (declared via the ARRAY declaration as shown
  3225.        above), then the result stored is the indicator value for the
  3226.        current day only.
  3227.  
  3228.  
  3229.  
  3230.  
  3231.        TAS       Page 49   
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.        In order to "look" at the indicator value for other than the last
  3242.        day loaded, you must place it into an array that you have already
  3243.        declared. For more information on placing the results of a function
  3244.        into an array or variable, see the section that follows.
  3245.  
  3246.        Assignment Statement
  3247.        The Assignment Statement is used to set the contents of a variable
  3248.        or array to the result of an "expression". An "expression" is a
  3249.        term, that means sequence of mathematical operations, a logical
  3250.        relation  and/or the result of a "function".
  3251.  
  3252.        It might help to give some examples of assignment operations:
  3253.  
  3254.                                  a = b + 3 / 4;
  3255.  
  3256.        The "=" (equal)  is the operator that says "assign to"4. So,
  3257.        reading the above assignment, in English, it says "add the contents
  3258.        of variable 'b' to the result of dividing 3 by 4. Place this result
  3259.        in variable 'a'". If variable 'b' contained 6 when this statement
  3260.        was encountered, then variable 'a' would contain 6.75 (6 + 3/4).
  3261.  
  3262.        Another example is:
  3263.  
  3264.                             a = (c[-1] + c[0]) / 2;
  3265.  
  3266.        In this example, the array 'c' is pre-defined as the "closing price
  3267.        array". So, the statement is adding the closing price yesterday
  3268.        (c[-1]) to the closing price today (c[0]). It is then dividing the
  3269.        total of this addition by 2 and placing the result in variable 'a'.
  3270.  
  3271.        Note the use of the parentheses to "group" the addition so that it
  3272.        would be done before the division by 2. If there were no paren-
  3273.        theses, the result would have been considerably different. Instead,
  3274.        it would have divided today's closing price by 2, added it to
  3275.        yesterday's closing price, and placed the result in 'a'.
  3276.  
  3277.        Another example of an assignment is the result of a "function"
  3278.        call. All Technical Indicators available in TAS are created by
  3279.        making a "function" call. In other words, the Technical Indicator
  3280.        is referred to by its name (the "function"). So, for example,
  3281.  
  3282.                                a = mov(c,21,'E');
  3283.  
  3284.        calculates the 21 day exponential moving average ("mov" function)
  3285.        of the closing price array. If variable 'a' has been declared to be
  3286.        an ARRAY prior to this point, then 'a' contains all the moving
  3287.        average "points". If 'a' has not been declared as an ARRAY, then
  3288.        'a' will contain the value of the moving average at the last point
  3289.        of the range, i.e., today's value. See the section titled "Numeric
  3290.        ArrayVariables  for a description of arrays and "subscripts".
  3291.  
  3292.        ____________________
  3293.        4      TAS will also accept a simple "equal" sign in lieu of the
  3294.         "colon-equal" sequence of characters for an assignment statement.
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.        Arithmetic Operators
  3308.        Arithmetic Operators are addition (plus sign '+'), subtraction
  3309.        (minus sign '-'), multiplication (asterisk '*') , division (slash
  3310.        '/') and "exponentiation" (caret "^"). When you write an arithmetic
  3311.        expression, you should use parentheses to guarantee the order in
  3312.        which the operations are performed. In general, exponentiation is
  3313.        performed first, then division and multiplication are performed,
  3314.        then lastly, addition and subtraction.
  3315.  
  3316.  
  3317.        Functions
  3318.        A "function" is a reference to a "built-in" Technical Indicator
  3319.        function (like "MOV(...)"), an output function (like WRITE or
  3320.        WRITELN), or an array manipulation function (like DIVBY).
  3321.  
  3322.        IF Statement
  3323.        The IF statement is perhaps the most powerful  feature of TAS. It
  3324.        enables you to create complex relationships between indicators
  3325.        based on their relationship with other indicators and values.
  3326.  
  3327.        An IF statement is written as follows:
  3328.  
  3329.        IF condition THEN
  3330.             statement to execute if the condition is true
  3331.        ELSE
  3332.             statement to execute if the condition is false;
  3333.  
  3334.        The ELSE part of the IF statement is optional, but sometimes it is
  3335.        convenient to make a two way decision about something. You could
  3336.        alternatively say:
  3337.  
  3338.        IF condition THEN
  3339.             statement to execute if the condition is true;
  3340.  
  3341.        The TAS language does not require you to include the word THEN
  3342.        after the IF part of the statement. You must terminate each IF
  3343.        statement with a semi-colon. Note, however, that IF statements
  3344.        containing an ELSE part are terminated after the ELSE part. For
  3345.        example,
  3346.  
  3347.        IF a IS GREATER THAN b THEN
  3348.             WRITELN('a is greater than b, hurray!')
  3349.        ELSE
  3350.             WRITELN('a is not greater than b, sorry.');
  3351.  
  3352.        Note how there is a semi-colon on the last line, but not after the
  3353.        first WRITELN. However, if you wanted to print a message only if
  3354.        "a" is greater than "b", then you would say
  3355.  
  3356.        IF a GREATER THAN b THEN
  3357.             WRITELN('a is greater than b, hurray!');
  3358.  
  3359.        Note the semi-colon after the last line.
  3360.  
  3361.  
  3362.  
  3363.        TAS       Page 51   
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.        WHILE Statement
  3374.        The WHILE statement executes a statement (or group of statements
  3375.        surrounded by a BEGIN..END) as long as the condition given in the
  3376.        WHILE statement is true.
  3377.        A WHILE statement is written as follows:
  3378.  
  3379.        WHILE condition
  3380.             statement to execute "while" the condition is true
  3381.  
  3382.        FOR Statement
  3383.        The FOR statement executes a statement (or group of statements
  3384.        surrounded by a BEGIN..END)  a certain number of times, and while a
  3385.        condition is true.
  3386.        The FOR statement has three parts to it. each part separated from
  3387.        the previous part by a semi-colon. The first part is done once,
  3388.        before the statement following the FOR is executed. This part of
  3389.        the FOR statement is called the initializer. The second part is the
  3390.        test of the condition that controls the loop.  This part is called
  3391.        the condition. The third part is executed each time after the
  3392.        statement following the FOR has been executed. This third part is
  3393.        called the re-initialization step.
  3394.  
  3395.        The format of the FOR statement is
  3396.  
  3397.          FOR initializer; condition; re-initialization;
  3398.             statement;
  3399.  
  3400.        As an example, suppose you wanted to add the HIGH and the LOW for
  3401.        each day of the security's loaded data and also get the difference
  3402.        of the HIGH and the LOW5. Also suppose you wanted to place both of
  3403.        these values in their own array. You could put a FOR loop "outside"
  3404.        of the actions you wanted to perform for each day. Using the index
  3405.        variable i to refer to each day's array entry, you would set it up
  3406.        as follows:
  3407.             HIGHLOWSUM : ARRAY;      
  3408.             HIGHLOWDIFF : ARRAY;
  3409.             FOR i = 1; i  <= QUOTE_COUNT; i = i+1;
  3410.             BEGIN     
  3411.                  HIGHLOWSUM[i] = CLOSE[i] + HIGH[i];
  3412.                  HIGHLOWDIFF[i]  = CLOSE[i] - HIGH[i];
  3413.             END;
  3414.        This statement is a very powerful and convenient way to "iterate"
  3415.        or loop through some portion of the price or indicator data.
  3416.  
  3417.  
  3418.        FOR EACH POINT Statement
  3419.        The For Each Point statement is another (and perhaps easier) method
  3420.        of  processing each loaded data point. Unlike the For statement,
  3421.        ____________________
  3422.        5 Of course, you really wouldn't want to do this with a FOR
  3423.         statement, since both of these values can be computed by the
  3424.         following two simpler statements:
  3425.         HighLowSum = C + H;
  3426.         HighLowDiff = C - H;
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.        the For Each version will handle all the subscripting or indexing
  3440.        for the statement that follows.
  3441.        The format of the FOR EACH statement is
  3442.  
  3443.        FOR EACH POINT STARTING AT initial_index [USING variable]
  3444.             statement;
  3445.        where initial_index is an expression which will be the first quote
  3446.        day  accessed in statement and the optional variable will be set to
  3447.        the index of the day to be accessed.
  3448.        As an example, the following three routines are identical in what
  3449.        they do. Each will add today's close minus yesterday's high to the
  3450.        variable A, for each day in the file. Each starts at day 2, since
  3451.        the statement that follows refers to the prior day.
  3452.        (1)
  3453.             For I=2 ; I <= Quote_Count; I = I + 1;
  3454.                  A = A + C[I] - H[I-1];
  3455.             and
  3456.        (2)
  3457.             For Each Point Starting at 2 Using I
  3458.                  A = A + C[I] - H[I-1];
  3459.             and
  3460.        (3)
  3461.             For Each Point Starting at 1
  3462.                  A = A + C[0] - H[-1];
  3463.  
  3464.        Example (1) uses the For statement as described in the previous
  3465.        topic. Note how the subscript I is used in both examples (1) and
  3466.        (2) to reference the current day index.
  3467.        In example (3), there is no use of the variable I to reference each
  3468.        day, since the day index is implied by the For Each statement when
  3469.        the Using variable portion is omitted.
  3470.  
  3471.  
  3472.        BREAK Statement
  3473.        The BREAK statement can be used within either a FOR or WHILE loop
  3474.        to "break" out of a loop before the terminating condition has been
  3475.        reached.
  3476.        You must not use a GOTO statement to leave a FOR or WHILE loop.
  3477.  
  3478.        BEGIN..END Statement
  3479.        Suppose you want to do more than one thing if the condition "a is
  3480.        greater than b" is true. In that case, you would need to use a
  3481.        BEGIN .. END block.
  3482.  
  3483.         A "BEGIN..END" block "groups" all statements between the BEGIN and
  3484.        the END so that the entire "group" is treated as if it were one
  3485.        statement.
  3486.  
  3487.        This is useful in the case of the IF  (or FOR and WHILE) statement,
  3488.        because the action to be taken following the statement THEN or ELSE
  3489.        part of the IF can only be one statement. But if you use the
  3490.        BEGIN..END block to group several statements, the entire block is
  3491.        treated as a "single" statement. Think of BEGIN..END blocks in the
  3492.        same way you would think of parenthesized arithmetic expressions.
  3493.  
  3494.  
  3495.        TAS       Page 53   
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.        You use parentheses to "group" some operations so that they are
  3506.        treated as a group.
  3507.  
  3508.        An example of the use of the BEGIN..END block in an IF statement is
  3509.        shown below:
  3510.  
  3511.        IF a GREATER THAN b THEN
  3512.        BEGIN
  3513.             a = a - 1;
  3514.             b = mov(c,21,'E');
  3515.             WRITELN('New values for a and b are:' ,a,' ',b);
  3516.        END;
  3517.  
  3518.        All three statements following the BEGIN will be executed (acted
  3519.        upon) if the value of "a" is greater than the value of "b". If you
  3520.        had left out the BEGIN..END section, only the first statement ("a =
  3521.        a - 1") would have been done if "a GREATER THAN b" was true. The
  3522.        following two statements would have ALWAYS been done, since they
  3523.        were not part of the IF.
  3524.  
  3525.        GOTO Statement and LABELS
  3526.        You can use the GOTO statement in a script to transfer control to a
  3527.        LABEL you define in the script.
  3528.  
  3529.        A LABEL is defined by a COLON (":")  immediately followed by a
  3530.        LABEL NAME. For example, in the script below, the third line has
  3531.        the sequence ":AGAIN". This makes "AGAIN" the name of a LABEL. On
  3532.        the tenth line of the script, there is a "GOTO AGAIN" which
  3533.        transfers the "flow of control" of the script back to the statement
  3534.        just following the label 'AGAIN'. The purpose of the script below
  3535.        is to show an example of GOTO and LABEL's, but incidentally, it
  3536.        also computes all the moving averages for periods from 20 days to
  3537.        40 days and prints them6.
  3538.  
  3539.        ma_array10 IS AN array;
  3540.        n = 20;
  3541.        :AGAIN
  3542.        ma_array10 = mov(c,n,'e');
  3543.        writeln(  ticker,
  3544.                  date,int(n),
  3545.                  ' day moving average is ',
  3546.                  ma_array10);
  3547.        n = n+1;
  3548.        if n LESS THAN 40 then
  3549.             GOTO AGAIN;
  3550.  
  3551.        When you use the GOTO within a BEGIN..END block, you must be
  3552.        careful not to GOTO someplace outside of the block. Your script
  3553.        must encounter the END statement which matches the previous BEGIN
  3554.        statement.
  3555.  
  3556.        ____________________
  3557.        6 This example is rather contrived, since it is easily replaced by
  3558.         a FOR loop which doesn't require using a LABEL or a GOTO.
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.        GOSUB statement
  3572.        The GOSUB statement is used to "go to a subroutine". This statement
  3573.        can be used when you have the same section of script code that you
  3574.        want to execute several times.
  3575.  
  3576.        Rather than including the same lines in the script in each place
  3577.        you want to use them, you can place them in one location in the
  3578.        script and use GOSUB each place you want to execute them.
  3579.  
  3580.        When you use GOSUB, you specify a label where the 'subroutine'
  3581.        starts. When the subroutine is completed, it should have a RETURN
  3582.        statement. The RETURN statement will return the script control back
  3583.        to the statement FOLLOWING the GOSUB.
  3584.  
  3585.        Here is a sample script using the GOSUB statement:
  3586.  
  3587.        a = 5;
  3588.        gosub s1;
  3589.        gosub s2;
  3590.        return;
  3591.        :s1
  3592.        begin
  3593.        writeln(ticker);
  3594.        writeln('s1 entered, a = ',int(a));
  3595.        return;
  3596.        end;
  3597.        :s2
  3598.        a = a+1;
  3599.        begin
  3600.        writeln('s2 entered, a = ',int(a));
  3601.        gosub s3;
  3602.        return;
  3603.        end;
  3604.        :s3
  3605.        a = a+1;
  3606.        begin
  3607.        writeln('s3 entered, a = ',int(a));
  3608.        return;
  3609.        end;
  3610.        The output from this script is:
  3611.  
  3612.        AMH
  3613.        s1 entered, a =     5
  3614.        s2 entered, a =     6
  3615.        s3 entered, a =     7
  3616.  
  3617.        RETURN statement
  3618.        The RETURN statement in a script will stop processing the current
  3619.        ticker or return from a GOSUB call. For example, if you want to
  3620.        avoid computing several complex indicators if there are less than
  3621.        100 quotes in the file or the price is less than $5, you could put
  3622.        the following section of code BEFORE your calculations in the
  3623.        script:
  3624.  
  3625.  
  3626.  
  3627.        TAS       Page 55   
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.        IF quote_count LESS THAN 100 OR close LESS THAN 5 THEN
  3638.             RETURN;
  3639.  
  3640.        Or, if you have a subroutine that you call with the GOSUB
  3641.        statement, you need to return back to the place where the GOSUB was
  3642.        made by using a RETURN statement at the end of the subroutine.
  3643.  
  3644.        GOSUB SUB1;         {Call subroutine 1}
  3645.        RETURN;             {Return to TAS and end script}
  3646.        :SUB1         { BEGINNING OF SUB1}
  3647.        { DO WHATEVER SUB1 DOES HERE
  3648.                  ......................}
  3649.        RETURN;             { RETURN FROM SUB1}
  3650.  
  3651.        STOP Statement
  3652.        The STOP statement can be used to completely stop a script's
  3653.        processing and return to TAS without processing any more ticker
  3654.        symbols.
  3655.  
  3656.        PROLOG statement
  3657.        The Prolog statement is executed once before any other data has
  3658.        been read for any ticker, and before any other statement in a
  3659.        script.
  3660.        It can be used to set headings, initialize your variables, get user
  3661.        input via the Ask function.
  3662.  
  3663.        EPILOG statement
  3664.        The Epilog statement is executed once after all other data has been
  3665.        read for all tickers, and just before the script is going to
  3666.        complete.
  3667.        It can be used to produce totals, do the final SORT actions
  3668.        required by your script, or anthing else that will finish up and
  3669.        complete your processing.
  3670.  
  3671.        Logical Operators
  3672.        You can combine relations by using the words "AND" and "OR" and
  3673.        "NOT". They have the same sense as in English. Whenever you use AND
  3674.        and OR, you can use parentheses to group your relations to be sure
  3675.        they are computed the way you want them to be understood. For
  3676.        example:
  3677.  
  3678.        IF a GREATER THAN b AND b EQUAL TO 1 THEN
  3679.             WRITELN('a is greater than b and b is equal to 1');
  3680.  
  3681.        This example compares "a" to "b". If "a" is greater than "b", then
  3682.        it compares "b" to the number 1. If "b" is equal to 1, then the
  3683.        message
  3684.             a is greater than b and b is equal to 1
  3685.        will be printed. If either of the "relations" (a in "relation" to b
  3686.        AND b in "relation" to 1) is not true, then the WRITELN will not be
  3687.        done.
  3688.  
  3689.        On the other hand, suppose we want to print the message if either
  3690.        of the conditions is true. Then we would say:
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.             IF a > b OR b = 1 THEN
  3705.                  WRITELN('a is greater than b OR b is equal to 1');
  3706.  
  3707.        In this case, it would print the message if "a" were greater than
  3708.        "b" or if "b" were equal to 1.
  3709.  
  3710.        You can also ask for a condition to be false by preceding it with
  3711.        the word "NOT" as in
  3712.             IF NOT a GREATER THAN b THEN
  3713.                  WRITELN('a is NOT greater than b');
  3714.  
  3715.        Relational Operators
  3716.        Relational Operators describe a "relationship" between the ex-
  3717.        pression on the left of the operator and the expression on the
  3718.        right of the operator. For example, "a > b". 'a' is on the left
  3719.        side, 'b' is on the right side, and the operator is '>' which means
  3720.        "greater than". Relational operators can be expressed using
  3721.        mathematical notation (">", "<", "<>", ">=") or by using English
  3722.        forms of the same relation, such as "GREATER THAN", "LESS THAN",
  3723.        etc).
  3724.  
  3725.        Comments
  3726.        Comments are surrounded on both sides by "curly braces". These are
  3727.        the characters at the right of your keyboard. They look like this:
  3728.          {  - Left "curly brace"
  3729.          }  - Right "curly brace"
  3730.  
  3731.        You can place these "curly braces" around any thing in your script
  3732.        file that you do not want TAS see. It is only for your eyes and the
  3733.        eyes of other humans.
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.        TAS       Page 57   
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.         Pre-Defined Variables
  3771.  
  3772.  
  3773.        Predefined Variables are variables that are "filled in" when each
  3774.        MetaStock TICKER is processed or at specific times during the
  3775.        processing of ticker files.
  3776.         TICKER       The 'ticker' symbol, e.g., AXP
  3777.  
  3778.         FULLNAME     The 'full name', e.g., AMERICAN EXPRESS
  3779.  
  3780.         DATAPATH     contains the DOS file name of the data subdirectory
  3781.                      currently being processed.
  3782.  
  3783.         TICKER_PERIOD contains the periodicity of the ticker file. This is
  3784.                      taken from the Metastock PERIOD field.
  3785.  
  3786.         QUOTE_COUNT  The number of quotes in the file
  3787.  
  3788.         QUOTE_RANGE  Initially set to QUOTE_COUNT by TAS. This variable
  3789.                      can be modified by the script to set the index of the
  3790.                      last quote in the file for computation.
  3791.  
  3792.         FIRST_TICKER Variable, which, if equal to 1 (one), indicates this
  3793.                      ticker is the first to be processed.
  3794.  
  3795.         LAST_TICKER  Variable, which, if equal to 1 (one), indicates this
  3796.                      ticker is the last to be processed.
  3797.  
  3798.         DATE         The date of the latest quote in the file in the
  3799.                      format MM/DD/YY.
  3800.  
  3801.  
  3802.         PLOT_PHASE   Variable which is set to 1 when the Profit Test
  3803.                      Script is entered for the first time for a ticker.
  3804.  
  3805.         TEST_PHASE   Variable which is set to 1 when the Profit Test
  3806.                      Script is entered for the EACH quote for a ticker.
  3807.         END_PHASE    Variable which is set to 1 when the Profit Test
  3808.                      Script is entered for the last quote for a ticker.
  3809.  
  3810.  
  3811.  
  3812.         Pre-Defined DATA Arrays
  3813.  
  3814.  
  3815.        A pre-defined DATA Array contains one entry of one type of value
  3816.        for each day in the ticker file. There are as many entries in each
  3817.        array as there are days loaded for the ticker.
  3818.  
  3819.        Unlike user-defined arrays,  the pre-defined arrays should not be
  3820.        defined within the script with the array declaration. Since they
  3821.        are pre-defined, they are always available for use within the
  3822.        script.  There are two ways to refer to each of the pre-defined
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.        arrays. There is an English language name, such as CLOSE and a
  3836.        "short variable name", such as "C", for the Closing Price array.
  3837.        The names for the pre-defined arrays are shown in the table that
  3838.        follows:
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.        TAS       Page 59   
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.            Pre-defined DATA Arrays
  3903.         English
  3904.         language
  3905.         name for
  3906.         array
  3907.                       Short
  3908.                       Variable
  3909.                       Name
  3910.                                 Description
  3911.         OPEN
  3912.                       O
  3913.                                 The OPEN
  3914.                                 PRICE "data
  3915.                                 array"
  3916.         HIGH
  3917.                       H
  3918.                                 The HIGH
  3919.                                 "data array"
  3920.         LOW
  3921.                       L
  3922.                                 The LOW
  3923.                                 "data array"
  3924.         CLOSE
  3925.                       C
  3926.                                 The CLOSE
  3927.                                 "data array"
  3928.         VOLUME
  3929.                       V
  3930.                                 The VOLUME
  3931.                                 "data array"
  3932.         OPEN_INTERES
  3933.         T
  3934.                       OI
  3935.                                 The OPEN
  3936.                                 INTEREST
  3937.                                 "data array"
  3938.         INDEX
  3939.                       INDEX
  3940.                                 Array
  3941.                                 containing
  3942.                                 the CLOSE
  3943.                                 quotes for a
  3944.                                 TICKER de-
  3945.                                 fined by an
  3946.                                 INDEX
  3947.                                 command.
  3948.         DATES
  3949.                       DATES
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.                                 Array of
  3968.                                 DATES
  3969.                                 associated
  3970.                                 with each of
  3971.                                 the price en-
  3972.                                 tries. These
  3973.                                 dates are in
  3974.                                 number for-
  3975.                                 mat, not
  3976.                                 string
  3977.                                 format.
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.        TAS       Page 61   
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.                               Pre-defined Functions
  4034.  
  4035.        TAS  indicators and functions which are also available in MetaStock
  4036.        have the same names and same parameters7 as those documented in the
  4037.        MetaStock Custom Formulas Section of the MetaStock "User's Manual".
  4038.  
  4039.        Refer to the Metastock documentation, the Encyclopedia of Technical
  4040.        Market Indicators, or any other technical analysis reference for
  4041.        additional information about these functions and their computation
  4042.        and use.
  4043.  
  4044.  
  4045.  
  4046.         Technical Indicators available in Metastock
  4047.  
  4048.  
  4049.  
  4050.        ad        Accumulation/Distribution
  4051.        Usage: ad()
  4052.  
  4053.        The Accumulation/Distribution indicator, developed by Marc Chaikin,
  4054.        calculates the percent range a stock moves in a given day and
  4055.        multiplies this times the volume.  The relationship of the close is
  4056.        (Close - Low) - (High - Close). This is then divided by the range
  4057.        (High - Low) and multiplied by the volume.  The result is added to
  4058.        the running total.  The buying pressure is compared to selling
  4059.        pressure for each day and like the OBV the indicator is cumulative.
  4060.  
  4061.        The A/D line is analyzed much like the OBV.  If a stock is going to
  4062.        rise then there should be volume behind it. This volume is measured
  4063.        by the degree the close is closer to the high of the day.  If there
  4064.        is buying pressure then the percent of the close times the volume
  4065.        will be greater.  This adds more to the A/D line and divergences
  4066.        may be detected before the price has actually risen to a great
  4067.        extent.
  4068.  
  4069.        Sample script:
  4070.         {A/D Volume Line for one year of data}
  4071.         #Max_Quotes 265
  4072.         OpenGraph(3,-264,0);
  4073.         SizeGraph(3,1,3);
  4074.         Graph(1,'PRICE');
  4075.         Graph(v,'VOLUME');
  4076.         Graph(ad(),
  4077.             'ACCUMULATION DISTRIBUTION LINE',
  4078.             mov(ad(),30,'s'),'30 DMA');
  4079.         CloseGraph();
  4080.  
  4081.        ____________________
  4082.        7      In some instances, the parameter to a MetaStock named
  4083.         function has to have single quotes around it. This is the case
  4084.         with any function that passes a single character as a parameter,
  4085.         such as the last parameter in the "mov" (Moving Average) function.
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.        References:  Chaikin, Marc. 177 E. 77th Street, New York, NY 10021
  4100.  
  4101.  
  4102.        adx       Average Directional Movement
  4103.        Usage: adx(periods)
  4104.        The Average Directional Movement (ADX) indicator is the
  4105.        exponentially-smoothed Directional Movement Index (DMI) over p
  4106.        periods.
  4107.  
  4108.  
  4109.        adxr      Average Directional Movement Rating
  4110.        Usage: adxr(periods)
  4111.  
  4112.        Each element [i] of the array returned by the ADXR function is the
  4113.        exponential moving average of ADX over p periods relative to
  4114.        ADX[i], and ranges between 0 and 100.  ADXR provides a measure of
  4115.        directionality of a security.
  4116.  
  4117.        add       Add two arrays
  4118.        Usage: add(a,b)
  4119.  
  4120.        Add each element of array "a" to the corresponding element of array
  4121.        "b".
  4122.  
  4123.        cci       Commodity Channel Index Array
  4124.        Usage:  cci(periods)
  4125.  
  4126.        periods = number of periods in the CCI calculation as shown below.
  4127.  
  4128.        The CCI is a price momentum indicator that works well for
  4129.        commodities, stocks, and mutual funds.
  4130.  
  4131.        Mathematically,
  4132.        CCI[i] = (M - A)/(X * D) percent
  4133.        where:
  4134.        M  =Mean price of current-day sample period.
  4135.        A  =p-period simple moving average of M.
  4136.        D  =Mean deviation of absolute values of the numerator over p
  4137.        periods.
  4138.        X  =An adjusting factor, 0.15, which normalizes the excursions to a
  4139.        trading range of +/- 100.
  4140.  
  4141.        The CCI is a sort of "noise" filter, for which the random fluctua-
  4142.        tions should fall inside the +/- 100 percent range.  Excursions
  4143.        outside this range tend to be nonrandom and indicate trading
  4144.        opportunities.  Suggested trading rules are:
  4145.        1.   Buy long when CCI goes above +100%.
  4146.        2.   Sell long when CCI subsequently returns below 100%.
  4147.        3.   Sell short when CCI goes below -100%.
  4148.        4.   Cover shorts when CCI subsequently returns above -100%.
  4149.        Selection of a large number of periods (p) will filter out much of
  4150.        the noise, but can mask trading opportunities and trends.  A
  4151.        smaller number of periods can create false signals.  90 and 53
  4152.  
  4153.  
  4154.  
  4155.        TAS       Page 63   
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.        weeks as tentative starting periods for your analysis are sug-
  4166.        gested.
  4167.        Another way of using the CCI is to note when the security being
  4168.        analyzed rises dramatically, but the rise is not reflected by the
  4169.        overall momentum represented by the CCI.  Such a divergence is
  4170.        usually followed by a price correction for the security.
  4171.  
  4172.        co        Chaikin's Oscillator
  4173.        Usage: co()
  4174.  
  4175.        Chaikin's Oscillator can be used to detect trend changes by
  4176.        watching short-term movement.  An oscillator establishes a baseline
  4177.        using relatively longer-term data, and then measures fluctuations
  4178.        of the shorter-term data about this baseline.  Chaikin's Oscillator
  4179.        uses volume accumulation data and is obtained by subtracting the
  4180.        10-day exponential moving average of the Accumulation/ Distribution
  4181.        (AD) function line from the 3-day exponential moving average of the
  4182.        same function line.
  4183.        f you want to try different long-term and short-term periods, you
  4184.        can construct your own equivalent function using the MOV and AD
  4185.        functions.
  4186.  
  4187.        Because short-term movements tend to be erratic, use of such
  4188.        indicators should be only part of the your overall trading strat-
  4189.        egy.
  4190.  
  4191.  
  4192.        cos       Trigonometric cosine
  4193.        Usage: cos(array)
  4194.  
  4195.        Cosine of each entry in array 'a'.
  4196.        Use the cos_(n) function to compute the cosine of a single number
  4197.        "n".
  4198.  
  4199.  
  4200.        cum       Cumulative Sum of Array "a"
  4201.        Usage: cum(array)
  4202.  
  4203.        Computes the cumulative sum of array "a".  That is, each element of
  4204.        the returned array is the sum of all the preceding corresponding
  4205.        elements of the argument array.  Since the elements are signed
  4206.        numbers, the cumulative sum can be increasing, decreasing,
  4207.        fluctuating, or it can remain constant.  See also SUM function.
  4208.  
  4209.  
  4210.        div       Divide two arrays
  4211.        Usage: div(a,b)
  4212.  
  4213.        Divide each element of array "a" by the corresponding element of
  4214.        array "b".
  4215.  
  4216.        dmi       Directional Movement Index
  4217.        Usage: dmi(periods)
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.        The DMI and its derivative indicators can reveal when the market
  4232.        trends are significant enough to warrant entry into trades.
  4233.  
  4234.        Two other DMI-related indicators typically used in making trading
  4235.        decisions are the plus and minus directional indicators (PDI and
  4236.        MDI, respectively).
  4237.  
  4238.             DMI = (PDI - MDI) / (PDI + MDI)
  4239.  
  4240.        Please refer to the PDI and MDI descriptions for definitions of
  4241.        these functions.
  4242.  
  4243.        A typical trading-rule set is:
  4244.          1. Enter trade only when ADX is rising.
  4245.          2. Buy when PDI crosses above MDI.
  4246.          3. Sell when PDI crosses below MDI, or when ADX turns     lower.
  4247.          4. Enter a short sale trade when ADX is rising and PDI    crosses
  4248.             below MDI.
  4249.          5. Cover (or close out) a short sale trade when PDI crosses    ab
  4250.          ove MDI or ADX turns lower.
  4251.  
  4252.  
  4253.        exp       Exponential Function
  4254.        Usage: exp(array)
  4255.  
  4256.        Computes the exponential value of each element of array "a":
  4257.        2.71828a ("e" raised to the "a" power).
  4258.        Use the exp_(n) function to compute the exponential of a single
  4259.        number "n".
  4260.  
  4261.  
  4262.        hhv       Highest High Value
  4263.        Usage: hhv(a,p)
  4264.  
  4265.        Returns Highest High Value in the array 'a' over the  period 'p'.
  4266.        The first 'p' values of the result are zero.
  4267.  
  4268.  
  4269.  
  4270.        llv       Lowest Low Value
  4271.        Usage: llv(a,p)
  4272.  
  4273.        Returns Lowest Low Value in the array 'a' over the period 'p'
  4274.        The first 'p' values of the result are zero.
  4275.  
  4276.  
  4277.        log       Exponential Logarithm
  4278.        Usage: log(a)
  4279.  
  4280.        Exponential logarithm of each entry in array 'a'. Use the log_(n)
  4281.        function to compute the exponential logarithm of a single number
  4282.        "n".
  4283.  
  4284.  
  4285.  
  4286.  
  4287.        TAS       Page 65   
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.        macd      MACD indicator
  4298.        Usage:  macd()
  4299.  
  4300.        The MACD (Moving Average Convergence Divergence) indicator was
  4301.        developed by Gerald Appel.  It is a price momentum oscillator
  4302.        representing the point spread difference between fast and slow
  4303.        exponential moving averages of the closing price, approximately
  4304.        equal to:
  4305.        macd() = mov(C,12,E) - mov(C,26,E)
  4306.        If MACD is displayed graphically, a trigger line, mov(macd(),9,E),
  4307.        will also be displayed.
  4308.        A simple application is to buy or sell when the MACD passes through
  4309.        the trigger line.  However, for this function to be effective, more
  4310.        complex decision rules generally will be required.
  4311.        macd() approximately equals macdx(12,26,9).
  4312.  
  4313.        mdi       Minus Directional Movement (-DI)
  4314.        Usage: mdi(p)
  4315.  
  4316.        This function is part of the "DMI family" of functions.  It enters
  4317.        into the DMI and ADX function calculations, and is used with the
  4318.        trading decision rules presented above in the DMI function
  4319.        description.
  4320.        MDI = SMDM/STR
  4321.        where:
  4322.        SMDM = Smoothed Minus Directional Movement
  4323.        STR = Smoothed Wilder's True Range.
  4324.  
  4325.        Minus Directional Movement (MDM) is the largest part of the current
  4326.        period's price range that is outside the previous period's price
  4327.        range.
  4328.  
  4329.        mo        Momentum Array
  4330.        Usage: mo(p)
  4331.  
  4332.        p = number of periods
  4333.        This function provides the price momentum expressed as a ratio.
  4334.        Each element of the returned array represents the ratio of the
  4335.        closing price for that day to the closing price "p" days before.:
  4336.             mo[i] = C[i]/C[i-p]
  4337.        Thus, MO indicates the velocity or rate of change of a security's
  4338.        price. ROC is a similar function except that ROC expresses the
  4339.        momentum as percentage or dollars (selectable).
  4340.  
  4341.        mov       Moving Average
  4342.        Usage: mov(d,p,t)
  4343.  
  4344.        Moving Average Array
  4345.             d = Data Array
  4346.             p = number of periods
  4347.             t = Moving Average Type
  4348.                  'E' - Exponential
  4349.                  'S' - Simple
  4350.                  'W' - Weighted
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.        Each element [i] of the returned array represents a computation
  4364.        that uses data from "p" elements of array "d" relative to element
  4365.        [i].  Thus, if "p" represents days, the average moves along with
  4366.        each day represented by the returned array.  For example, the 10-
  4367.        day moving average for 5 days ago uses data from 14 days ago to 5
  4368.        days ago, inclusive.  The specific value for each element in the
  4369.        returned array (using the same data) depends on the moving average
  4370.        type selected using the "t" parameter:
  4371.        S - for Simple Moving Average.  Each element in the simple moving
  4372.        average is the sum of the elements for "p" periods, divided by "p".
  4373.  
  4374.        Although the simple moving agerage has its uses, most analysts
  4375.        prefer to "smooth" the input data.  This is based on the premise
  4376.        that older data entering into the calculation for days remote from
  4377.        a particular day (the "current day") should have less impact than
  4378.        newer data for days nearer the current day.  Smoothing is performed
  4379.        by multiplying the data elements by a variable scaling factor.  The
  4380.        two scaling factors commonly in use are the simple weight and the
  4381.        exponential:
  4382.        W - for Weighted Moving Average.  The scaling factor is equal to
  4383.        the number of days from the beginning of the period.  The
  4384.        multiplication products are summed, and the weighted average is
  4385.        determined by dividing this sum by the sum of the scale factors
  4386.        (the multipliers).  For example, for a 5-day moving average of
  4387.        array "d",
  4388.  
  4389.             Index      Scale   Product
  4390.            relative   Factor
  4391.           to Current
  4392.              Day
  4393.               0           5   5 * d[0]
  4394.               -1          4   4 * d[-1]
  4395.               -2          3   3 * d[-2]
  4396.               -3          2   2 * d[-3]
  4397.               -4          1   1 * d[-4]
  4398.  
  4399.        The sum of the scale factors is 15.  Thus, the weighted moving
  4400.        average for the current day is the sum of the products divided by
  4401.        15.
  4402.  
  4403.        E - for Exponential Moving Average.  The scaling factor is obtained
  4404.        by converting the period "p" to a percentage, applying this
  4405.        percentage to the argument array's current day value, applying the
  4406.        remaining percentage to the previous day's exponential moving
  4407.        average value, and summing the two products.  The cumulative effect
  4408.        of repeatedly applying a scaling factor to older data is to
  4409.        "exponentially" reduce the older data while never actually losing
  4410.        it entirely.
  4411.        Current Day Factor (CDF) = 2 / (p + 1)
  4412.        Previous Day Factor (PDF) = 1 - CDF
  4413.        and
  4414.        Return Array[i] = (Argument Array[i] * CDF) +
  4415.                  (Return Array[i-1] * PDF)
  4416.  
  4417.  
  4418.  
  4419.        TAS       Page 67   
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.        mul       Multiply two arrays
  4430.        Usage: mul(a,b)
  4431.  
  4432.        Multiply each element of array "a" by the corresponding element of
  4433.        array "b".
  4434.  
  4435.        neg       Negative of Array "a"
  4436.        Usage: neg(a)
  4437.        Reverses the sign of each element of the array a by multiplying
  4438.        each element by negative one.
  4439.  
  4440.        nvi       Negative Volume Indicator
  4441.        Usage: nvi()
  4442.  
  4443.        The Negative Volume Index (NVI) is used in an attempt to detect
  4444.        days when "smart" investors are active.  Some analysts believe that
  4445.        the smart investors avoid trading in high-volume periods, and do
  4446.        their buying and selling during quiet periods of declining volume.
  4447.        The NVI is a cumulative indicator that can change only when the
  4448.        volume decreases.  The amount accumulated for each (declining)
  4449.        period is equal to the percent change of a security's price
  4450.        multiplied by the previous period's NVI:
  4451.  
  4452.        if V[i] < V[i-1] then
  4453.             NVI[i] =
  4454.             NVI[i-1] + ( ((C[i] -C[i-1])/C[i-1]) * NVI[i-1])
  4455.  
  4456.        if V[i] >= V[i-1] then
  4457.             NVI[i] = NVI[i-
  4458.  
  4459.        obv       On Balance Volume
  4460.        Usage: obv()
  4461.  
  4462.        On balance volume uses the change of the close plus volume to
  4463.        determine how much buying or selling pressure there is in a stock.
  4464.        If the close is higher than yesterday then the volume is added to
  4465.        yesterdays OBV.  If the stock closes lower than yesterday the
  4466.        volume is subtracted from the OBV indicator.  Because this
  4467.        indicator keeps a running total it can reveal the accumulation or
  4468.        distribution of a stock.  This can show early interest in a stock
  4469.        or an eventual sell off.
  4470.  
  4471.        OBV can be analyzed several ways.  A simple moving average of the
  4472.        OBV can be used to watch for breakouts.  For more intense study,
  4473.        the patterns the indicator makes can be compared to the stock for
  4474.        divergences, higher highs, or lower lows.  These patterns may
  4475.        suggest activity not seen in just in the price chart.
  4476.        Sample script:  {On Balance Volume for one year of data}
  4477.         #max_quotes 265
  4478.         opengraph(3,-264,0);
  4479.         sizegraph(3,1,3);
  4480.         graph(1,'PRICE');
  4481.         graph(v,'VOLUME');
  4482.         graph(obv(),'ON BALANCE VOLUME',
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.                  mov(obv(),30,'s'),'30 DMA');
  4496.         closegraph();
  4497.  
  4498.        References:  Granville, Joseph E.  New Strategy of Daily Stock
  4499.        Market Timing for Maximum Profit.  Englewood Cliffs NJ:
  4500.        Prentice_Hall, 1976.
  4501.  
  4502.        oscp      Price Oscillator
  4503.        Usage: oscp(p1,p2,t,r)
  4504.        Price Oscillator formed by subtracting a "t" type "p2" day moving
  4505.        average of the Closing Price from a "t" type "p1" day moving
  4506.        average of the Closing Price.
  4507.             p1 = shorter moving average period
  4508.             p2 = longer moving average period
  4509.        t = Moving Average Type
  4510.             'E' - Exponential
  4511.             'S' - Simple
  4512.             'W' - Weighted
  4513.        r = ROC Type
  4514.             '%' - percentage ROC
  4515.             '$' - Unit ROC
  4516.  
  4517.        oscv      Volume Oscillator
  4518.        Usage: oscv(p1,p2,t,r)
  4519.  
  4520.        Volume Oscillator formed by subtracting a "t" type "p2" day moving
  4521.        average of the Volume from a "t" type "p1" day moving average of
  4522.        the Volume.
  4523.             p1 = shorter moving average period
  4524.             p2 = longer moving average period
  4525.                  t = Moving Average Type
  4526.                       'E' - Exponential
  4527.                       'S' - Simple
  4528.                       'W' - Weighted
  4529.  
  4530.             r = ROC Type
  4531.                  '%' - percentage ROC
  4532.                  '$' - Unit ROC
  4533.  
  4534.        pdi       Positive Directional Movement (+DI)
  4535.        Usage: pdi(p)
  4536.  
  4537.        This function is part of the "DMI family" of functions.  It enters
  4538.        into the DMI and ADX function calculations, and is used with the
  4539.        trading decision rules presented above in the DMI function
  4540.        description.
  4541.        PDI = SPDM/STR
  4542.  
  4543.          where:
  4544.  
  4545.          SPDM = Smoothed Plus Directional Movement
  4546.          STR = Smoothed Wilder's True Range.
  4547.  
  4548.  
  4549.  
  4550.  
  4551.        TAS       Page 69   
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.        Plus Directional Movement (PDM) is the largest part of the current
  4562.        period's price range that is outside the previous period's price
  4563.        range.
  4564.  
  4565.        per       Performance Indicator
  4566.        Usage: per(p)
  4567.  
  4568.        Performance Indicator computed as follows:
  4569.             
  4570.  
  4571.        pvi       Positive Volume Indicator
  4572.        Usage: pvi()
  4573.  
  4574.        The Positive Volume Index (PVI) is the opposite of the Negative
  4575.        Volume Index (NVI).  It is used in an attempt to detect days when
  4576.        unsophisticated investors are active.
  4577.  
  4578.        The PVI is a cumulative indicator that can change only when the
  4579.        volume increases.  The amount accumulated for each (increasing)
  4580.        period is equal to the percent change of a security's price
  4581.        multiplied by the previous period's PVI:
  4582.  
  4583.        if V[i] > V[i-1] then
  4584.             PVI[i] =
  4585.             PVI[i-1] + ( ((C[i] -C[i-1])/C[i-1]) * PVI[i-1])
  4586.  
  4587.        if V[i] <= V[i-1] then
  4588.             PVI[i] = PVI[i-1]
  4589.  
  4590.  
  4591.  
  4592.        ref       Reference function
  4593.        Usage: ref(d,p)
  4594.  
  4595.        This function is used to "shift" a data array "d" forward by "p"
  4596.        entries. For example, if you wanted to compute the compute a rate
  4597.        of change over a ten day period, you could use the formula
  4598.        X  = SUB( CLOSE, REF(CLOSE,-10) ) to place this value into the
  4599.        array named X.
  4600.  
  4601.        rsi       Wilder's Relative Strength
  4602.        Usage: rsi(p)
  4603.  
  4604.        p = number of periods
  4605.        This indicator is credited to J. Welles Wilder.  The RSI function
  4606.        performs the following calculation:
  4607.  
  4608.             RSI = 100 - (100/(1+X))
  4609.        where X is the ratio of the exponentially-smoothed moving average
  4610.        of gains to the absolute value of the expentially smoothed moving
  4611.        average of losses, taken over "p" periods.
  4612.        Thus, RSI is a price momentum indicator that is a function of
  4613.        changes in closing prices.
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.        Note This function is unrelated to relative strength indicators
  4628.        that compare price to the various market indicators.
  4629.  
  4630.  
  4631.        roc       Rate Of Change Array
  4632.        Usage: roc(d,p,r)
  4633.  
  4634.        Computes the rate of change of the data array "D" over "p" periods,
  4635.        using either a percentage basis or a dollar unit basis.
  4636.             d = Data Array
  4637.             p = number of periods
  4638.             r = ROC Type
  4639.                  '%' - percentage ROC
  4640.                  '$' - Unit ROC
  4641.        Each element [i] of the returned array equals the the rate of
  4642.        change of data array "d" over "p" periods relative to d[i], using
  4643.        either a percentage basis or a dollar unit basis.
  4644.  
  4645.        sar       Wilder's Parabolic
  4646.        Usage: sar(i,m)
  4647.  
  4648.        The Parabolic (or Stop and Reverse)  indicator creates a parabolic
  4649.        stop line either over or under the price graph.
  4650.        where
  4651.              'i' = increment value and initial
  4652.              'm' = maximum acceleration factor
  4653.  
  4654.        Wilder's explanation uses the values of  i = .02 and m= 0.20
  4655.  
  4656.        In ChartPro, this indicator is referred to as Technical Study 'PTP'
  4657.  
  4658.        sin       Trigonometric sine
  4659.        Usage: sin(a)
  4660.         of each entry in array 'a'
  4661.        Use sin_(n) for the sine of a single number.
  4662.  
  4663.  
  4664.        sqrt      Square root
  4665.        Usage: sqrt(a)
  4666.  
  4667.        of each entry in array 'a'.
  4668.        Use the sqrt_(n) function to compute the square root of a single
  4669.        number "n".
  4670.  
  4671.  
  4672.        std       Statistical Standard Deviation.
  4673.        Usage: std(d,p)
  4674.  
  4675.        Computes the standard deviation of the array 'd' using 'p' data
  4676.        points. Defined as the square root of the variance (see var below).
  4677.  
  4678.        stoch     Stochastic Oscillator
  4679.        Usage: stoch(p,s)
  4680.  
  4681.  
  4682.  
  4683.        TAS       Page 71   
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.             p = number of periods
  4694.             s = k slowing periods
  4695.        STOCH is a moving price velocity or momentum indicator.  Each
  4696.        element of the returned array is defined as follows:
  4697.  
  4698.        Return_Array[i] =
  4699.             ( (Close[i] - LV[i])/(HV[i] - LV[i]) ) * 100
  4700.        where:
  4701.  
  4702.          LV[i] is the "s" period low at p[i]; i.e., LV = llv(p,s)
  4703.          HV[i] is the "s" period high at p[i]; i.e., HV = hhv(p,s)
  4704.  
  4705.        Since there is no built-in smoothing, this function tends to
  4706.        exhibit erratic behaviour as it drops-off old data and picks-up new
  4707.        data.  This can be reduced by application of the moving average
  4708.        function (MOV).  Also, sell and buy signals can be defined for
  4709.        first moving-average levels above and below a second moving-average
  4710.        line of the same function.
  4711.  
  4712.        sub       Subtract one array from another
  4713.        Usage: sub(a,b)
  4714.  
  4715.        Subtract each element of array "b  from the corresponding element
  4716.        of array "a".
  4717.  
  4718.        sum       Sum array over period
  4719.        Usage: sum(a,p)
  4720.  
  4721.        Create a 'p' day summation of array 'a'.
  4722.        Sums the elements of array "a" over "p" days.  This function is
  4723.        similar to the CUM function, the difference being the cumulative
  4724.        sum for each element is limited to "p" days.
  4725.  
  4726.        tan       Trigonometric tangent
  4727.        Usage: tan(a)
  4728.  
  4729.        of each entry in array 'a'.
  4730.        Use tan_(n) for the tangent of a single number.
  4731.  
  4732.  
  4733.        trix      TRIX Function
  4734.        Usage: trix(p)
  4735.  
  4736.        Calculate a 1 day percent Rate of Change of a p day triple expo-
  4737.        nential moving average of the closing price.
  4738.        TRIX calculates a 1-day percent rate of change of a "p"-day triple
  4739.        exponential moving average of the closing price.
  4740.  
  4741.        Triple exponential smoothing essentially eliminates the influence
  4742.        of cycles shorter than "p" periods.
  4743.  
  4744.        If a 9-day (typical) moving average of the TRIX function were
  4745.        plotted along with the the TRIX function, buy would be indicated
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.        when TRIX moves above the moving average line, and sell would be
  4760.        indicated when TRIX moves below the line.
  4761.  
  4762.  
  4763.        tsf       Time Series Forecast
  4764.        Usage: tsf(a,p)
  4765.  
  4766.        This function computes a p day linear regression of the array a for
  4767.        each day.
  4768.  
  4769.        var       Statistical Variance
  4770.        Usage: var(d,p)
  4771.  
  4772.        of the array 'p' over the time period 'p'.
  4773.        Each element [i] of the returned array is the stastical variance of
  4774.        "p" data points taken from array "d" starting at element [i].
  4775.  
  4776.        Variance indicates how widespread the realizations of a function
  4777.        are likely to be.  This, it can serve as a predictive indicator.
  4778.  
  4779.        Variance is derived as follows:
  4780.  
  4781.        1.   Calculate the simple moving average of  data array d for p
  4782.          periods
  4783.             W = mov(d,p,'S').
  4784.  
  4785.        2.   Determine the difference between d and the simple moving
  4786.          average
  4787.             X = d-W
  4788.  
  4789.        3.   Sum the squares of the preceeding, and divide by p
  4790.           Y = X*X
  4791.           Z = sum(Y,p),
  4792.           Variance = Z/p.
  4793.        Note The square-root of the variance is the standard deviation (see
  4794.        STD function).
  4795.  
  4796.        vol       Volatility Indicator.
  4797.        Usage: vol(pm,pr)
  4798.  
  4799.        This is the 'pr' day Rate Of Change Oscillator of a 'pm' day ex-
  4800.        ponential Moving Average of the difference between each day's high
  4801.        and low price.
  4802.  
  4803.        wc        Weighted Close
  4804.        Usage: wc()
  4805.  
  4806.         defined as (2 * CLOSE + HIGH + LOW)/4
  4807.  
  4808.        willa     William's A/D
  4809.        Usage: willa()
  4810.  
  4811.        WILLA is a cumulative price indicator, for which a value for each
  4812.        day is added to the previous day's cumulative sum as follows:
  4813.  
  4814.  
  4815.        TAS       Page 73   
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.        If C[i] > C[i - 1], return array element [i] = value at [i - 1]
  4826.        plus the following accumulation amount:
  4827.           C[i] minus the smaller of C[i - 1] or L[i]
  4828.        If C[i] < C[i - 1], return array element [i] = value at [i - 1]
  4829.        plus the following accumulation amount:
  4830.           C[i] minus the larger of C[i - 1] or H[i]
  4831.  
  4832.        Divergence-based trading rules are:
  4833.  
  4834.        Sell if security goes to new high but WILLA does not go to new
  4835.        high.
  4836.        Buy if security goes to new low but WILLA noes not go to new low.
  4837.  
  4838.        Note The AD function is a similar indicator, except that it is
  4839.        based on volume instead of price.
  4840.  
  4841.  
  4842.        willr     William's %R
  4843.        Usage: willr(p)
  4844.  
  4845.        for 'p' periods. This is equivalent to a 'p' period stochastic with
  4846.        1 day smoothing. The result is then reduced by 100.
  4847.  
  4848.  
  4849.        zig       Zig Zag Function
  4850.        Usage: zig(a,r,t)
  4851.  
  4852.        Compute a ZIG ZAG function for array 'a'. 'r' is the minimum
  4853.        percentage or unit (dollar) change which must be made in order to
  4854.        reflect a change in the Zig Zag line. The third parameter 't' is
  4855.        either '%' or '$'. If it is '%', then the 'r' value is expressed as
  4856.        a percentage change, otherwise it is a unit (or dollar) change.
  4857.        If you want to see what kind of profits you could make, run the
  4858.        ZIG.PTS Profit Test file.  According the Equis Metastock User's
  4859.        Manual, "The Zig Zag indicator has 20/20 hindsight. Unfortunately,
  4860.        the Zig Zag's foresight is not as profitable. This is because the
  4861.        last "leg" of the Zig Zag indicator isn't fixed until future prices
  4862.        are known. If you use the Zig Zag  indicator to predict future
  4863.        prices, you are probably fooling yourself." Sorry, but that's the
  4864.        way it works. It is provided in TAS as a sort  of "benchmark" to
  4865.        judge how much the IDEAL strategy could SQUEEZE  out of a
  4866.        portfolio. It is nearly ideal, because it knows the future.
  4867.  
  4868.  
  4869.  
  4870.         TAS Functions
  4871.  
  4872.  
  4873.  
  4874.        addto     Add number to array
  4875.        Usage: addto(a,n)
  4876.  
  4877.        Adds the number "n" to each entry of array "a" and returns the
  4878.        result in an array.
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.        angle     Angle of a line
  4892.        Usage: angle(a)
  4893.  
  4894.        returns the angle in degrees of the line described by the array
  4895.        'a'. This function is only usable on an array that has been created
  4896.        by either linreg or linreg2.
  4897.        Do not confuse the angle returned by this function with the angle
  4898.        as viewed on a chart of a security. When you view a chart, your
  4899.        charting program most likely has scaled your view so that the zero
  4900.        y-axis is not visible. In addition, the angle on a screen monitor
  4901.        is distorted by the aspect ratio of your monitor (typically 4 wide
  4902.        by 3 high). The angle returned by this function is a true
  4903.        mathematical angle which is calculated using the (0,0) origin.
  4904.  
  4905.  
  4906.        alpha     Alpha function
  4907.        Usage: alpha()
  4908.  
  4909.        The alpha function is a "sister" function of the beta function.
  4910.        This function describes how much the stock's price would have moved
  4911.        on average on a yearly basis assuming the INDEX did not change. An
  4912.        alpha  of .20 means that the stock would have increased  20% more
  4913.        than the INDEX during the year.
  4914.        In terms of a two way linear regression (performed by the beta
  4915.        function), the alpha is  related to the y-intercept of the linear
  4916.        regression line.
  4917.        It is important to note that the alpha function must be called
  4918.        immediately after the beta function. At any other time, the results
  4919.        of the alpha  function are undefined.
  4920.  
  4921.        avgprc    Average Price
  4922.        Usage: avgprc()
  4923.  
  4924.        Creates an array where each entry is that day's (HIGH+LOW+CLOSE)/3
  4925.  
  4926.        bbandt    Top Bollinger Band
  4927.        Usage: bbandt(p,s)
  4928.  
  4929.        Bollinger Band upper (top) indicator for "p" periods with "s"
  4930.        standard deviations added to the p-day simple moving average.
  4931.  
  4932.        bbandb    Bottom Bollinger Band
  4933.        Usage: bbandb(p,s)
  4934.  
  4935.        Bollinger Band lower (bottom) indicator for "p" periods with "s"
  4936.        standard deviations subtracted from the p-day simple moving
  4937.        average.
  4938.  
  4939.        beta      "Beta" function
  4940.        Usage: beta(r)
  4941.  
  4942.        The beta function calculates the linear regression of the
  4943.        percentage rate of change of the closing price (of the current
  4944.  
  4945.  
  4946.  
  4947.        TAS       Page 75   
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.        ticker being processed) to the percentage rate of change of the
  4958.        INDEX.
  4959.        Values of r, the rate of change period, are
  4960.             'D'  Daily rate of change
  4961.             'W'  Weekly rate of change
  4962.             'M'  Monthly rate of change
  4963.        The weekly rate of change calculates the rate of change from Friday
  4964.        to Friday and the monthly rate of change calculates the rate of
  4965.        change from the first of each month.
  4966.  
  4967.        The actual value returned by the beta function is the slope of the
  4968.        line created by this two way linear regression.
  4969.  
  4970.        The purpose of the beta function is to measure the stock's sen-
  4971.        sitivity to movement in the general market over the period of time
  4972.        chosen. A beta value of 2.00 means that the stock tends to move
  4973.        with the market, but 2 times as far (percentage change is twice as
  4974.        much). A beta of -.5 means that the stock moves in the opposite
  4975.        direction of the market, but only one half as far.
  4976.  
  4977.        compress  Date Compression
  4978.        Usage: compress(cfactor)
  4979.        Compress will compress a security file's data by amount specified
  4980.        by cfactor.
  4981.        cfactor can have the following values:
  4982.             W    weekly compression
  4983.             M    monthly compression
  4984.             Y    yearly compression
  4985.             n    any number of bars to be summed for compression
  4986.        The cfactor parameter, if it is a letter, must be enclosed in
  4987.        single quotes. For example, to compress daily to weekly data, you
  4988.        would use
  4989.          Compress('W');
  4990.        Compression points for the different periods are:
  4991.        Weekly : the Friday of the week
  4992.        Monthly : the end of the month
  4993.        Yearly : the end of the year
  4994.        This function is only valid within a Prolog statement. After the
  4995.        Prolog statement runs, the data compression value cannot be
  4996.        changed.
  4997.  
  4998.        const     Constant Array
  4999.        Usage: const(n)
  5000.  
  5001.        The const(n) function returns an array containing a "constant"
  5002.        value n.  For example, CONST(100) creates an array that contains
  5003.        the number 100 in each element of the array. Contrast this to the
  5004.        SET function which sets an array to a constant value. CONST is
  5005.        preferable to SET, since its result can be used in a formula.
  5006.  
  5007.  
  5008.        corrcoef  Correlation Coefficient
  5009.        Usage: corrcoef()
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.        returns the "correlation coefficient" of the last linear regression
  5024.        performed. This value ranges from -100 to +100. If the data points
  5025.        match the points in the linear regression approximation, the
  5026.        correlation coefficient will be 100. If the points show no
  5027.        correlation with the approximation, the correlation coefficient
  5028.        will be zero.
  5029.  
  5030.  
  5031.        datestr   Create a formatted date
  5032.        Usage: datestr(d)
  5033.  
  5034.        Create a "date string" in the form MM/DD/YY from the DATES array
  5035.        entry 'd'.
  5036.  
  5037.  
  5038.        daymon    Day of Month function
  5039.        Usage: daymon(d)
  5040.  
  5041.        Returns the "DAY OF THE MONTH" of the DATE contained in variable
  5042.        "d". The value returned is the day of the month. For example,
  5043.        daymon(910204) will return 4.
  5044.  
  5045.  
  5046.        daywk     Day of Week function
  5047.        Usage: daywk(d)
  5048.  
  5049.        Returns the "DAY OF THE WEEK" of the DATE contained in variable
  5050.        "d". The value returned is a number from 0 to 6, where 0 is Sunday,
  5051.        1 is Monday, 2 is Tuesday, 3 is Wednesday, 4 is Thursday, 5 is
  5052.        Friday and 6 is Saturday.
  5053.  
  5054.        defined   Check if variable exists
  5055.        Usage: defined(v)
  5056.  
  5057.        Returns zero if the variable v has not been defined or used prior
  5058.        to this point in the script. This function is used frequently when
  5059.        you  have a script that can be passed variable values from the DOS
  5060.        command line. If no variable values are passed on the command line,
  5061.        you would want to set the variables to some "default" value.
  5062.        Example:
  5063.        The script is written to use the moving average period contained in
  5064.        the variable period. If the period value is specified on the
  5065.        command line, it should use that value, but if not, it should use
  5066.        21. The script would be written as follows:
  5067.        IF NOT DEFINED(period) THEN
  5068.             PERIOD = 21;
  5069.        MA = MOV(C,PERIOD,'S');
  5070.        You could invoke the script using the parameter @PERIOD=50 to use a
  5071.        50 day period, or if you didn't specify anything, the script would
  5072.        use a 21 day period.
  5073.  
  5074.        divby     Divide array by number
  5075.        Usage: divby(a,x)
  5076.  
  5077.  
  5078.  
  5079.        TAS       Page 77   
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.        Divide each element of array "a" by the value of "x". In this case,
  5090.        "x" is a single number.
  5091.  
  5092.  
  5093.        dump_array Dump Array Contents
  5094.        Usage: dump_array(a1,a2...aN)
  5095.  
  5096.        Dump the contents of arrays"a1" to "aN" to the screen or a file.
  5097.        Each entry in the array is shown as a decimal number with the entry
  5098.        number in square brackets to the left, followed by the date.
  5099.        DUMP_ARRAY can be called with up to 12 array names. They will be
  5100.        printed side-by-side on the display.
  5101.        This function is useful for checking out the contents of an ar-
  5102.        ray...in other words, it is a debugging tool, not a report generat-
  5103.        ing tool.
  5104.  
  5105.        expand    Expand formatted string
  5106.        Usage: expand(format_string,v1,v2,....,vN)
  5107.  
  5108.        The expand function will "expand" the variables v1,v2,...vN
  5109.        according to the format specification given by the format_string.
  5110.        The function returns a string variable which can be printed, or
  5111.        displayed, just as the format function does.
  5112.        Example
  5113.        Suppose the current close for IBM is 48.75, the high is 52.375. To
  5114.        print the close, the high and the 21 day Moving Average (without
  5115.        decimal point), you could say
  5116.        WriteLn(Expand('%s %7.2f %7.2f %5.0f',
  5117.             Ticker,
  5118.             Close,
  5119.             High,
  5120.          Mov(Close,21,'S')));
  5121.        which will print
  5122.        IBM    48.75   52.38  49
  5123.        See the description of Format Specifiers (page 87) for a
  5124.        description of the format_strings you can use.
  5125.  
  5126.        findfst   Find first value
  5127.        Usage: findfst(a,v)
  5128.  
  5129.        findfst finds the first occurance of the numeric value v in the
  5130.        array a and returns the day index (negative days in the past) on
  5131.        which the value occurred. If the value v was not found in a, the
  5132.        findfst function returns a positive number.
  5133.  
  5134.        findlst   Find last value
  5135.        Usage: findlst(a,v)
  5136.  
  5137.        findlst finds the last occurance of the numeric value v in the
  5138.        array a and returns the day index (negative days in the past) on
  5139.        which the value occurred. If the value v was not found in a, the
  5140.        findlst function returns a positive number.
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.        findstr   Find substring
  5156.        Usage: findstr(s1,s2)
  5157.  
  5158.        The findstr function will return the location of string s2 in
  5159.        string s1. If the string s2 is not found in s1, the result is 0.
  5160.  
  5161.        future    Future array element
  5162.        Usage: future(a,n)
  5163.  
  5164.        This function can be used in a profit test to "cheat" by looking
  5165.        into the "future" to a date that is not currently under investiga-
  5166.        tion by the profit test routines. The function returns the value of
  5167.        the array "a" as of the point "n" days into the future.
  5168.  
  5169.  
  5170.        int       Create Integer
  5171.        Usage: int(x)
  5172.  
  5173.        Turns the number "x" into an "integer" by dropping any part of the
  5174.        number to the right of the decimal point. An integer is a number
  5175.        without a fractional part (the part after the decimal). The maximum
  5176.        number that you can turn into an integer is 32,767.
  5177.  
  5178.  
  5179.        isect     Find array intersection
  5180.        Usage: isect(a,b)
  5181.  
  5182.        Find the latest intersecting point of the two arrays "a" and "b".
  5183.        Returns the number of days since the two arrays intersected (as a
  5184.        negative number) or 1 (positive one) if they have never
  5185.        intersected.
  5186.  
  5187.        NOTE:
  5188.        Since the graph of the two arrays actually crosses BETWEEN two
  5189.        days, the value returned will be the later day AFTER the crossing.
  5190.        For example, if the arrays crossed between yesterday and today, the
  5191.        value returned will be zero. If they crossed between two days ago
  5192.        and yesterday, the value returned will be -1, and so forth.
  5193.  
  5194.  
  5195.        linreg    Linear Regression
  5196.        Usage: linreg(a,s,e)     
  5197.  
  5198.        Create a linear regression line using "least-squares" method to
  5199.        find the mathematical average of the values in the array "a"
  5200.        starting at entry "s" and ending at entry "e". If "s" is zero, it
  5201.        refers to the first value in the array. If "e" is zero, it refers
  5202.        to the last value in the array. Positive values for "s" or "e"
  5203.        refer to the appropriate array entries (counting from 0).
  5204.        A negative number in the "s" or "e" index is subtracted from the
  5205.        total number of entries in the array to get the appropriate posi-
  5206.        tive array index. For example,
  5207.                  x : array;
  5208.                  x = linreg(c,-50,-10);
  5209.  
  5210.  
  5211.        TAS       Page 79   
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.        will find the line passing most closely through the closing prices
  5222.        from 50 days before the last day in the file to 10 days before the
  5223.        last day in the file.
  5224.  
  5225.  
  5226.        linreg2   2 Way Linear Regression
  5227.        Usage: linreg2(y,x,s,e)
  5228.  
  5229.        Create a linear regression line using "least-squares" method to
  5230.        find the mathematical  average of the values in the array y over
  5231.        the array x starting at entry "s" and ending at entry "e". If "s"
  5232.        is zero, it refers to the first value in the array. If "e" is zero,
  5233.        it refers to the last value in the array. Positive values for "s"
  5234.        or "e" refer to the appropriate array entries (counting from 0).
  5235.          A negative number in the "s" or "e" index is subtracted from the
  5236.        total number of entries in the array to get the appropriate
  5237.        positive array index. For example,
  5238.                  x : array;
  5239.                  x = linreg2(c,v,-50,-10);
  5240.        will find the line passing most closely through the closing prices
  5241.        and volume from 50 days before the last day in the file to 10 days
  5242.        before the last day in the file.
  5243.  
  5244.  
  5245.        load      Load a data array
  5246.        Usage: load(t,f)
  5247.  
  5248.        The load function will retrieve the first occurrence of a ticker
  5249.        from the historical data directories. The ticker is specified as
  5250.        the first parameter to the load function.
  5251.  
  5252.        The second parameter of the load function is the field to be loaded
  5253.        from the ticker file. The name of the field must be surrounded by
  5254.        single quotes or it must be a string variable containing the name
  5255.        of the field. The field names are the same as the pre-defined data
  5256.        array names, that is, C for closing price, H for high price, etc.
  5257.  
  5258.        The value returned from the load function is an array containing
  5259.        the portion of the ticker file requested by the field name.
  5260.  
  5261.  
  5262.        macdx     MACD Extended
  5263.        Usage: macdx(s,l,t)
  5264.  
  5265.        Compute an MACD indicator using a short term EMA of "s" periods, a
  5266.        long term EMA of "l" periods, and a trigger line of "t" periods. 
  5267.  
  5268.        max       Maximum value of a pair
  5269.        Usage: max(a,b)
  5270.        This function will return the maximum number between a pair of
  5271.        numbers. The statement
  5272.             result = max(a,b);  
  5273.        is equivalent to
  5274.             If a > b then result = a else result=b
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.        maxPair   Maximum value of two arrays
  5288.        Usage: maxPair(a,b)
  5289.        This function will create an array containing the pair by pair
  5290.        maximum values in the arrays a and b. The statement
  5291.             result : array;
  5292.             result = maxPair(a,b);   
  5293.        is equivalent to
  5294.             result : array;
  5295.             For Each Point using I
  5296.                  If a[I]> b[I] then
  5297.                       result[I] = a[I]
  5298.                  else
  5299.                       result[I] = b[I]
  5300.  
  5301.        maxVal    Maximum value in array
  5302.        Usage: maxVal(a)
  5303.        This function will return the maximum value in the array a. The
  5304.        statement
  5305.             result = maxVal(a); 
  5306.        is equivalent to
  5307.             result = 0;
  5308.             For Each Point using I
  5309.                  If a[I]> result then result = a[I]
  5310.  
  5311.  
  5312.        maxQuotes Set Maximum Data Points
  5313.        Usage: maxQuotes(n)
  5314.        Sets the maximum data points (quotes) that will be read in for each
  5315.        security.
  5316.        This function is only valid within a Prolog statement. After the
  5317.        Prolog statement runs, the maximum data points cannot be changed.
  5318.  
  5319.        memleft   Show remaining memory
  5320.        Usage:memleft()
  5321.        The memleft function will return the number of bytes of  available
  5322.        memory.
  5323.  
  5324.        mfi       Money Flow Index
  5325.        Usage: mfi(p)
  5326.  
  5327.        as described in Equis "The Pointer" Volume 5, Number 4 and
  5328.        corrected in Vol 6, Number 1.
  5329.  
  5330.        min       Minimum value of a pair
  5331.        Usage: min(a,b)
  5332.        This function will return the minimum number between a pair of
  5333.        numbers. The statement
  5334.             result = min(a,b);  
  5335.        is equivalent to
  5336.             If a < b then result = a else result=b
  5337.  
  5338.        minPair   Minimum value of two arrays
  5339.        Usage: minPair(a,b)
  5340.  
  5341.  
  5342.  
  5343.        TAS       Page 81   
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.        This function will create an array containing the pair by pair
  5354.        minimum values in the arrays a and b. The statement
  5355.             result : array;
  5356.             result = minPair(a,b);   
  5357.        is equivalent to
  5358.             result : array;
  5359.             For Each Point using I
  5360.                  If a[I]< b[I] then
  5361.                       result[I] = a[I]
  5362.                  else
  5363.                       result[I] = b[I]
  5364.  
  5365.  
  5366.        minVal    Minimum value in array
  5367.        Usage: maxVal(a)
  5368.        This function will return the minimum value in the array a. The
  5369.        statement
  5370.             result = minVal(a); 
  5371.        is equivalent to
  5372.             result = 9999999;
  5373.             For Each Point using I
  5374.                  If a[I]< result then result = a[I]
  5375.  
  5376.  
  5377.        month     Month function
  5378.        Usage: month(d)
  5379.  
  5380.        Returns the Month (1-12) of the date value contained in the
  5381.        parameter.
  5382.  
  5383.        mulby     Multiply by number
  5384.        Usage: mulby(a,x)
  5385.  
  5386.        Multiply each element of array "a" by the value of "x". In this
  5387.        case, "x" is a single number.
  5388.  
  5389.  
  5390.        now       Current date
  5391.        Usage: now()
  5392.  
  5393.        Returns the current date at the time TAS is running. This date is a
  5394.        Date type variable in the form yymmdd.
  5395.  
  5396.        outputFile     Specify listing file
  5397.        Usage: outputFile(f)
  5398.  
  5399.        The outputFile function can be used to set the file name f into
  5400.        which the script output is to be directed.
  5401.  
  5402.        over      Over function
  5403.        Usage: over(a,b)
  5404.  
  5405.        If array "a" is "over" array "b", this function returns the number
  5406.        of days since array "a" crossed above(or over) array "b".  See the
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.        description of the isect function page 79 for the values returned
  5420.        when the arrays cross.
  5421.        This function is especially useful to test for a crossover
  5422.        situation. If you want to know if the close just crossed  "over"
  5423.        the 21 day moving average of the close, you can say
  5424.        if over(Close,Mov(Close,21,'E')) = 0 Then
  5425.             writeln('Close crossed EMA today');
  5426.  
  5427.        pause     Wait for keyboard input
  5428.        Usage: pause(s)
  5429.  
  5430.        The pause function will wait for up to s seconds or until a
  5431.        keystroke is pressed.
  5432.  
  5433.        peak      Find Peak in Array
  5434.        Usage: peak(a,n)
  5435.  
  5436.        returns the index of the 'n'-th peak value in array 'a'. A 'peak'
  5437.        is defined as a high value surrounded by lower values. The value
  5438.        returned from this function is the array index to the peak value.
  5439.  
  5440.  
  5441.  
  5442.        In the figure above, the peak(C,2) call would return the index of
  5443.        the point marked P2. If you consider the volume vertical bars a
  5444.        day, then the value returned in this example would be '-13', or 13
  5445.        days prior to the last day.
  5446.  
  5447.  
  5448.        per1      Performance using Array
  5449.        Usage: per1(a)
  5450.  
  5451.        Computes the "performance indicator" for an array a. The per-
  5452.        formance indicator is computed as
  5453.                  
  5454.  
  5455.                            
  5456.  
  5457.        redo      Rerun profit test   
  5458.        Usage: redo()
  5459.  
  5460.        The redo() function causes a profit test to be rerun again. The
  5461.        redo_count() function (below) returns a value one greater than the
  5462.        last time it was called.
  5463.  
  5464.        redo_count     Profit Test Reruns
  5465.        Usage: redo_count()
  5466.  
  5467.        The redo_count() function returns the number of times a redo()
  5468.        function has been called for the same security file. It can be used
  5469.        to rerun a profit test with different variable values (i.e.,
  5470.        optimize).
  5471.  
  5472.  
  5473.  
  5474.  
  5475.        TAS       Page 83   
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.        set       Set Array to Value
  5486.        Usage: set(a,v)
  5487.  
  5488.        Sets all entries in array 'a' to the value 'v'. For example, you
  5489.        could use this function to create an array where each entry is
  5490.        22.5.
  5491.  
  5492.        sign      Sign of array entries
  5493.        Usage: sign(a)
  5494.  
  5495.        This function will create an array of the "signs" of each entry in
  5496.        the array a.
  5497.        The statements
  5498.             result : array;
  5499.             result = sign(a);
  5500.        is equivalent to
  5501.             For each Point using  I
  5502.                  if a[I] > 0 then
  5503.                       result[I] = +1
  5504.                  else
  5505.                  if a[I] < 0 then
  5506.                       result[I] = -1
  5507.                  else
  5508.                       result[I] = 0;
  5509.  
  5510.        slope     Slope of Line
  5511.        Usage: slope(a)
  5512.  
  5513.        will return the mathematical "slope" of the line whose points are
  5514.        contained in array "a". This array must have been created with the
  5515.        linreg function.
  5516.        The slope m of a line is defined according to the following formula
  5517.          y = mx + b
  5518.          m = (y-b)/x
  5519.        The slope of a linear regression line is simply the average change
  5520.        in the y-value of the data array (e.g., price) divided by the
  5521.        number of price bars (e.g. "days") over which the change is
  5522.        calculated. A 5 point rise over 10 days would be a slope of 5/10 or
  5523.        0.50.
  5524.  
  5525.        strlen    String Length
  5526.        Usage: strlen(s)
  5527.  
  5528.        The strlen function will return the length of the string variable
  5529.        "s" as an integer. For example,
  5530.             X = strlen('IBM');
  5531.        will set X to 3.
  5532.  
  5533.        strrep    String Replace
  5534.        Usage: strrep(s1,s2,n)
  5535.  
  5536.        will return a string whose n'th position is replaced in s1 by s2
  5537.        for a length equal to the length of s2.
  5538.        For example,
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.             a = 'abcdef';
  5552.             x = strrep(a,'gh',2);
  5553.             writeln(x);
  5554.        would print  'aghdef'
  5555.  
  5556.        subfrom   Subtract number from array
  5557.        Usage: subfrom(a,n)
  5558.  
  5559.        Subtract the number "n" from each entry in array "a" returning the
  5560.        result in an array.
  5561.  
  5562.        substr    Substring function
  5563.        Usage: substr(s,b,l)
  5564.  
  5565.        The substr function takes a string "s" as the first argument and
  5566.        extracts the substring starting at character position 'b" for the
  5567.        length "l".  For example,
  5568.             X = substr('ABCDEF', 2,4)
  5569.        will create set the variable X to the string 'BCDE'.
  5570.  
  5571.        trendline Create a Trendline
  5572.        Usage: trendline(a,s,e)
  5573.  
  5574.        Generate a line going through the points in array a from the day
  5575.        index s to the day index e.
  5576.        Example:
  5577.             x : array;
  5578.             x = trendline(C,-10,-2);
  5579.        creates a "line" that begins at and passes through the close 10
  5580.        days in the past and ends at the point two days in the past.
  5581.  
  5582.        trendpar  Parallel Trendline
  5583.        Usage: trendpar(a,t,s)
  5584.  
  5585.        trendline's sister function  trendpar will draw a parallel line to
  5586.        trendline t, running through day s in array a.
  5587.  
  5588.  
  5589.        trough    Find Trough in Array
  5590.        Usage: trough(a,n)
  5591.  
  5592.        returns the index of the 'n'-th "trough" value in array 'a'. A
  5593.        'trough' is defined as a low value surrounded by higher values. The
  5594.        value returned from this function is the array index to the trough
  5595.        value.
  5596.  
  5597.        In the figure shown with the peak function above, the trough(C,2)
  5598.        call would return the index of the point marked 'T2'.  Based on the
  5599.        volume bars shown, the value returned in this example would be
  5600.        '-11', or 11 days prior to the last day.
  5601.  
  5602.  
  5603.        tr        Wilder's True Range
  5604.        Usage: tr()
  5605.  
  5606.  
  5607.        TAS       Page 85   
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.  
  5618.        This function creates an array containing for each day, the higher
  5619.        of the following differences :
  5620.        Between today's high and today's low.
  5621.        Between today's high and yesterday's close.
  5622.        Between today's low and yesterday's close.
  5623.             
  5624.        The value of tr() for any day is always positive or zero.
  5625.  
  5626.        trim      Trim blanks from a string
  5627.        Usage: trim()
  5628.  
  5629.        This function takes a string variable as input and returns a string
  5630.        variable as the return value. The returned string variable has all
  5631.        spaces removed from the right hand portion.
  5632.  
  5633.        year      Year function
  5634.        Usage: year(d)
  5635.  
  5636.        Returns the Year (0-99) of the date value contained in the
  5637.        parameter.
  5638.  
  5639.  
  5640.        zero      Zero Array
  5641.        Usage: zero(a)
  5642.  
  5643.        Sets each entry of array 'a' to zero. See the const function for a
  5644.        more flexible method of setting an array to a constant value.
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.                              Input/Output Functions
  5684.  
  5685.  
  5686.  
  5687.  
  5688.         WRITE and WRITELN  Functions
  5689.  
  5690.  
  5691.        There are two direct output functions, WRITE and WRITELN. The
  5692.        WRITELN function is identical to the WRITE function, except that
  5693.        WRITELN causes a NEW LINE to be added at the end of the last field.
  5694.  
  5695.        The parameters to WRITE (and WRITELN) are either text strings, like
  5696.        'this is a text string', surrounded by single quotes ('), or
  5697.        "variable values". A variable value is a value that you have
  5698.        assigned to a name by use of a formula or constant setting. There
  5699.        are "pre-defined" variables, such as H, L, C, V, O, TICKER,
  5700.        FULLNAME. These pre-defined variables are "filled in" when TAS
  5701.        reads the data values for each symbol.
  5702.  
  5703.        You can control the formatting of your output to some extent by
  5704.        using the characters sequence "\t" (backslash tee) in your text
  5705.        string. This will place a "tab" character in the output. TAS places
  5706.        "tab stops" every 4 columns of the output line.
  5707.  
  5708.        You can cause a new page to be printed by placing a "\p" (pagefeed)
  5709.        in your WRITELN string.
  5710.  
  5711.        In addition, the sizes of the two types of "numbers", are constant.
  5712.        If you are printing an INTEGER value, it is five characters wide,
  5713.        left-justified. If you are printing a number with a decimal point,
  5714.        it is eight characters wide (99999.999). This will allow you to
  5715.        line up the output with column headings.
  5716.  
  5717.  
  5718.  
  5719.         FORMAT Function
  5720.  
  5721.  
  5722.        The FORMAT function can be used to precisely control the way
  5723.        numbers print. This function takes two arguments. The first
  5724.        argument is the number to be formatted. The second argument is a
  5725.        "format specifier" string.
  5726.  
  5727.  
  5728.  
  5729.         Format Specifiers
  5730.  
  5731.  
  5732.        A format specifier string is  is formed as follows:
  5733.          % [width] [.prec] [type]
  5734.  
  5735.        The [width] is the minimum number of characters to print.
  5736.  
  5737.  
  5738.  
  5739.        TAS       Page 87   
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.        The [.prec] is the maximum number of characters to print or the
  5750.        minimum number of digits to print.
  5751.  
  5752.          [type] for the FORMAT function can only be
  5753.          'f'  for REAL numbers
  5754.  
  5755.        For example, to print the closing price without the decimal point
  5756.        normally printed with the WRITELN fucntion, you could say
  5757.             writeln('Closing price is ',format(c of today,'%4.0f'));
  5758.  
  5759.        This would print the closing price in a field that is 4 characters
  5760.        wide with zero decimal places. Note also that the closing price
  5761.        printed would be rounded to the nearest integer.
  5762.  
  5763.  
  5764.  
  5765.         SORT Functions
  5766.  
  5767.  
  5768.        TAS contains functions which can be used to sort your report
  5769.        output. Rather than doing WRITE and WRITELN, you can call the
  5770.        SORTOUT function to place the report data in a "sort buffer". Once
  5771.        all the tickers have been processed (when LAST_TICKER is 1), you
  5772.        can then sort the data using the SORTON function. Finally, you can
  5773.        retrieve the sorted "lines" with the SORTGET function or print them
  5774.        with the SORTPRINT function.
  5775.  
  5776.        If you want to experiment with the SORT commands, you should start
  5777.        out simply and then work toward more complex combinations. These
  5778.        are advanced functions and are not necessarily appropriate for the
  5779.        person who doesn't want to plan their requirements.
  5780.  
  5781.        In order to understand how the  sort commands work, you need to
  5782.        understand some terms. The first term is a  "line".  Each time you
  5783.        use the SORTOUT function, you give it a "line" of data which is
  5784.        placed in the "sort buffer". Each "line" is composed of 'columns".
  5785.        A "column" is a group of data values that are repeated for each
  5786.        SORTOUT function.  So, for example, if you wanted to create a list
  5787.        of TICKERs and their Closing Prices, you would have two "columns",
  5788.        the TICKER and the Closing Price for the ticker. The "line" would
  5789.        consist of the combination of the TICKER and Closing Price.
  5790.  
  5791.        SORTOUT
  5792.        The SORTOUT function takes up to 40 parameters which are fields to
  5793.        be placed in the 'sort buffer'. As each ticker is processed, you
  5794.        can place the computed results in the 'sort buffer'.
  5795.  
  5796.        For example, suppose you wanted to create a report of tickers in
  5797.        order by their volume. You wanted the report to contain the TICKER,
  5798.        the High, Low and Closing prices as well. For each ticker you would
  5799.        say
  5800.        SORTOUT(TICKER,H,L,C,V);
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.        SORTON
  5816.        Once all tickers have been processed, and their lines of data have
  5817.        been placed in the sort buffer using the SORTOUT function, you can
  5818.        sort the lines of data with the SORTON function. The SORTON
  5819.        function requires pairs of two parameters as follows:
  5820.  
  5821.        SORTON(column_number_1, direction_1,column_number_2,
  5822.        direction_2,....,column_number_N,direction_N)
  5823.  
  5824.        where:
  5825.          column_number_*    is the parameter position of the data field
  5826.                  (column) in the SORTOUT command that placed the data in
  5827.                  the sort buffer.
  5828.          direction_*   is either 'a' for ASCENDING or 'd' for DESCENDING
  5829.                  sort.
  5830.  
  5831.        The SORTON function will sort first on column_number_1 in di-
  5832.        rection_1, then on the next column/direction pair, etc.
  5833.        Using the example given in the SORTOUT description above, since the
  5834.        report was to be sorted by VOLUME, that is the 5th parameter
  5835.        position ("column") in the SORTOUT function shown.
  5836.  
  5837.        The SORTON function returns as its value the number of records in
  5838.        the sort buffer.
  5839.  
  5840.        SORTGET
  5841.        After a SORTON function is called, the data in the sort array is in
  5842.        some particular sorting order. If you want to retrieve each "line"
  5843.        from the sort array, one at a time, you can use the SORTGET
  5844.        function.  When you use the SORTGET function, you are asking TAS to
  5845.        "retrieve" the columns of data in the next line from the sort
  5846.        buffer and to place those data values in the variables you specify
  5847.        as parameters to the SORTGET function.
  5848.  
  5849.        After the SORTGET function returns, the variables you named in the
  5850.        SORTGET function call will be "filled in" with the values from the
  5851.        next line (in sequence) of the sort buffer.
  5852.  
  5853.        SORTGET(v1,v2,v3,....,vN)
  5854.  
  5855.        where
  5856.          v1   is the first variable to be filled in by SORTGET
  5857.          v2   is the second variable to be filled in by SORTGET,
  5858.        and
  5859.           vN   is the last variable to be filled in by SORTGET. The
  5860.                  number "N" must be exactly equal to the number of
  5861.                  parameters used in the SORTOUT command that filled in
  5862.                  the sort buffer.
  5863.  
  5864.        The SORTGET function returns as its value a 1 (one) if the
  5865.        variables were "filled in" by a record from the sort buffer and 0
  5866.        (zero) if not.  This returned value can be used in a WHILE loop to
  5867.        determine when the last sort record has been obtained.
  5868.             
  5869.  
  5870.  
  5871.        TAS       Page 89   
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.        SORTPRINT
  5882.        The trickiest part of using the SORT feature is the specification
  5883.        of the 'format string' used by the SORTPRINT function. If you have
  5884.        access to a C Programming book, you will find the format
  5885.        specifications under the PRINTF() function description. Short of
  5886.        that, a summary of the types of format specifiers follows:
  5887.  
  5888.        A format specifier is formed as follows:
  5889.          % [width] [.prec] [type]
  5890.  
  5891.        The [width] is the minimum number of characters to print.
  5892.  
  5893.        The [.prec] is the maximum number of characters to print or the
  5894.        minimum number of digits to print.
  5895.  
  5896.        [type] is one of three values:
  5897.          'ld' for INTEGER values (result of INT() function)
  5898.          'f'  for REAL numbers (most results)
  5899.          's'  for a STRING CONSTANT (like TICKER or DATE)
  5900.  
  5901.        So, to print the results of the SORTOUT request given above, there
  5902.        must be five format specifiers (since there are five parameters to
  5903.        SORTOUT). The first parameter is the TICKER (which is a 'string')
  5904.        so its format specifier would simply be '%s'.
  5905.  
  5906.        The next three fields are all 'real' numbers (that is, they have
  5907.        decimal points), so their format could be '%7.3f' which would say,
  5908.        make the field 7 characters wide, and include three decimal places,
  5909.        like this '999.999', so this will work fine unless the price is
  5910.        greater than 1000. If it were, you could make the field '%8.3f' to
  5911.        add more room at the left.
  5912.  
  5913.        Finally, the last field, V (VOLUME) does not contain any portion
  5914.        beyond the decimal point. That is, shares are reported in whole
  5915.        numbers. But, because Volume is typically larger than the maximum
  5916.        value of an "integer" field (32,767) , it is also a 'REAL' number.
  5917.        To make the volume field report in whole units, without a decimal
  5918.        point, you would say '%8.0f' which would place volume in an eight
  5919.        character field with no decimal.
  5920.  
  5921.        So, the format string for the SORTPRINT would be:
  5922.        SORTPRINT('%s %7.2f %7.2f %7.2f %8.0f\n');
  5923.  
  5924.        The '\n' at the end of the SORTPRINT format string is to start a
  5925.        NEW LINE after printing this line.
  5926.  
  5927.  
  5928.  
  5929.         Column Headings
  5930.  
  5931.  
  5932.        For an example of controlling the printing of 'headings' in your
  5933.        TAS output, go to the section describing the pre-defined variable
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.        FIRST_TICKER. Using this variable, you can determine when to print
  5948.        a heading initially in your report.
  5949.  
  5950.        In addition, since all variables are initially set to zero before
  5951.        the first TICKER file is processed, you can use a variable to accu-
  5952.        mulate a "line count". You can test this variable and generate a
  5953.        new heading each time it is greater than the number of lines on
  5954.        your page (e.g. 66). An example of how to place a heading on each
  5955.        page of the report follows:
  5956.  
  5957.        IF FIRST_TICKER OR (LINE_COUNT > 65) THEN
  5958.        BEGIN
  5959.        LINE_COUNT = 0;
  5960.        WRITELN('YOUR REPORT HEADING WOULD GO HERE');
  5961.        END;
  5962.  
  5963.  
  5964.        Then, each time you wrote a line in your script you would execute
  5965.        the statement: LINE_COUNT = LINE_COUNT + 1;
  5966.  
  5967.  
  5968.  
  5969.         ASCII File Functions
  5970.  
  5971.  
  5972.  
  5973.        AOpen     Open ASCII file
  5974.        Usage: handle = AOpen(name,type)
  5975.        The AOpen function will open the file named name for either reading
  5976.        or writing, depending on the contents of the type parameter. If
  5977.        type is 'r', the file will be opened for reading. If type is 'w',
  5978.        it will be opened for writing.
  5979.        The handle value returned by the function is a number which is used
  5980.        to tell the other file functions which file you are referring to.
  5981.        You can have more than one file of this sort opened at the same
  5982.        time.
  5983.  
  5984.        Example:
  5985.        Suppose you have a file named STOCK.DAT which contains three items
  5986.        per line. The first item is a security name, the second is a number
  5987.        of shares purchased, and the third is the purchase date. You could
  5988.        read each line and print it with the script below:
  5989.        StockName is a String;
  5990.        NumberOfShares is a Number;
  5991.        DatePurchased is a Number;
  5992.        hp = Aopen('STOCK.DAT','r');
  5993.        While (AGet(hp,StockName,NumberOfShares, DatePurchased))
  5994.        Begin
  5995.          WriteLn(StockName,NumberOfShares,DatePurchased);
  5996.        End
  5997.        AClose(hp);
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.        TAS       Page 91   
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.        AClose    Close ASCII file
  6014.        Usage: AClose(handle)
  6015.        The AClose function closes and releases the file which was opened
  6016.        with handle.
  6017.        See the AOpen description for an example.
  6018.  
  6019.        APut      Put Line to ASCII file
  6020.        Usage: APut(handle,v1,v2,...vN)
  6021.        The APut function will put the variables v1,v2,...vN to the file
  6022.        whose handle was returned by an AOpen function. This function will
  6023.        only work if the file was AOpen'd for writing.
  6024.        Example:
  6025.        Suppose you want to create a ticker list from a script while
  6026.        generating some report or other scanning results. You only want to
  6027.        include those securities whose Close has crossed their 21 day
  6028.        moving average in your ticker list:
  6029.        Prolog Begin
  6030.             handle = AOpen('BUYLIST.TCK','w');
  6031.        End;
  6032.        If Over(C,Mov(C,21,'E')) <= 0 Then
  6033.             APut(handle,Ticker);
  6034.        Epilog
  6035.             AClose(handle);
  6036.  
  6037.  
  6038.        AGet      Get Line from ASCII file
  6039.        Usage: AGet(handle,v1,v2,...vN)
  6040.        The AGet function will read the variables v1,v2,...vN from the file
  6041.        whose handle was returned by an AOpen function. This function will
  6042.        only work if the file was AOpen'd for reading.
  6043.        In order for the AGet function to work correctly, you must pre-
  6044.        declare each variable prior to using it in the AGet function. This
  6045.        can be done by either assigning something of the correct type to
  6046.        it, or by declaring it (as shown in the AOpen example on page 91).
  6047.  
  6048.  
  6049.  
  6050.         User Input Function
  6051.  
  6052.  
  6053.  
  6054.        Ask       Get User Input
  6055.        Usage: Ask(p1,v1,p2,v2,...,pN,vN)
  6056.        The Ask function builds an input panel with prompt text p1,p2,...pN
  6057.        and gets input into variables v1,v2,...,vN.
  6058.        As described in the AGet function above,  you must pre-declare each
  6059.        variable prior to using it in the Ask function. This can be done by
  6060.        either assigning something of the correct type to it, or by
  6061.        declaring it (as shown in the AOpen example on page 91).
  6062.        Example:
  6063.        You want to write a script that can be used to check for 21 day
  6064.        exponential moving average crossovers, but you don't want to change
  6065.        the script each time you want to change either the moving average
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.        period or the moving average type. You can use the Ask function to
  6080.        get the period and type of moving average when you run the script.
  6081.        Prolog Begin
  6082.             Period  =  21;
  6083.             Type = 'E';
  6084.             Ask('Enter Moving Average Period',Period,
  6085.                  'Enter Moving Average Type (S,E,W)',Type);
  6086.        End;
  6087.        If Over(C,Mov(C,Period,Type)) <= 0  Then
  6088.             WriteLn(Ticker,' is over ',Period,' Day Moving Average');
  6089.  
  6090.  
  6091.        VMenu     Vertical  Menu
  6092.        Usage: VMenu(s1,s2,....sN)
  6093.        The VMenu function will create a vertical menu with the first line
  6094.        containing the string s1, the second line containing s2 and the n-
  6095.        th line containing the string sN . The function returns the line
  6096.        number selected, or -1 if  the ESC key is pressed when the menu is
  6097.        presented.
  6098.        Example:
  6099.        The following will display a vertical menu asking for the type of
  6100.        study to run. If the user presses ESC, the script will stop.
  6101.        line = VMenu('RSI Study',
  6102.                            'MOV Study',
  6103.                            'CCI Study');
  6104.        if line < 0 then STOP;
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.        TAS       Page 93   
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.                              Profit Test Statements
  6146.  
  6147.        Profit Test Statements are used to:
  6148.  
  6149.        Define which Technical Indicators are to be computed.
  6150.  
  6151.        Define BUY conditions
  6152.  
  6153.        Define SELL conditions
  6154.  
  6155.        Define STOP conditions
  6156.  
  6157.  
  6158.  
  6159.  
  6160.         See Page 32 for an explanation of how the price at which a
  6161.         transaction is executed is determined.
  6162.  
  6163.  
  6164.  
  6165.        The statements used to describe the situations above are described
  6166.        in the next 4 sections.
  6167.  
  6168.  
  6169.  
  6170.         PLOT statement: Define Technical Indicators
  6171.  
  6172.  
  6173.        The PLOT statement is used to create the formulas or indicators
  6174.        which will be used in the subsequent profit test. The PLOT
  6175.        statement is executed once per ticker symbol, and must be placed
  6176.        prior to any of the BUY/SELL/STOP WHEN conditions.
  6177.  
  6178.        The format of the PLOT statement is:
  6179.  
  6180.             PLOT stmt;
  6181.  
  6182.        where 'stmt' can be a single statement or a BEGIN..END block. For
  6183.        example, if your profit test is to test the Commodity Channel Index
  6184.        (CCI) for 14 days, you could say:
  6185.  
  6186.        CCI_ARRAY : ARRAY;    { Define the cci array}
  6187.        PLOT CCI_ARRAY = CCI(14);
  6188.  
  6189.        In the example, only one indicator is computed, so there was no
  6190.        need to use the BEGIN..END block. Suppose, however, that we want to
  6191.        incorporate Wilder's RSI in the profit test as well. Then we would
  6192.        say:
  6193.  
  6194.        CCI_ARRAY : ARRAY;    { Define the cci array}
  6195.        RSI_ARRAY : ARRAY;    { Define the rsi array}
  6196.        PLOT BEGIN
  6197.             CCI_ARRAY = CCI(14);
  6198.             RSI_ARRAY = RSI(14);
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.        END;   { of PLOT statement}
  6212.  
  6213.  
  6214.  
  6215.         BUY WHEN - Define BUY Conditions
  6216.  
  6217.  
  6218.        The BUY WHEN condition causes the profit tester to 'buy' the stock
  6219.        if the condition is true.
  6220.  
  6221.             BUY WHEN expression;
  6222.  
  6223.        where 'expression' can be any combination of logical or relational
  6224.        operators.
  6225.  
  6226.        For example, using the last PLOT statement in the previous example,
  6227.        we will issue a BUY signal when the CCI rises above -100 and the
  6228.        RSI is less than 40:
  6229.  
  6230.        BUY WHEN cci_array OF YESTERDAY IS LESS THAN < -100
  6231.             AND cci_array OF TODAY  IS GREATER THAN -100
  6232.             AND rsi_array IS LESS THAN 40;
  6233.  
  6234.  
  6235.  
  6236.         SELL WHEN - Define SELL Conditions
  6237.  
  6238.  
  6239.        The SELL WHEN condition causes the profit tester to 'sell' the
  6240.        stock if the condition is true.
  6241.  
  6242.        SELL WHEN expression;
  6243.  
  6244.        where 'expression' can be any combination of logical or relational
  6245.        operators.
  6246.  
  6247.        For example, using the last PLOT statement in the previous example,
  6248.        we will issue a SELL signal when the CCI drops below 100 and the
  6249.        RSI is greater than 60:
  6250.  
  6251.             SELL WHEN cci_array OF YESTERDAY > 100
  6252.                  AND cci_array OF TODAY < 100
  6253.                  AND rsi_array OF TODAY IS GREATER THAN 60;
  6254.  
  6255.  
  6256.  
  6257.         STOP (LONG or SHORT) Condition
  6258.  
  6259.  
  6260.        The STOP LONG and STOP SHORT statements close a "long" position or
  6261.        a "short" position, respectively, by either selling or buying to
  6262.        cover an open position.
  6263.  
  6264.        To close out a long position (by selling), the statement is:
  6265.  
  6266.  
  6267.        TAS       Page 95   
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.        STOP LONG WHEN expression;
  6279.  
  6280.        where 'expression' can be any combination of logical or relational
  6281.        operators.
  6282.  
  6283.        To close out a short position (by buying), the statement is:
  6284.  
  6285.        STOP SHORT WHEN expression;
  6286.  
  6287.        where 'expression' can be any combination of logical or relational
  6288.        operators.
  6289.  
  6290.        Adding a long stop to the example built in the prior sections, we
  6291.        could say that we want to issue a stop if, after having gone long,
  6292.        the CCI drops below -100 again. In that case, we could say:
  6293.  
  6294.        STOP LONG WHEN cci_array < -100;
  6295.  
  6296.  
  6297.  
  6298.         TAS Profit Tester Functions
  6299.  
  6300.  
  6301.        The Profit Tester feature of TAS uses the following functions to
  6302.        indicate the buy/sell transactions controlled by a Profit Testing
  6303.        script.
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.         pt_buy()     Buy the stock at the current closing price if not
  6344.                      already held. If testing Short positions, buy to
  6345.                      'cover' the short sale.
  6346.  
  6347.         pt_sell()    Sell the stock at the current closing price if it has
  6348.                      been bought. If testing Short positions, sell the
  6349.                      stock short.
  6350.  
  6351.         pt_stop(t)   Issue either a Long Stop or a Short Stop. The
  6352.                      parameter 't' is either 'L' for a Long Stop, or 'S'
  6353.                      for a Short Stop.
  6354.  
  6355.         pt_price(t)  Returns the share price at which the last OPEN
  6356.                      transaction was executed. If there is currently no
  6357.                      position held, then the value returned depends on the
  6358.                      value of the parameter t. If t' is 'L', the value
  6359.                      returned is 0. If t is 'S', the value returned is
  6360.                      9999999.0.
  6361.                      The function is useful if you want to set a STOP
  6362.                      based on the change in price. The parameter t is
  6363.                      either 'L' for a Long Position, or 'S' for a Short
  6364.                      Position.
  6365.         pt_setprice(p)  Sets the price at which the next transaction will
  6366.                      take place, where p is the price.
  6367.  
  6368.  
  6369.        Profit Test Phases - Advanced Use Only
  6370.        TAS runs the profit test in two phases. The first phase, called
  6371.        PLOT PHASE is when the script should compute the arrays to be
  6372.        tested during the next phase. This next phase is the TEST PHASE.
  6373.        This phase is entered for the data points of the ticker file. After
  6374.        all data points have been processed, the END PHASE indicator is
  6375.        set. Each 'phase' of the Profit Test process is indicated by a
  6376.        variable being equal to 1.
  6377.  
  6378.        The two phases are analogous to the steps you might run in Me-
  6379.        tastock to do the Profitability Test. First, you would plot an in-
  6380.        dicator, moving average, or custom formula. This is similar to the
  6381.        'PLOT PHASE' in TAS. Next, you would run the Profit Tester
  6382.        specifying your Buy/Sell conditions. Metastock then applies your
  6383.        Buy/Sell signals to each plotted point on the graph, proceeding
  6384.        left to right until it reaches the last day loaded. This is the
  6385.        'TEST PHASE' in TAS.
  6386.  
  6387.        When the TEST PHASE is entered with the last day of the ticker
  6388.        file, a variable, called 'END_PHASE' is set to 1. Testing this
  6389.        variable will allow you to print out the results for the Profit
  6390.        Test.
  6391.  
  6392.        For each ticker, the script is entered once for the PLOT Phase, and
  6393.        then as many times as there are data points for the TEST Phase.
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.        TAS       Page 97   
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.         If you use the PT_BUY, PT_SELL, PT_STOP, PT_PRICE functions, you
  6411.         will need to understand the different phases for the Profit
  6412.         Tester. However, if you use the BUY WHEN, SELL WHEN, STOP ...
  6413.         WHEN and PLOT forms of the Profit Test, you do not need to be
  6414.         concerned about the different Profit Tester phases, since the
  6415.         script generates the appropriate phase testing automatically.
  6416.         You should   use the BUY, SELL and STOP WHEN statements to do
  6417.         your PROFIT TESTING. See RSIPT.TAS for an example.
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.                                       GRAPH
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.        TAS       Page 99   
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.                                     Functions
  6542.  
  6543.        The TAS GRAPH functions increase the power of TAS by making it
  6544.        possible to display the contents of any indicator, either builtin,
  6545.        or created by the user, in a graphical display. You can write a
  6546.        script that selects only those tickers with the conditions you are
  6547.        looking for, and when one of them is found, display a graph of the
  6548.        indicators and the stock price action.  Up to 10 individual graphs
  6549.        with up to 10 indicators on each graph can be displayed at once
  6550.        with the GRAPH feature. Individual graphs can be assigned their own
  6551.        sizes relative to the other graphs on the screen, or each graph can
  6552.        be the same size as the other graphs.
  6553.  
  6554.  
  6555.  
  6556.         OPENGRAPH
  6557.  
  6558.  
  6559.        OPENGRAPH(numgraphs[,start,end])
  6560.  
  6561.        This function prepares for numgraph graph windows to be displayed.
  6562.        The dates displayed are from quote start to quote number end. For
  6563.        example, to prepare to display 3 graphs of the last 50 days, you
  6564.        would say:
  6565.                OPENGRAPH(3,-50,0);
  6566.        The start and end values are optional, so you don't have to specify
  6567.        them. If they are not specified, the default is to display from the
  6568.        first to the last quote.
  6569.  
  6570.  
  6571.  
  6572.         SIZEGRAPH
  6573.  
  6574.  
  6575.        SIZEGRAPH(S1, S2,...Sn)
  6576.  
  6577.        where S1..Sn are the number of 'shares' of the display area each
  6578.        graph prepared by the OPENGRAPH function will get when shown. For
  6579.        example, as above, with 3 graphs to be displayed, if you want the
  6580.        first graph to have 2 times as much space as the second or third,
  6581.        you would say
  6582.                SIZEGRAPH(2,1,1);
  6583.        Note that there must be as many parameters to the SIZEGRAPH
  6584.        function as the number in the first parameter of the OPENGRAPH
  6585.        function (numgraphs above).
  6586.  
  6587.  
  6588.  
  6589.         GRAPH
  6590.  
  6591.  
  6592.        GRAPH(a1,l1,a2,l2...,aN,lN)
  6593.        where a1 is the first array to be graphed, l1 is the legend (name
  6594.        to be displayed with) the graph of a1,  a2 is the second array and
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.        l2 is the second legend. Each of the arrays and legends specified
  6608.        in the GRAPH command are graphed in the same window, one on top of
  6609.        the other. For example, to graph +DI, -DI and ADX on the same
  6610.        graph, you would say
  6611.        GRAPH(PDI(14),'+DI',MDI(14),'-DI',ADX(14),'ADX 14');
  6612.        Simple as that.
  6613.  
  6614.        There is a special 'array' named '1' which represents the Price Bar
  6615.        Chart normally seen in charts. So, to plot the price bar chart, you
  6616.        could say
  6617.               GRAPH(1);
  6618.  
  6619.  
  6620.  
  6621.  
  6622.         DRAWLINE
  6623.  
  6624.  
  6625.        DRAWLINE(color,x1,y1,x2,y2,start,end)
  6626.  
  6627.        This function will draw a line from the point (x1,y1) to (x2,y2)
  6628.        starting at point start and ending at point end. The color
  6629.        parameter can be in the range from 0 (black) to 15 (white).
  6630.  
  6631.        The following table lists the color codes that can be used with the
  6632.        DRAWLINE function.
  6633.  
  6634.             Color #  Color
  6635.                      Generated
  6636.                0     BLACK
  6637.                1     BLUE
  6638.                2     GREEN
  6639.                3     CYAN
  6640.                4     RED
  6641.                5     MAGENTA
  6642.                6     BROWN
  6643.                7     LIGHTGRAY
  6644.                8     DARKGRAY
  6645.                9     LIGHTBLUE
  6646.                10    LIGHTGREEN
  6647.                11    LIGHTCYAN
  6648.                12    LIGHTRED
  6649.                13    LIGHTMAGEN
  6650.                      TA
  6651.                14    YELLOW
  6652.                15    WHITE
  6653.  
  6654.  
  6655.  
  6656.  
  6657.         CLOSEGRAPH
  6658.  
  6659.  
  6660.        CLOSEGRAPH()
  6661.  
  6662.  
  6663.        TAS       Page 101  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.        The CloseGraph) function causes all the graphs since the last
  6675.        OpenGraph function to be displayed. It waits for you to hit a key
  6676.        to proceed.
  6677.        If you hit an ESC the graphing (and the script) stop completely.
  6678.        If you type the letter P at this point, the graphic screen will be
  6679.        printed to whatever device and device type you set up in your
  6680.        Printer Setup menu. If you have specified a Page Size other than
  6681.        Full, the program will wait until it has enough graphs to print a
  6682.        full page before actually doing any printing.
  6683.        Any other key will close the graph and go back to the regular TAS
  6684.        output display.
  6685.  
  6686.  
  6687.  
  6688.         PRINTGRAPH
  6689.  
  6690.  
  6691.        PRINTGRAPH()
  6692.        The PrintGraph() function will print the last screen of graphs
  6693.        drawn.
  6694.        In order to print successfully, you need to have filled in the
  6695.        Printer Setup menu (see page 40).
  6696.        Once the printing is complete, the graph screen is "closed"
  6697.        automatically, so you do not use the CloseGraph function.
  6698.  
  6699.  
  6700.  
  6701.         ANNOTATE
  6702.  
  6703.  
  6704.        ANNOTATE(s1,s2,s3,....,sN)
  6705.  
  6706.        The ANNOTATE function will place the strings {s1, s2, .. sN} on the
  6707.        previously drawn Graph in the lower left corner of the graph, with
  6708.        s1 at the top of the annotation, s2 below it, up to sN on the
  6709.        bottom line of the graph.
  6710.  
  6711.  
  6712.  
  6713.         HLINE
  6714.  
  6715.  
  6716.        HLINE(y-value, color, linestyle)
  6717.        HLine draws a horizontal line on the previously drawn graph with
  6718.        the color and linestyle specified. The horizontal line's y-axis
  6719.        value is given by y-value.
  6720.        The linestyle can be a number from 0 to 32767, where the 0 is no
  6721.        line and 32767 is a solid line. The linestyle is a value, which
  6722.        when converted to hexadecimal format, indicates the number of
  6723.        pixels which are set in every 16 pixels group.
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.         VLINE
  6741.  
  6742.  
  6743.        VLINE(day_index, color, linestyle)
  6744.        The VLine function draws a vertical line at the day index specified
  6745.        by day_index, using the color value and linestyle specified.
  6746.  
  6747.  
  6748.  
  6749.         GRAPH EXAMPLES
  6750.  
  6751.  
  6752.        Here is an example of a graph that shows how to draw a price graph
  6753.        with Bollinger Bands around it in the first (top) graph and the
  6754.        MACD indicator and its trigger in the bottom graph.
  6755.  
  6756.        opengraph(2);
  6757.        graph(bband_top,bband_bot,1);
  6758.        graph(macd(),'Macd',macdtrigger(),'Trigger');
  6759.        closegraph();
  6760.  
  6761.        The next figure shows a graph created by TAS using the following
  6762.        GRAPH commands:
  6763.        opengraph(2);
  6764.        sizegraph(2,1);
  6765.        graph(1,'PRICE',
  6766.            bbandt(20,2),'BBAND TOP',
  6767.            bbandb(20,2),'BBAND BOT',
  6768.            mov(c,21,'e'),'21DAY EMA',
  6769.            mov(c,200,'e'),'200DAY EMA');
  6770.        graph(rsi(14),'RSI 14');         { show RSI }
  6771.        drawline(3,0,20,0,20);   
  6772.        drawline(3,0,80,0,80);
  6773.        closegraph();
  6774.  
  6775.        The first statement above, opengraph(2), tells TAS to create space
  6776.        on the screen for 2 graph areas. The second statement,
  6777.        sizegraph(2,1), says to give the top graph 2 "shares" of space and
  6778.        the bottom graph 1 share of space. This effectively gives the top
  6779.        graph 2/3 of the screen and the bottom graph the remaining 1/3 of
  6780.        the screen.
  6781.        The third statement
  6782.  
  6783.         graph(1,'PRICE',
  6784.             bbandt(20,2),'BBAND TOP',                         bbandb(20,2)
  6785.        ,'BBAND BOT',                           mov(c,21,'e'),'21DAY EMA',    
  6786.                                 mov(c,200,'e'),'200DAY EMA')
  6787.  
  6788.        defines the values to be graphed in the first (top) graph. The
  6789.        first value to graph is the "price bar chart" which has a special
  6790.        indicator name of "1". Then, two Bollinger Bands, top and bottom,
  6791.        are graphed . Finally, a 21 day Exponential Moving Average and a
  6792.        200 day Exponential Moving Average are graphed. Each of these items
  6793.  
  6794.  
  6795.        TAS       Page 103  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.        to be graphed can be followed by a "legend" or title to be
  6806.        displayed on the graph in the color chosen for the line.
  6807.  
  6808.        The statement
  6809.  
  6810.         graph(rsi(14),'RSI 14')
  6811.  
  6812.         tells TAS to place a graph of Wilder's Relative Strength Index in
  6813.        the second (bottom) graph.
  6814.  
  6815.        The next two statements,
  6816.        drawline(3,0,20,0,20);   
  6817.        drawline(3,0,80,0,80);
  6818.        tell TAS to draw a line in blue from the left of the graph (just
  6819.        drawn) to the right of the graph at height 20 and 80. This is just
  6820.        adding the 20/80 lines to the RSI graph for ease of recognition of
  6821.        crossings to overbought/oversold conditions.
  6822.  
  6823.  
  6824.  
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.                             TAS "POUND" (#) Commands
  6872.  
  6873.        TAS "POUND" commands are used to control special script processing.
  6874.        They must begin with a "pound sign" ('#') in the first column of
  6875.        the line, and they must be completed on the same line.
  6876.  
  6877.        DO NOT USE A SEMI-COLON to terminate a POUND command, since they
  6878.        are not TAS script language statements, but are TAS run settings.
  6879.        You should not put comments at the end of a POUND command either.
  6880.  
  6881.        "POUND" commands are executed by TAS only one time during the life
  6882.        of the script, as contrasted with other TAS script statements which
  6883.        are executed once for every ticker.
  6884.  
  6885.  
  6886.  
  6887.         OUTPUT_FILE Command
  6888.  
  6889.  
  6890.        You can direct the output of a script to a file by placing an
  6891.        #OUTPUT_FILE command in the script file. The #OUTPUT_FILE command
  6892.        must start in the first column of the line. It should be followed
  6893.        by the output file name surrounded by single quotes.
  6894.  
  6895.        If you want to direct your output to a PRINTER, for example, LPT1,
  6896.        you can use the #OUTPUT_FILE command, #OUTPUT_FILE 'LPT1'
  6897.  
  6898.        For example,
  6899.  
  6900.        #OUTPUT_FILE 'select.lst'
  6901.  
  6902.        would place the output text of the script into the file
  6903.        'select.lst'.
  6904.  
  6905.        Appending to Output File
  6906.        If you want to APPEND, or add to, the end of the output file, you
  6907.        can do so by placing a plus (+) character at the end of the output
  6908.        file name. From the example above,
  6909.  
  6910.        #OUTPUT_FILE 'select.lst+'
  6911.  
  6912.        would place the output of the script at the end of file
  6913.        "select.lst". This feature will be most useful if you are running
  6914.        several scripts in succession and want to place the output from
  6915.        different scripts into one output file.
  6916.  
  6917.        Suppressing TAS Report Heading
  6918.        In addition, if you want to suppress the headings that TAS normally
  6919.        puts out on its reports, you can do this with the OUTPUT_FILE
  6920.        command by placing the letter "N" after the file name (preceded by
  6921.        a space).
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.        TAS       Page 105  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.         MAX_QUOTES Command
  6939.  
  6940.  
  6941.        You can use the #MAX_QUOTES command to limit the number of quotes
  6942.        read into a script. This value must be less than the MAXIMUM QUOTES
  6943.        you specified in the TAS Configuration Menu. If it is less than the
  6944.        TAS Configuration Menu MAXIMUM QUOTES, it will override the quote
  6945.        count to read for the script in which it is contained only.
  6946.  
  6947.        The format of the #MAX_QUOTES command is:
  6948.  
  6949.             #MAX_QUOTES min max
  6950.  
  6951.        where
  6952.        min is the minimum number of quotes that the security file must
  6953.        have.
  6954.        max is the maximum number of quotes to read into TAS when this
  6955.        script is processed.
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.         SCAN_DATE Command
  6962.  
  6963.  
  6964.        You can use the #SCAN_DATE command to define the time frame you
  6965.        want to process. You can specify a beginning date, an ending date
  6966.        or both.
  6967.         The SCAN_DATE command enables you to start loading quotes from a
  6968.        specific date (the start date)  and to stop loading quotes after a
  6969.        specific date (the end date).
  6970.  
  6971.        The format of the #SCAN_DATE command is:
  6972.  
  6973.        #SCAN_DATE start_date end_date
  6974.             or
  6975.        #SCAN_DATE end_date
  6976.  
  6977.        Both start_date and end_date can be in the following format
  6978.        where yy is the year, mm is the month, and dd is the day :
  6979.        yymmdd  ,e.g. 910302 for March 2, 1991
  6980.        'mm/dd/yy'     
  6981.        mm/dd/yy
  6982.  
  6983.        Some examples of the use of #SCAN_DATE are:
  6984.             #SCAN_DATE 910102 0
  6985.        will start loading data on Jan 2, 1991 and load up to the last day
  6986.        in the file.
  6987.  
  6988.             #SCAN_DATE 910102 910915
  6989.        will start on Jan 2, 1991 and load up to Sept 15, 1991.
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.        If there is no quote in the file for the start_date, the first date
  7004.        prior to the start_date will be loaded.
  7005.  
  7006.        If there is no quote in the file for the end_date,the first date
  7007.        prior to the end_date will be used.
  7008.  
  7009.        Either the start_date or the end_date may be zero, in which case,
  7010.        it means to load from the beginning or the end of the file without
  7011.        regard to date, but taking into account the MAX_QUOTES range.
  7012.  
  7013.  
  7014.  
  7015.         PROFIT_TEST Command
  7016.  
  7017.  
  7018.        The #PROFIT_TEST command informs TAS of the type of profit test you
  7019.        want to run, whether you want to test "LONG", "SHORT" or "BOTH"
  7020.        long and short positions, and the amount of "money" you want your
  7021.        position to start with. This command must be placed in the front of
  7022.        the TAS script, prior to any statements which do not begin with a #
  7023.        sign.
  7024.  
  7025.        The format of the #PROFIT_TEST command is:
  7026.        #PROFIT_TEST type money
  7027.  
  7028.        where 'type' is either LONG, SHORT or BOTH (for a "long" position
  7029.        test or a "short" position test, or a test of both Long and Short
  7030.        positions) and "money" is the amount of money with which to start
  7031.        the test for each symbol.
  7032.  
  7033.  
  7034.  
  7035.         INDEX Command
  7036.  
  7037.  
  7038.        The #INDEX command can be used to load an "index" data array, such
  7039.        as the SP500, DJIA or another stock. It tells TAS to access the
  7040.        ticker symbol contained in the command and place its CLOSING PRICES
  7041.        into a Pre-defined Data Array named "INDEX".
  7042.  
  7043.        The format of the INDEX Command is:
  7044.             #INDEX 'ticker'
  7045.        where 'ticker' is the TICKER SYMBOL of the Index quote file. For
  7046.        example, if you had the SP 500 quotes in a file with a ticker name
  7047.        of "SP500", and you wanted to load it as the INDEX array, you would
  7048.        say
  7049.             #INDEX 'SP500'
  7050.  
  7051.        Later in the script, you could reference the array by the name of
  7052.        INDEX.
  7053.  
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.        TAS       Page 107  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.         This command must be placed in the front of the TAS script,
  7071.         prior to any statements which do not begin with a # sign. It
  7072.         also should follow any #MAX_QUOTES statement that is in the
  7073.         script.
  7074.  
  7075.  
  7076.  
  7077.  
  7078.  
  7079.  
  7080.         INCLUDE Command
  7081.  
  7082.  
  7083.        The #INCLUDE command will "include" another file  into the current
  7084.        script as if that file were part of the script . Once the included
  7085.        file is read into TAS,  the original script is continued. You can
  7086.        include up to 8 levels of includes, that is, the included file can
  7087.        contain a #include and that file can contain one, etc., up to 8
  7088.        levels.
  7089.  
  7090.        The format of the #include command is
  7091.             #INCLUDE filename
  7092.        where filename is the name of a file in the current directory.
  7093.  
  7094.  
  7095.  
  7096.         TITLE Command
  7097.  
  7098.  
  7099.        The #TITLE command is used to provide a "title" to a file. This
  7100.        title is shown when the File/List extended list display is created
  7101.        (see page 22)
  7102.        The #TITLE line should be no longer than 72 characters, and it must
  7103.        be the first line in the file.
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.                                TAS Script Examples
  7136.  
  7137.        Included with the TAS package are several sample .TAS script files.
  7138.        Check your directory after you install TAS to see the samples
  7139.        included.
  7140.  
  7141.  
  7142.  
  7143.         Putting Them Together
  7144.  
  7145.  
  7146.        If the script has the statements:
  7147.  
  7148.        todays_ma = mov(c,21,'E');
  7149.        diff  = CLOSE OF TODAY- todays_ma;
  7150.        if diff IS GREATER THAN 0 then
  7151.             writeln(TICKER, ' IS ABOVE 21 DAY EMA BY ',diff);
  7152.        else
  7153.             writeln(TICKER, ' IS BELOW 21 DAY EMA BY ',diff);
  7154.  
  7155.        The script will print out the ticker name followed by the message
  7156.        indicating whether the latest close is above or below the 21 day
  7157.        EMA, and by how much.
  7158.  
  7159.        In this particular example, let's take a closer look at what is go-
  7160.        ing on. In the first line,
  7161.  
  7162.        todays_ma = mov(c,21,'E');
  7163.  
  7164.        we are computing the 21 day Exponential Moving Average of the
  7165.        Closing Price Array. Once computed, we are assigning the latest
  7166.        value of this moving average to the "variable" named 'todays_ma'.
  7167.        You could call it anything you want, but giving it a name that
  7168.        reminds you of what it contains is useful.
  7169.  
  7170.        If you wanted to keep the 21-day EMA in its own array. You could
  7171.        declare the variable as follows (before using it the first time):
  7172.        big_ma_array : ARRAY;
  7173.        This tells TAS that "big_ma_array" is an array of values, not just
  7174.        one value. So, if you now said:
  7175.        big_ma_array = mov(c,21,'E');
  7176.        the contents of big_ma_array would be ALL of the Moving Average
  7177.        values up to the latest day. To refer to the value of the 21 day
  7178.        EMA yesterday, we would write "big_ma_array[-1]" where the "[-1]"
  7179.        refers to the contents of the array "-1" days from now (in other
  7180.        words, one day ago). If you wanted to refer to the 21 day EMA 10
  7181.        days ago, it would be "big_ma_array[-10]". If you wanted to refer
  7182.        to the latest day's 21 day EMA, it would be "big_ma_array[0]" (zero
  7183.        days ago).
  7184.  
  7185.        The next statement in the example is:
  7186.             diff  = Close of Today - todays_ma;
  7187.        which assigns to the variable "diff" the value of the latest
  7188.        closing price, "Close of Today", minus the latest 21 day EMA as
  7189.  
  7190.  
  7191.        TAS       Page 109  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.        computed and assigned to the variable "todays_ma" in the previous
  7202.        statement.
  7203.  
  7204.  
  7205.  
  7206.         New High/New Low Example
  7207.  
  7208.  
  7209.        The following script is contained in file "NHNL.TAS".
  7210.  
  7211.        Script Contents
  7212.        { NHNL.TAS-
  7213.        This script example will show the 52 week high and low for each
  7214.        ticker. If the current day's high is equal to the highest high or
  7215.        the current low is equal to the lowest low, then we have a probable
  7216.        new high or new low. It might also be the case that today's high or
  7217.        low is just equal to the previous high or low.
  7218.  
  7219.        Just to make the script slightly more interesting, we will also
  7220.        compute the "percentage off from high", a frequently used metric
  7221.        seen in financial tables.
  7222.        }
  7223.        Prolog
  7224.        begin
  7225.        writeln(
  7226.        '              - CURRENT -       - 52 WEEK -     OFF');
  7227.        writeln(
  7228.        'TICKER       HIGH      LOW     HIGH      LOW    HIGH');
  7229.        end;
  7230.        high_value = HHV(h,52*5);        { compute high over 52 weeks }
  7231.        low_value  = LLV(L,52*5);        { compute low over 52 weeks }
  7232.  
  7233.        off_high_value = ((high_value - c) / high_value) * 100;
  7234.        write(TICKER,' ',h,' ',l,' ',high_value,' ',low_value,
  7235.        '\t',INT(off_high_value),'%');
  7236.  
  7237.        if (high_value <= h) then       { today's high is new high  }
  7238.             write(' New High ');
  7239.  
  7240.        if (low_value >= l) then        { today's low is new low }
  7241.             write(' New Low  ');
  7242.  
  7243.        write('\n');        { end the line with a 'newline'}
  7244.  
  7245.        Script Output
  7246.        - CURRENT -       - 52 WEEK -     OFF
  7247.        TICKER       HIGH      LOW     HIGH      LOW    HIGH
  7248.        ABX        21.875   21.375   24.750   15.875 13%
  7249.        AAPL       28.000   26.000   50.375   26.000 47% New Low
  7250.        ARIX        1.062    0.938    5.625    0.875 81%
  7251.        BP%        12.500   11.125   14.500    6.000 17%
  7252.        CMNT        2.312    2.188    3.500    2.063 33%
  7253.        GR         32.125   31.875   57.500   29.500 44%
  7254.        SWZ        12.125   11.750   17.500   10.875 32%
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.        LA         11.625   10.375   50.375    9.750 77%
  7268.        MXTR        5.625    5.250   16.500    5.250 66% New Low
  7269.        PCG        22.375   22.000   23.500   18.750 4%
  7270.        TX         61.625   60.125   68.500   49.875 12%
  7271.        UAL       110.000   99.000  286.750   87.250 64%
  7272.  
  7273.  
  7274.  
  7275.         TICKER Symbol Processing
  7276.  
  7277.  
  7278.        The following example shows how you could create a special script
  7279.        to notify you when certain stocks had reached prices you had set.
  7280.        This script is in "LIMIT.TAS".
  7281.  
  7282.        Script Contents
  7283.        { limit.tas
  7284.        This is an example of using a TAS script to watch your stocks.
  7285.  
  7286.        It checks the ticker symbol against one of several which you might
  7287.        (and I do) own. If the current close (shown as 'c[0]' is greater
  7288.        than the limit for profit or less than the stop loss, a message is
  7289.        generated.
  7290.        }
  7291.  
  7292.        stop_loss = 0;
  7293.        sell_profit = 0;
  7294.        if ticker = 'aapl' then
  7295.          if c > 47 then
  7296.             sell_profit = 1;
  7297.          else
  7298.          if c < 41 then
  7299.             stop_loss = 1;
  7300.        if ticker = 'gr' then
  7301.          if c > 43 then
  7302.             sell_profit = 1;
  7303.          else
  7304.          if c < 38 then
  7305.             stop_loss = 1;
  7306.        if ticker = 'la' then
  7307.          if c > 27 then
  7308.             sell_profit = 1;
  7309.          else
  7310.          if c < 10 then
  7311.             stop_loss = 1;
  7312.  
  7313.        if stop_loss = 1 then
  7314.          writeln(ticker, ' has reached your STOP LOSS limit. SELL');
  7315.        if sell_profit = 1 then
  7316.          writeln(ticker, ' has reached your Profit target. SELL');
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.        TAS       Page 111  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.         Directional Movement Example
  7335.  
  7336.  
  7337.        The following script is contained in file "DM.TAS".
  7338.  
  7339.        Script Contents
  7340.        #output_file 'dm.lst'
  7341.        { DM.TAS
  7342.        Wilder's Directional Movement Trading Example
  7343.        This script will indicate a BUY signal
  7344.        if the +DI(14) crosses above -DI(14) and ADXR > 25
  7345.        a SELL signal if the -DI(14) crosses above +DI(14) and ADXR > 25
  7346.        }
  7347.        { declare the +DI (Positive Directional Movement array}
  7348.        pdi_array : array;
  7349.  
  7350.        { declare the -DI (Negative Directional Movement array}
  7351.        mdi_array : array;
  7352.  
  7353.        pdi_array = pdi(14);   { calculate +DI}
  7354.        mdi_array = mdi(14);   { calculate -DI}
  7355.        adxr_14 = adxr(14);
  7356.        adx_14  = adx(14);
  7357.        dx_14  = dx(14);
  7358.        if first_ticker then
  7359.          writeln('TICKER     ADXR   DX  ADX  +DI  -DI     ACTION');
  7360.  
  7361.        write(ticker,'  ',int(adxr_14),
  7362.          int(dx_14),
  7363.          int(adx_14),
  7364.           int(pdi_array[0]),
  7365.          int(mdi_array[0]));
  7366.        action = '';
  7367.  
  7368.        if (adxr_14 > 25)   then        { AVG DX Rate of Change > 25 }
  7369.        begin
  7370.        if (over(pdi_array,mdi_array) = 0) then
  7371.          action = '** BUY SIGNAL';
  7372.        else
  7373.        if (over(mdi_array,pdi_array) = 0) then
  7374.          action = '** SELL SIGNAL';
  7375.        end;
  7376.        writeln(action);
  7377.  
  7378.        Script Output
  7379.        TICKER     ADXR   DX  ADX  +DI  -DI     ACTION
  7380.        AA           33   28   33   25   14
  7381.        ALD          22   15   22   30   22
  7382.        AXP          34   59   34   39   10
  7383.        T            30   41   30   29   12
  7384.        BS           26   42   26   32   13
  7385.        BA           22    8   22   27   23
  7386.        CHV          17    4   17   27   29
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.        KO           27   49   27   32   11
  7400.        DD           21   23   21   29   18
  7401.  
  7402.  
  7403.  
  7404.         Modified "Binary Wave"
  7405.  
  7406.  
  7407.        The file "SELCT.TAS" contains a rather lengthy script which
  7408.        contains the logic for computing a 6 point "binary wave". The first
  7409.        4 "points" of the wave are those described in the "MetaStock User's
  7410.        Manual" in Chapter 7, section 7.7.2 "Example Binary Waves".
  7411.  
  7412.        The final 2 points of the "binary wave" are included to show how
  7413.        you can extend the original example to compute additional
  7414.        indicators (Chaikin's Oscillator and Commodity Channel Index) which
  7415.        are used to further refine the selection.
  7416.  
  7417.        Since the file is large, it is not included in this documentation,
  7418.        but the file is included in the TAS package.
  7419.  
  7420.  
  7421.  
  7422.  
  7423.         Profit Test Example Using RSI(14)
  7424.  
  7425.  
  7426.        The TAS Script file 'RSIPT.TAS' shows a Profit Test using the
  7427.        14-day RSI.  It serves as a simple example of the kind of profit
  7428.        testing available with TAS.
  7429.  
  7430.        Script Contents (RSIPT.TAS)
  7431.        {
  7432.        RSIPT.TAS
  7433.        RSI PROFIT TEST SCRIPT EXAMPLE
  7434.        This script will signal a SELL when the
  7435.        RSI(14) crosses under 'rsi_upper' and a BUY when RSI(14) crosses
  7436.        above 'rsi_lower'.
  7437.        }
  7438.        #PROFIT_TEST LONG 1000          { long positions with $1000}
  7439.        #MAX_QUOTES 300                 { only read in 300 quotes }
  7440.        #OUTPUT_FILE 'RSIPT.LST'        { assign output listing to
  7441.        rsipt.lst}
  7442.  
  7443.        RSI_VALUES : ARRAY;             { array containing plotted points
  7444.        }
  7445.        RSI_UPPER = 75;                { Upper range of RSI - point to
  7446.        SELL
  7447.        Change this if
  7448.        you want to test different value}
  7449.        RSI_LOWER = 50;                { Lower range of RSI - point to BUY
  7450.        Change this if you want to test different value}
  7451.  
  7452.        PLOT BEGIN      { This begins the "plot" of the RSI }
  7453.  
  7454.  
  7455.        TAS       Page 113  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.        RSI_VALUES = RSI(14);  { COMPUTE THE RSI(14) PLOT }
  7466.        END;
  7467.  
  7468.        BUY WHEN RSI_VALUES[-1] < RSI_LOWER AND RSI_VALUES > RSI_LOWER;
  7469.  
  7470.        SELL WHEN RSI_VALUES[-1] > RSI_UPPER  AND RSI_VALUES < RSI_UPPER;
  7471.  
  7472.        Script Output
  7473.        The following report shows the output of the Profit Tester for a
  7474.        single stock.
  7475.                        Technical Analysis Scanner (TAS 3.64)
  7476.                        File Date  : 05/08/90
  7477.                        Run  Date  : Wed May 29 22:28:00 1991
  7478.                        Script Name: RSIPT
  7479.                        Ticker Name: T
  7480.  
  7481.                    Amdahl (AMH) From 03/20/90 To 05/29/91
  7482.                    Initial Cash $ 1000.00. (Long Positions Only)
  7483.                Share Purchases use All Available Cash with NO Commissions
  7484.  
  7485.                                      |-----Current Trade-------| |--
  7486.        Cumulative--|
  7487.          Date   Action Shrs    Price Points  Cash   Comm  Profit  Points
  7488.        Profit
  7489.        -------- ----- ----- -------- ------ ------ ----- ------- -------
  7490.        -------
  7491.        05/09/90 Buy      70   14.250  0.000      2     0       0   0.000
  7492.        0
  7493.        05/22/90 Sell     70   15.625  1.375   1096     0      96   1.375
  7494.        96
  7495.        06/12/90 Buy      69   15.750  0.000     10     0       0   1.375
  7496.        96
  7497.        07/18/90 Sell     69   18.250  2.500   1269     0     172   3.875
  7498.        269
  7499.        09/07/90 Buy      97   13.000  0.000      8     0       0   3.875
  7500.        269
  7501.  
  7502.                                 Summary for AMH
  7503.                |--Trades-----| |-Runs-|  Percent  |---Maximum--|
  7504.        Total %
  7505.                Tot Win Los Stp  Win Los  Win Los  Profit    Loss Commn
  7506.        Profit Gain
  7507.        Long      2   2   0   0    2   0 100%   0%    269       0     0
  7508.        269   27%
  7509.        Short     0   0   0   0    0   0   0%   0%      0       0     0
  7510.        0    0%
  7511.        Closed    2   2   0   0    2   0 100%   0%    269       0     0
  7512.        269   27%
  7513.        Open      1   1   0   0    1   0 100%   0%    315       0     0
  7514.        315   32%
  7515.        Total     3   3   0   0    2   0 100%   0%    315       0     0
  7516.        584   58%
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.                                 Summary for ALL SYMBOLS
  7533.                |--Trades-----| |-Runs-|  Percent  |---Maximum--|
  7534.        Total %
  7535.                Tot Win Los Stp  Win Los  Win Los  Profit    Loss Commn
  7536.        Profit Gain
  7537.        Long      2   2   0   0    2   0 100%   0%    269       0     0
  7538.        269   27%
  7539.        Short     0   0   0   0    0   0   0%   0%      0       0     0
  7540.        0    0%
  7541.        Closed    2   2   0   0    2   0 100%   0%    269       0     0
  7542.        269   27%
  7543.        Open      1   1   0   0    1   0 100%   0%    315       0     0
  7544.        315   32%
  7545.        Total     3   3   0   0    2   0 100%   0%    315       0     0
  7546.        584   58%
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.  
  7553.  
  7554.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.  
  7560.  
  7561.  
  7562.  
  7563.  
  7564.  
  7565.  
  7566.  
  7567.  
  7568.  
  7569.  
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.        TAS       Page 115  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.                                 TAS Error Message
  7598.  
  7599.        TAS has extensive error checking features that attempt to detect
  7600.        and isolate errors as close to the source as possible. The follow-
  7601.        ing section is a list of the error messages that can be exhibited
  7602.        by TAS.
  7603.  
  7604.        The Error Message list is in alphabetic sequence, so you can look
  7605.        up the message by the first letter of the first word of the
  7606.        message. Most messages have  an error number associated with them
  7607.        as well. This number should be used when communicating the problem
  7608.        to FlexSoft.
  7609.  
  7610.        For each error message, there are three sections, The first section
  7611.        is the actual text of the message including an error number  (Ennn)
  7612.        , the second section is the cause of the message, and the third
  7613.        section is the recommendation, or action to resolve the error.
  7614.  
  7615.        At the end of the list of error messages is a list of Diagnostic
  7616.        Actions. These are described in the error message recommendation as
  7617.        Action Dx, where the x is a diagnostic action number. A Diagnostic
  7618.        Action is a sequence of steps necessary to resolve the problem or
  7619.        to gather and provide enough information for resolution by FlexSoft
  7620.        Technical Support.
  7621.  
  7622.  
  7623.  
  7624.         Error Messages
  7625.  
  7626.  
  7627.        E72,'(', number value or variable expected.
  7628.        Cause:
  7629.        In trying to decipher an arithmetic expression, TAS found a
  7630.        sequence where it expected to find either an expression in
  7631.        parentheses, a number or a variable. It found nothing it could make
  7632.        sense of.
  7633.  
  7634.        Recommendation:
  7635.        Examine the line where the error was flagged and correct the
  7636.        mistake.
  7637.  
  7638.        E68,')' expected.
  7639.        Cause:
  7640.        In trying to decipher an arithmetic expression, TAS found a
  7641.        sequence that is missing a right parenthesis.
  7642.        Recommendation:
  7643.        Examine the line where the error was flagged and correct the
  7644.        mistake.
  7645.  
  7646.        A <tttt> Math Error (code <cc>) has occurred
  7647.        while processing symbol <ticker>
  7648.        in TAS Script File <script>, line <ll>.
  7649.        TAS cannot continue. Fix the problem and try again.
  7650.        Cause:
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.  
  7663.        The TAS script has encountered a "math" error of the type shown in
  7664.        the message text as <tttt>  while processing ticker name <ticker>
  7665.        at line <ll>.
  7666.        Recommendation:
  7667.        This may be the result of faulty data in your ticker file. Verify
  7668.        that the ticker data is valid (high >= close >= low), then note
  7669.        the script line where the error occurred.
  7670.        Try another function on that ticker to see if the problem persists.
  7671.        Action D1
  7672.  
  7673.        E101,ALPHA requires 'D','W' or 'M'
  7674.        Cause:
  7675.        An incorrect parameter was given to the ALPHA function. It must be
  7676.        one of the ones shown in the message.
  7677.        Recommendation:
  7678.        Fix the function parameter list.
  7679.  
  7680.        E140,Argument <aa> is the wrong type for <ff>
  7681.        function. Should be <tt>
  7682.        Cause:
  7683.        The <aa>th argument to the function named  <ff> in the message was
  7684.        the wrong type of argument. If should have been an argument type as
  7685.        shown in <tt>. For example,  this message would occur if you tried
  7686.        to do a moving average (mov) of a number, rather than an array.
  7687.        Recommendation:
  7688.        Look at the argument number shown by the <aa> part of the message.
  7689.        Then check the function description. Make sure that the value
  7690.        passed in that argument is of the correct type.
  7691.  
  7692.        E3,Badly formed number
  7693.        Cause:
  7694.        An invalid number expression was found.
  7695.        Recommendation:
  7696.        Fix the number in the script
  7697.  
  7698.        E102,BETA argument error
  7699.        Cause:
  7700.        An incorrect parameter was given to the BETA function. It must be
  7701.        'D','W' or 'M' or no parameter at all.
  7702.        Recommendation:
  7703.        Fix the function parameter list.
  7704.  
  7705.        E104,BETA requires an INDEX file
  7706.        Cause:
  7707.        The BETA function requires an INDEX ticker file to be specified by
  7708.        a #INDEX command or in the OPTIONS MENU of SELECTION or PROFIT TEST
  7709.        BUILD.
  7710.        Recommendation:
  7711.        Specify an INDEX ticker.
  7712.  
  7713.        E230,BREAK hit
  7714.        Cause:
  7715.        While a script was executing, you hit the CTRL-BREAK or CTRL-C key.
  7716.        The script terminates and TAS attempts to continue.
  7717.  
  7718.  
  7719.        TAS       Page 117  
  7720.  
  7721.  
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.        Note that hitting the BREAK key is not a graceful way to stop a
  7730.        running script and you may have to restart TAS afterwards.
  7731.        Recommendation:
  7732.        Wait until the script finishes or use a smaller ticker list.
  7733.  
  7734.        E223,Cannot sort on type given
  7735.        Cause:
  7736.        A SORTOUT function was called, but one of the parameters is not
  7737.        'sortable'. For example, you cannot sort on a variable into which
  7738.        you have not assigned a value. Until you assign a value to it, TAS
  7739.        does not know what kind of variable it is, number, string or
  7740.        array.
  7741.        Recommendation:
  7742.        Examine your script to be sure you are assigning a value to the
  7743.        argument you are passing to the SORTOUT function.
  7744.  
  7745.        E2,Constant string too long
  7746.        Cause:
  7747.        You have a constant string (a literal value enclosed in single
  7748.        quotes) that is longer than 128 characters. This may be caused by
  7749.        forgetting to terminate a quoted string on a prior line.
  7750.        Recommendation:
  7751.        Examine the script and add any missing single quotes. Break up the
  7752.        constant into two or more pieces if necessary.
  7753.  
  7754.        EXXX,Could not create window. Error <e>
  7755.        Cause:
  7756.        TAS internal window error.
  7757.        Recommendation:
  7758.        Action D2
  7759.  
  7760.        E127,Not enough storage. Decrease MAX_QUOTES
  7761.        Cause:
  7762.        You have specified too high a value for MAXIMUM QUOTES in the TAS
  7763.        CONFIGURATION screen. Reduce this value so that TAS can load all
  7764.        the necessary data for a ticker.
  7765.        Recommendation:
  7766.        If you are doing a profit test, you can use the START DATE and END
  7767.        DATE options to reduce the number of quotes TAS reads for each
  7768.        ticker.
  7769.  
  7770.        E243,EMS Memory overflow
  7771.        Cause:
  7772.        Not applicable to TAS at this time.
  7773.        Recommendation:
  7774.        None.
  7775.        Error creating ticker file :
  7776.        Cause:
  7777.        TAS could not create the ticker file.
  7778.        Recommendation:
  7779.        Check that the directory in which you are writing the ticker file
  7780.        exists and that the file, if it exists, is not READ ONLY.
  7781.  
  7782.        Error occurred during process of <ssss>
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.        Cause:
  7796.        An error occurred while running SELECTION <ssss>. There might be a
  7797.        message to explain it prior to this point.
  7798.        Recommendation:
  7799.        Run the .SEL file again and watch for any other error messages.
  7800.  
  7801.  
  7802.        E59,expected assignment '='
  7803.        Cause:
  7804.        The script has a syntax error in it. Probably there is a sequence
  7805.        like
  7806.                                        A B
  7807.         where A and B are variables. TAS expects an assignment to variable
  7808.        A.
  7809.        Recommendation:
  7810.        Examine the script and fix the error.
  7811.  
  7812.        E52,Expected LONG or SHORT
  7813.        Cause:
  7814.        A Profit Test STOP statement was found but it was not followed by
  7815.        the type of stop, either LONG or SHORT.
  7816.        Recommendation:
  7817.        Examine the script and fix the error.
  7818.  
  7819.        E62,Expected WHEN
  7820.        Cause:
  7821.        A Profit Test BUY, SELL or STOP statement was found but it was ot
  7822.        followed by the word WHEN.
  7823.        Recommendation:
  7824.        Examine the script and fix the error.
  7825.  
  7826.        E119,GOTO LABEL not defined
  7827.        Cause:
  7828.        A GOTO statement names a label that is not defined in the script.
  7829.        For example, it says GOTO ABC, but there is no label ":ABC" in the
  7830.        script.
  7831.        Recommendation:
  7832.        Examine the script and fix the error.
  7833.  
  7834.        E152,GRAPHS not registered
  7835.        Cause:
  7836.        An OPENGRAPH function was called for the third time when the GRAPH
  7837.        feature is not registered. No more graphs can be run until TAS is
  7838.        restarted.
  7839.        Recommendation:
  7840.        Register the GRAPH feature.
  7841.  
  7842.        E122,Heap Corrupted
  7843.        Cause:
  7844.        TAS internal error. The TAS memory 'heap' structure has become
  7845.        unusable.
  7846.        Recommendation:
  7847.        Restart TAS.
  7848.        Action D2
  7849.  
  7850.  
  7851.        TAS       Page 119  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.        E131,Incorrect argument count to <ff> function
  7864.        Cause:
  7865.        The function <ff> was called with more or less arguments than it
  7866.        requires.
  7867.        Recommendation:
  7868.        Refer to the function description for the correct number and type
  7869.        of arguments (parameters).
  7870.  
  7871.        E224,Incorrect # of parameters for SORTGET
  7872.        Cause:
  7873.        The number of parameters to the SORTGET function does not match the
  7874.        number of arguments passed to the SORTOUT function. There must be a
  7875.        one for one relationship between the argument counts for both
  7876.        functions.
  7877.        Recommendation:
  7878.        Examine the script and fix the error.
  7879.  
  7880.        E150,Incorrect SIZEGRAPH
  7881.        Cause:
  7882.        The number of parameters to the SIZEGRAPH function must be equal to
  7883.        the number of graphs specified in the preceding OPENGRAPH function.
  7884.        Recommendation:
  7885.        Examine the script and fix the error.
  7886.  
  7887.        E250,Incorrect ZigZag type
  7888.        Cause:
  7889.        The third parameter to the ZIG function must be either '%' or '$'.
  7890.        Recommendation:
  7891.        Examine the script and fix the error.
  7892.  
  7893.        E175,Incorrect 'type' parameter to pt_init
  7894.        Cause:
  7895.        The PT_INIT function was called with an incorrect 'type' field.
  7896.        Recommendation:
  7897.        Examine the script and fix the error.
  7898.  
  7899.        EXXX,Incorrect Graph Type
  7900.        Cause:
  7901.        The GRAPH function was called with an incorrect type of item to
  7902.        graph. See the  graph function for the valid types of graph. .
  7903.        Recommendation:
  7904.        Examine the script and fix the error.
  7905.  
  7906.        E150,Incorrect Start/End
  7907.        Cause:
  7908.        An OPENGRAPH function was called with the start and end array
  7909.        indices specified, but 1) the start was later than the end or
  7910.        (2)one of the specifications was not a number.
  7911.        Recommendation:
  7912.        Examine the script and fix the error.
  7913.  
  7914.        E150,Incorrect OPENGRAPH
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.        Cause:
  7928.        The OPENGRAPH function was called with an incorrect number of
  7929.        parameters.
  7930.        Recommendation:
  7931.        Examine the script and fix the error.
  7932.  
  7933.        E150,Incorrect DRAWLINE parameters
  7934.        Cause:
  7935.        The DRAWLINE function was called with an incorrect number of
  7936.        parameters.
  7937.        Recommendation:
  7938.        Examine the script and fix the error.
  7939.  
  7940.        E51,Incorrect placement of # command
  7941.        Cause:
  7942.        A # symbol was found in some column other than the first column of
  7943.        a line.
  7944.        The # symbol is used to distinguish "Pound" commands from other
  7945.        parts of the script. It cannot be used in any other context (except
  7946.        as part of a string).
  7947.        Recommendation:
  7948.        Check that the "Pound" Command begins in the first column of the
  7949.        line.
  7950.  
  7951.        E123,Intermediate operand stack overflow
  7952.        Cause:
  7953.        This can be caused by a TAS internal error or a very complex
  7954.        expression in a script.
  7955.        Recommendation:
  7956.        If the error occurs in a statement containing a complex algebraic
  7957.        expression, try breaking the expression into smaller pieces. For
  7958.        example, if the statement is
  7959.                A = (B+5)*(C+2/(1+C))
  7960.        you might break it into
  7961.                A1 = B + 5
  7962.                A2 = C+2/(1+C)
  7963.                A = A1 * A2
  7964.        If the problem does not occur on a complex statement, then
  7965.        see ACTION D2.
  7966.  
  7967.        E129,Intermediate array stack underflow
  7968.        Cause:
  7969.        TAS internal error.
  7970.        Recommendation:
  7971.        Action D1
  7972.  
  7973.        E124,Intermediate operand stack underflow
  7974.        Cause:
  7975.        TAS internal error.
  7976.        Recommendation:
  7977.        Action D1
  7978.  
  7979.        E138,internal flag error in check_types
  7980.        Cause:
  7981.  
  7982.  
  7983.        TAS       Page 121  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.  
  7993.        TAS internal error.
  7994.        Recommendation:
  7995.        Action D1
  7996.  
  7997.  
  7998.        E100,Invalid 3rd parameter to mov()
  7999.        Cause:
  8000.        An incorrect third parameter was given in a MOV function call.
  8001.        Recommendation:
  8002.        Examine the script and fix the error.
  8003.  
  8004.        E176,Invalid argument to pt_price
  8005.        Cause:
  8006.        An incorrect parameter was given in a PT_PRICE function call.
  8007.        Recommendation:
  8008.        Examine the script and fix the error.
  8009.  
  8010.        E116,Invalid array subscript
  8011.        Cause:
  8012.        A reference was made to an array element that is outside the range
  8013.        of quotes in the ticker file. For example, if 200 days were loaded,
  8014.        and a reference is made to C[202] or C[-301].
  8015.        Recommendation:
  8016.        Examine the script and fix the error.
  8017.  
  8018.        E01,Invalid character
  8019.        Cause:
  8020.        Some character not in the TAS character set was encountered outside
  8021.        of a string constant (anything between single quotes is allowed).
  8022.        Recommendation:
  8023.        Examine the script and fix the error.
  8024.  
  8025.        EXXX,INVALID KEYWORD 'wwww'
  8026.        Cause:
  8027.        A keyword in the TAS.CNF file was not recognized.
  8028.        Recommendation:
  8029.        Remove the line with the word 'wwww' from the TAS.CNF file.
  8030.  
  8031.        E121,Invalid operator
  8032.        Cause:
  8033.        TAS internal error.
  8034.        Recommendation:
  8035.        Action D1
  8036.  
  8037.        E231,Invalid option to LOAD
  8038.        Cause:
  8039.        A LOAD function was given an invalid data array name in the second
  8040.        parameter.
  8041.        Recommendation:
  8042.        Examine the script and fix the error.
  8043.  
  8044.  
  8045.        E200,Invalid SEL file
  8046.        Cause:
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.        In the SELECTION BUILD section, a .SEL file was loaded, but TAS was
  8060.        not able to recognize it as a valid .SEL file.
  8061.        Recommendation:
  8062.        Make sure that the .SEL file has not been modified by some means
  8063.        other than TAS SELECTION BUILD.
  8064.  
  8065.        E141,Invalid string function
  8066.        Cause:
  8067.        TAS internal error.
  8068.        Recommendation:
  8069.        Action D1
  8070.  
  8071.        EXXX,INVALID VALUE for <vvvv>
  8072.        Cause:
  8073.        A keyword in the TAS.CNF file has an invalid value.
  8074.        Recommendation:
  8075.        Remove the line with the word 'vvvv' from the TAS.CNF file and
  8076.        reconfigure TAS.
  8077.  
  8078.        EXXX,KEYWORD '<vvvv>' HAS NO VALUE
  8079.        Cause:
  8080.        A keyword in the TAS.CNF file has an no value.
  8081.        Recommendation:
  8082.        Remove the line with the word 'vvvv' from the TAS.CNF file
  8083.        and reconfigure TAS.
  8084.  
  8085.        E55,LABEL name expected
  8086.        Cause:
  8087.        A GOTO statement was not followed by the LABEL to 'go to'
  8088.        Recommendation:
  8089.        Examine the script and fix the error.
  8090.  
  8091.        E235,LOAD not supported for CHARTPRO
  8092.        Cause:
  8093.        The LOAD function is not supported for the ChartPro data format.
  8094.        Recommendation:
  8095.        None.
  8096.  
  8097.        E65,Missing function argument list
  8098.        Cause:
  8099.        A function name was not immediately followed by  a left paren-
  8100.        thesis, an optional argument list, and then a right parenthesis.
  8101.        Even a function that  has no arguments must be followed by at least
  8102.        '()'.
  8103.        Recommendation:
  8104.        Examine the script and fix the error. Make sure there are no blanks
  8105.        or other characters between the function name and the left
  8106.        parenthesis.
  8107.        If you have inadvertantly used the name of a function for a
  8108.        variable name, then you should change the name of the variable.
  8109.  
  8110.        EXXX,MSP_FILE_SEEK - error in direction
  8111.        Cause:
  8112.        TAS internal error.
  8113.  
  8114.  
  8115.        TAS       Page 123  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.        Recommendation:
  8126.        Action D1
  8127.  
  8128.        EXXX,MSP_FILE_SEEK
  8129.        Cause:
  8130.        TAS internal error.
  8131.        Recommendation:
  8132.        Action D1
  8133.  
  8134.        EXXX,MSP_MASTER_SEEK - error in direction
  8135.        Cause:
  8136.        TAS internal error.
  8137.        Recommendation:
  8138.        Action D1
  8139.  
  8140.        E20,Nesting level too deep
  8141.        Cause:
  8142.        This message occurs when 20 BEGIN statements occur without an
  8143.        intervening END statement.
  8144.        Recommendation:
  8145.        Look for missing END statements or simplify the nesting structure
  8146.        of the statements leading up to the error.
  8147.  
  8148.        E242,No more internal array storage
  8149.        Cause:
  8150.        TAS is out of memory and cannot perform any more calculations. This
  8151.        can be caused by too high a value for MAXIMUM QUOTES PER SYMBOL or
  8152.        by the use of too many permanent  ARRAYS (those variables declared
  8153.        with " : ARRAY" in a script).
  8154.        Recommendation:
  8155.        Action D4
  8156.  
  8157.        No Syntax Errors in this script. Congratulations!
  8158.        Cause:
  8159.        This message is produced when a SYNTAX CHECK is done from within
  8160.        the TAS Editor. The script has no errors that can be found by ex-
  8161.        amining the "syntax" of the script. In other words, there are no
  8162.        invalid symbols, GOTO's without labels, bad characters, and other
  8163.        errors that violate the syntax rules of a TAS script.
  8164.        On the other hand, there may still be errors in the script that can
  8165.        only be detected by  actually running the script. These errors
  8166.        might be logical errors, memory errors, math errors or function
  8167.        parameter errors.
  8168.        Recommendation:
  8169.        Run the script, since it seems to be correct at this time.
  8170.  
  8171.        E241,Not enough Data Arrays
  8172.        Cause:
  8173.        Internal Error. EMS version of TAS only
  8174.        Recommendation:
  8175.        Action D1
  8176.  
  8177.        E127,Not enough storage. Decrease MAX_QUOTES
  8178.        Cause:
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.  
  8191.        TAS is out of memory and cannot perform any more calculations. This
  8192.        can be caused by too high a value for MAXIMUM QUOTES PER SYMBOL or
  8193.        by the use of too many permanent  ARRAYS (those variables declared
  8194.        with " : ARRAY" in a script).
  8195.  
  8196.        Recommendation:
  8197.        Action D4
  8198.  
  8199.        E24,Not enough memory available for symbol table
  8200.        Cause:
  8201.        The script is too large to run with the current setting of SYMBOL
  8202.        TABLE SIZE. The Symbol Table is used to keep the "run time machine
  8203.        language" version of the script while it is executing. If the
  8204.        CONFIGURATION SCREEN setting for SYMBOL TABLE SIZE is
  8205.        too low, there is not enough room to build the run time script.
  8206.        Recommendation:
  8207.        Action D3
  8208.  
  8209.        E154,not enough heap space in save_screen()
  8210.        Cause:
  8211.        TAS does not have enough memory available to save the screen before
  8212.        saving a graph.
  8213.        Recommendation:
  8214.        Action D2
  8215.  
  8216.        E155, not enough heap space in restore_screen()
  8217.        Cause:
  8218.        In attempting to restore a graph, TAS has detected that it is out
  8219.        of memory.
  8220.        Recommendation:
  8221.        Action D2
  8222.  
  8223.        Not supported in TRIAL version
  8224.        Cause:
  8225.        The script is using a function or feature that is not part of the
  8226.        TRIAL (or evaluation) version of TAS. The function or feature is
  8227.        enabled after TAS is registered. This error can occur if your
  8228.        registration code is entered incorrectly.
  8229.  
  8230.        Recommendation:
  8231.        Register TAS and obtain a Registration Code.
  8232.  
  8233.        E110,operand stack overflow
  8234.        Cause:
  8235.        This can be caused by a TAS internal error or a very complex
  8236.        expression in a script.
  8237.        Recommendation:
  8238.        If the error occurs in a statement containing a complex algebraic
  8239.        expression, try breaking the expression into smaller pieces. For
  8240.        example, if the statement is
  8241.                A = (B+5)*(C+2/(1+C))
  8242.        you might break it into
  8243.                A1 = B + 5
  8244.                A2 = C+2/(1+C)
  8245.  
  8246.  
  8247.        TAS       Page 125  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.  
  8257.                A = A1 * A2
  8258.        If the problem does not occur on a complex statement, then
  8259.        see ACTION D2.
  8260.  
  8261.        E111,operand stack underflow
  8262.        Cause:
  8263.        TAS internal error.
  8264.        Recommendation:
  8265.        Action D2
  8266.  
  8267.        <filename> read error
  8268.        Cause:
  8269.        TAS could not read the Metastock or Chartpro file named <filename>
  8270.        Recommendation:
  8271.        Verify that the data file is correct and readable. If not, correct
  8272.        it.
  8273.        If it is correctable, see Action D1
  8274.  
  8275.        E69,Right Brace (]) missing
  8276.        Cause:
  8277.        A subscript after an array was not followed by a Right Brace ']'.
  8278.        For example,
  8279.          A = B[-3;
  8280.        would produce this error.
  8281.        Recommendation:
  8282.        Examine the script and fix the error.
  8283.  
  8284.        E153,script terminated
  8285.        Cause:
  8286.        The script has completed for some reason indicated in a prior
  8287.        message, such as "BREAK HIT".
  8288.        Recommendation:
  8289.        None.
  8290.  
  8291.        E58,semi-colon expected after ARRAY
  8292.        Cause:
  8293.        A script statement declaring an ARRAY was not terminated by a semi-
  8294.        colon. For example,
  8295.          B : ARRAY
  8296.        would cause this error.
  8297.        Recommendation:
  8298.        Examine the script and fix the error.
  8299.  
  8300.  
  8301.        E58,semi-colon expected after NUMBER
  8302.        Cause:
  8303.        A script statement declaring a NUMBER was not terminated by a semi-
  8304.        colon. For example,
  8305.          B : NUMBER
  8306.        would cause this error.
  8307.        Recommendation:
  8308.        Examine the script and fix the error.
  8309.  
  8310.        E226,sorton : Incorrect column number
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.        Cause:
  8324.        The SORTON function was called with a column number that is not
  8325.        valid. The only valid column numbers are from 1 to the number of
  8326.        parameters in the prior SORTOUT function(s).
  8327.        Recommendation:
  8328.        Examine the script and fix the error.
  8329.  
  8330.        E225,sorton: Incorrect direction
  8331.        Cause:
  8332.        The SORTON function was called with a direction that was neither
  8333.        'A' for ascending, or 'D' for descending.
  8334.        Recommendation:
  8335.        Examine the script and fix the error.
  8336.  
  8337.        E221,sortout : cannot allocate sort storage
  8338.        Cause:
  8339.        When a SORTOUT function was executed, there was not enough memory
  8340.        left to create a sort buffer equal to F*T*4+(S*L),
  8341.          where
  8342.        F = number of fields in the SORTOUT function call
  8343.        T = number of tickers in the ticker list
  8344.        S = number of fields in the SORTOUT function call that are strings
  8345.        L = average length of the string constants
  8346.  
  8347.        Recommendation:
  8348.        Action D4
  8349.  
  8350.        E22,Symbol Overflow. Increase SYMBOL TABLE SIZE
  8351.        Cause:
  8352.        The script is too large to run with the current setting of SYMBOL
  8353.        TABLE SIZE. The Symbol Table is used to keep the "run time machine
  8354.        language" version of the script while it is executing. If the
  8355.        CONFIGURATION SCREEN setting for SYMBOL TABLE SIZE is
  8356.        too low, there is not enough room to build the run time script.
  8357.        Recommendation:
  8358.        Action D3
  8359.  
  8360.  
  8361.        TAS error code <ccc>
  8362.        Cause:
  8363.        TAS ended with an error. There was a prior message explaining the
  8364.        type of error. The code <ccc> is a code internal to TAS.
  8365.        Generally, it is -1.
  8366.  
  8367.        Recommendation:
  8368.        If the problem persists,record the code <ccc>.
  8369.        Then perform Action D1
  8370.  
  8371.        TAS Profit Test ended with error <ccc>
  8372.        Cause:
  8373.        TAS Profit Test ended with an error. There was a prior message
  8374.        explaining the type of error. The code <ccc> is a code internal to
  8375.        TAS.
  8376.        Generally, it is -1.
  8377.  
  8378.  
  8379.        TAS       Page 127  
  8380.  
  8381.  
  8382.  
  8383.  
  8384.  
  8385.  
  8386.  
  8387.  
  8388.  
  8389.  
  8390.        Recommendation:
  8391.        If the problem persists,record the code <ccc>.
  8392.        Then perform Action D1
  8393.  
  8394.        E125,Temporary result released out of order
  8395.        Cause:
  8396.        TAS internal error.
  8397.        Recommendation:
  8398.        Action D1
  8399.  
  8400.        E130,Temporary array released out of order
  8401.        Cause:
  8402.        TAS internal error.
  8403.        Recommendation:
  8404.        Action D1
  8405.  
  8406.        E128,Too many arrays declared
  8407.        Cause:
  8408.        More than the maximum number of permanent arrays were declared
  8409.        (with the ":ARRAY")  declaration. The maximum number of permanent
  8410.        arrays is 26.
  8411.        Recommendation:
  8412.        Reuse some of the permanent arrays for other uses. For example, if
  8413.        you had an array that held a moving average and an array that held
  8414.        a stochastic oscillator, you might use the same array for both (at
  8415.        different times in the script, of course).  Alternatively, you
  8416.        could just recompute the value rather than putting the result in an
  8417.        array.
  8418.  
  8419.        E21,Too many END statements
  8420.        Cause:
  8421.        The number of END statements is greater than the number of BEGIN
  8422.        statements.
  8423.        Recommendation:
  8424.        Examine the script and fix the error.
  8425.  
  8426.        E152,Too many GRAPHs requested
  8427.        Cause:
  8428.        An OPENGRAPH function specified less graphs than the number of
  8429.        GRAPH functions which follow it.
  8430.        Recommendation:
  8431.        Examine the script and fix the error.
  8432.  
  8433.        E63,Too many IF-ELSE or GOTO statements.
  8434.        Cause:
  8435.        TAS has run out of room to hold all of the IF-ELSE and GOTO labels.
  8436.        Recommendation:
  8437.        Simplify the script by removing or combining IF-ELSE statements.
  8438.  
  8439.        E126,Too many intermediate arrays needed
  8440.        Cause:
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.        A "nested" function call is too complex for TAS to handle. This
  8456.        type of call is a function that calls a function that calls a
  8457.        function....etc.
  8458.        For example,
  8459.          A = MOV(MOV(MOV(ROC(C,12,'%'),21,'E'),21,'E'),21,'E')
  8460.        is a "nested" function call. For each of the internal function
  8461.        calls, TAS has to create an "intermediate" array. TAS has between 5
  8462.        and 12 of these arrays available depending on the value of MAXIMUM
  8463.        QUOTES PER SYMBOL.
  8464.  
  8465.        Recommendation:
  8466.        Use permanent arrays (named arrays declared with ":ARRAY") to hold
  8467.        intermediate results.
  8468.         or
  8469.        Action D4
  8470.  
  8471.        E133,Too many parameters for function WRITE
  8472.        Cause:
  8473.        The WRITE and WRITELN functions can accept up to 40 parameters.
  8474.        This is caused by exceeding that number.
  8475.        Recommendation:
  8476.        Break the WRITELN into a WRITE followed by a WRITELN with half the
  8477.        parameters in each function call.
  8478.  
  8479.        E134.Too many parameters for DUMP_ARRAY
  8480.        Cause:
  8481.        The DUMP_ARRAY function can accept up to 12 parameters. This is
  8482.        caused by exceeding that number.
  8483.        Recommendation:
  8484.        Use less parameters for DUMP_ARRAY.
  8485.  
  8486.        E222,Too many parameters for function SORTOUT
  8487.        Cause:
  8488.        The SORTOUT function can accept up to 40 parameters. This is caused
  8489.        by exceeding that number.
  8490.        Recommendation:
  8491.        Use less parameters for SORTOUT.
  8492.  
  8493.        E115,Too many RETURN stmts
  8494.        Cause:
  8495.        TAS has encountered a RETURN statement for which there is no GOSUB
  8496.        or script entry. Every script is run with an "implied" GOSUB, so
  8497.        one RETURN can always be used.
  8498.        Recommendation:
  8499.        Examine the script and fix the error.
  8500.  
  8501.        E114,Too many subroutine calls
  8502.        Cause:
  8503.        The maximum number of GOSUB statements has been executed. If a
  8504.        script does a GOSUB to a subroutine that does a GOSUB to another
  8505.        subroutine, etc, the number of these GOSUBs without intervening
  8506.        RETURN statements is 40.
  8507.        Recommendation:
  8508.        Examine the script and fix the error.
  8509.  
  8510.  
  8511.        TAS       Page 129  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.  
  8521.        If the script is not in error, for example, subroutine A calling
  8522.        subroutine B which calls subroutine A again, then simplify the
  8523.        subroutine nesting.
  8524.  
  8525.        E73,Too many statements to compile procedure.
  8526.        Cause:
  8527.        The TAS script is too large for TAS to handle. The maximum sized
  8528.        script can be over 2000 lines of instructions (comments not
  8529.        included), so this script is "too large".
  8530.        Recommendation:
  8531.        Reduce the size of the script by breaking it into smaller scripts.
  8532.  
  8533.        E53,Unknown word or placement of word
  8534.        Cause:
  8535.        In the process of checking a script for syntax errors, TAS en-
  8536.        countered a word that it did not recognize in the location it found
  8537.        it.
  8538.        Recommendation:
  8539.        Examine the script and fix the error.
  8540.  
  8541.        E234, Unable to find ticker <tttttt>
  8542.        Cause:
  8543.        An INDEX command or a LOAD function requested a ticker name that
  8544.        could not be found.
  8545.        Recommendation:
  8546.        Make sure that you have specified the correct ticker symbol for
  8547.        your #INDEX command or your LOAD function. If the ticker name is
  8548.        correctly spelled, check your TAS CONFIGURATION setting for the
  8549.        INCLUDE TICKER PERIOD parameter. If this is set to "Y", then you
  8550.        need to add the "period" to the end of the ticker symbol as shown
  8551.        when you pull up a ticker list.
  8552.  
  8553.  
  8554.  
  8555.         Diagnostic Actions
  8556.  
  8557.  
  8558.        Action D1
  8559.        1.   Create a MetaStock or Chartpro directory containing the ticker
  8560.        file in which the error was discovered (in the case of Metastock,
  8561.        you can do this with the COPY SECURITY command.
  8562.        2.   Copy the script in error to the directory you created in step
  8563.        1
  8564.        3.   Copy the ticker list used when the error occurred to the
  8565.        directory created in step 1.
  8566.        4.   Use PKZIP or LHARC to compress the files in the directory
  8567.        created in step 1.
  8568.        5.   Upload the file to the FlexSoft BBS AREA J
  8569.  
  8570.        Action D2
  8571.        Record the sequence of commands and actions performed up to the
  8572.        point where the problem occurs as well as the script used.
  8573.        Report the problem to FlexSoft.
  8574.  
  8575.  
  8576.  
  8577.  
  8578.  
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.  
  8587.        Action D3
  8588.  
  8589.        1.   Increase SYMBOL TABLE SIZE setting in the CONFIGURATION
  8590.        SCREEN. As a good start, double it.
  8591.        2.   Then run the script that caused the error.
  8592.        3.   After the script completes, type the ALT-M key while in a TAS
  8593.        menu and record the value of Maximum Symbol Table Size. This is the
  8594.        amount of Symbol Table the script actually used.
  8595.        4.   Go back to the CONFIGURATION SCREEN and lower the SYMBOL TABLE
  8596.        SIZE to be a couple of thousand more than the maximum value used.
  8597.        If increasing the SYMBOL TABLE SIZE leads to other out of memory
  8598.        errors, you may have to reduce the MAXIMUM QUOTES PER SYMBOL
  8599.        setting on the CONFIGURATION SCREEN.
  8600.  
  8601.        Action D4
  8602.        1.   Remove any unneeded TSRs.
  8603.        2.   Reduce MAXIMUM QUOTES PER SYMBOL in the CONFIGURATION SCREEN.
  8604.        3.   Reuse permanent arrays when they are no longer needed.
  8605.  
  8606.  
  8607.  
  8608.  
  8609.  
  8610.  
  8611.  
  8612.  
  8613.  
  8614.  
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624.  
  8625.  
  8626.  
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.  
  8635.  
  8636.  
  8637.  
  8638.  
  8639.  
  8640.  
  8641.  
  8642.  
  8643.        TAS       Page 131  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.                                       Index
  8651.  
  8652.                                            Day of Week, 88
  8653.        "                                   daymon, 87
  8654.        "batch mode", 22                    daywk, 88
  8655.        "periods", 42                       decimal point, 55, 90, 100, 104
  8656.        "tuning", 43                        diagnostic, 135
  8657.        "upgrade releases", 15              DMI, 73
  8658.        A                                   DOS Shell, 48
  8659.        Activity Editors, 24, 29            DowJones, 17
  8660.        activity-specific editor, 24        E
  8661.        ADX, 73                             EMS, 43, 44, 137, 144
  8662.        ALT-M key, 28                       END PHASE, 111
  8663.        ALT-X key, 28                       ENTER, 25
  8664.        angle, 85                           errors in syntax, 30
  8665.        array, 55, 56, 57, 58, 59, 63,      ESC key, 19, 21, 28
  8666.        71                                  expand, 89
  8667.        array indices, 55                   Expanded Memory System, 13
  8668.        array intersection, 90              explicit reference, 56
  8669.        avgprc, 86                          exponentiation, 59
  8670.        B                                   expression, 58, 59, 66, 135
  8671.        bbandb, 86                          F
  8672.        bbandt, 86                          F1 key, 28
  8673.        BEGIN..END, 62                      File Directories, 44
  8674.        C                                   FIRST_TICKER, 67, 104, 130
  8675.        CASH, 35                            FlexSoft BBS, 15
  8676.        Chart Command, 44, 46               FOR statement, 60, 61
  8677.        Chart Program, 48                   FORMAT function, 100
  8678.        Chart Program Directory, 44         format specifier, 100
  8679.        ChartPro, 40, 80, 142               format string, 104
  8680.        color, 22, 114                      format_string, 88
  8681.        companion products, 16              formatted date, 87
  8682.        Complete Control, 11                formfeed, 100
  8683.        Compuserve, 17                      FULLNAME, 67, 100
  8684.        Computrac, 13                       function, 52
  8685.        Configuration Menu, 41              future, 89
  8686.        Configuring TAS, 29-50              G
  8687.        const, 87                           GEnie, 17
  8688.        context sensitive help, See         GOSUB, 63
  8689.        HELP Key                            GOTO, 62
  8690.        corrcoef, 87                        graph, 90, 111, 113
  8691.        Correlation Coefficient, 87         H
  8692.        Create a Trendline, 98              hardware configuration, 13
  8693.        Create Integer, 90                  heap, 138, 144
  8694.        Custom Reports, 11                  HELP Key, 28, 30, 35
  8695.        D                                   High-Level Analysis, 11
  8696.        DAILY data, 42                      I
  8697.        Data Directories, 40                IF, 52
  8698.        DATA DIRECTORY(S), 42               Include Ticker Period, 42
  8699.        DATAPATH, 67                        INDEX, 32
  8700.        date, 67, 87, 88, 93, 99, 103,      index, 67
  8701.        122                                 INDEX Command, 124
  8702.        datestr, 87                         indices
  8703.        Day of Month, 87                      See Array Indices, 55
  8704.  
  8705.  
  8706.        TAS       Page 137  
  8707.  
  8708.  
  8709.  
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.        Installation of TAS, 19-21          O
  8717.          Sample Selection, 21              online order system, 16
  8718.        Installation section, 23            OPTION SETTINGS, 35
  8719.        int, 90                             OUTPUT_FILE, 121, 122
  8720.        integer, 55, 100, 104               Over, 94
  8721.        integer maximum value, 90           P
  8722.        intersecting point, 90              Parallel Trendline, 98
  8723.        Investograph Plus, 13               parentheses, 59
  8724.        isect, 90                           pause, 94
  8725.        iterate                             PDI, 73
  8726.          see loop, 61                      PDL, 16
  8727.        L                                   Peak, 94
  8728.        LAST_TICKER, 67, 101                permanent arrays, 147
  8729.        Linear Regression, 90               Personal Ticker Tape, 16
  8730.        linear regression, 82, 86, 87,      PLOT, 108
  8731.        90                                  PLOT PHASE, 111
  8732.        linreg, 85, 90                      POUND, 121
  8733.        linreg2, 85, 90                     POUND commands, 121
  8734.        List, 24                            PRINTER
  8735.        load function, 91                     See OUTPUT_FILE, 121
  8736.        LONG, 110                           Prodigy, 17
  8737.        long or complex script, 43          profit test, 32, 34, 38, 108,
  8738.        loop, 60, 61, 103                   111, 137
  8739.        M                                   Profit Testing, 11
  8740.        Massive Power, 11                   pt_buy, 111
  8741.        max, 91                             pt_price, 111
  8742.        MAX_QUOTES, 50, 55, 122, 124,       pt_sell, 111
  8743.        144                                 pt_setprice, 111
  8744.        maximum data points, 92             pt_stop, 111
  8745.        MAXIMUM QUOTES, 32, 137             PTT, 16
  8746.        maximum value of an "integer"       Q
  8747.        field, 104                          QUOTE_COUNT, 55, 67
  8748.        maxPair, 91                         QUOTE_RANGE, 67
  8749.        maxVal, 92, 93                      QUOTES PER SYMBOL
  8750.        MDI, 73                               processing time, 43
  8751.        memory, 28, 43, 92, 137, 139        Quotes Per Symbol, 43
  8752.        memory - minimum, 13                R
  8753.        MetaStock data files, 17            Rank, 20, 21, 31
  8754.        MetaStock Professional, 17          Redistribution of TAS, 16
  8755.        min, 92                             REGISTER.DOC, 47
  8756.        minPair, 93                         REGISTRATION CODE, 48
  8757.        Minumum Configuration, 13             encrypted code, 47
  8758.        MONEY, 35, 38                       Registration Code, 15
  8759.        monitor, 13                         Registration Code Secrecy, 16
  8760.        Monochrome, 22                      RETURN statement, 64
  8761.        monthly compression, 87             Running TAS, 23-29
  8762.        mouse, 13, 21, 25                   S
  8763.        N                                   semi-colon, 60
  8764.        nested function, 148                SHORT, 110
  8765.        New Line, 100, 104                  software configuration, 13
  8766.        new page, 100                       sort buffer, 101, 102, 103, 146
  8767.        new versions of TAS, 15             SORTOUT, 148
  8768.        NOT, 66                             Statement, 51, 58, 59, 62
  8769.        number, 55, 65, 135                 string constant, 103, 141
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.  
  8780.  
  8781.  
  8782.        subroutine, 63
  8783.        support, 15
  8784.        Suppressing TAS Report Heading,
  8785.        122
  8786.        switches
  8787.          See Starting TAS, 22
  8788.        SYMBOL TABLE SIZE, 144, 146,
  8789.        150
  8790.        Symbol Table Size, 43
  8791.        syntax, 51, 138, 143
  8792.        SYNTAX CHECK, 143
  8793.        T
  8794.        Tab, 35, 100
  8795.        tab stops, 100
  8796.        TAS Editor, 143
  8797.        TAS Main Menu, 23
  8798.        Technical Analysis References,
  8799.        18
  8800.        TEST PHASE, 111
  8801.        TICKER LIST, 32, 50
  8802.        Ticker List, 24
  8803.        TICKER LISTS, 43
  8804.        TICKER_PERIOD, 67
  8805.        trendline, 98
  8806.        trendpar, 98
  8807.        TRIM function, 54
  8808.        TSRs, 150
  8809.        U
  8810.        updates to TAS, see new version
  8811.        of TAS
  8812.        Upgrade Registration Fee, 15
  8813.        V
  8814.        variable, 58, 135
  8815.        Variable Types, 54
  8816.        vertical menu, 107
  8817.        View A File, 48
  8818.        VMenu, 107
  8819.        W
  8820.        warranty, 18
  8821.        weekly compression, 86
  8822.        WEEKLY data, 42
  8823.        WHILE, 52, 103
  8824.        WHILE statement, 60
  8825.        Wilder, 18
  8826.        Y
  8827.        yearly compression, 87
  8828.        yesterday, 90
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.        TAS       Page 139  
  8839.  
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.  
  8852.  
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863.  
  8864.  
  8865.  
  8866.  
  8867.  
  8868.  
  8869.  
  8870.  
  8871.  
  8872.  
  8873.  
  8874.  
  8875.  
  8876.  
  8877.  
  8878.  
  8879.  
  8880.  
  8881.  
  8882.  
  8883.  
  8884.  
  8885.  
  8886.  
  8887.  
  8888.  
  8889.  
  8890.  
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901.  
  8902.  
  8903.  
  8904.  
  8905.  
  8906.  
  8907.  
  8908.