home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tas501.zip / TAS.TXT < prev    next >
Text File  |  1993-03-07  |  267KB  |  10,434 lines

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