






                             Technical Analysis Scanner
                     User's Guide and Script Language Reference































                                                    FlexSoft
                                           7172 Regional Street, #276
                                                Dublin, CA 94568

                        Voice/FAX           510-829-9733
                        FlexSoft Bulletin Board System     510-829-2293
                        Internet            moore@netcom.com
                        Compuserve          76447,2367








              This document and all accompanying written and disk based
                notes and specifications are copyrighted by FlexSoft.
                                    March 5, 1995





                                  Table of Contents

          1. INTRODUCTION...............................................1-1

          1.1 TAS DESCRIPTION...........................................1-1
          1.2 TAS FEATURES..............................................1-1
          1.3 SYSTEM REQUIREMENTS.......................................1-2
           1.3.1 Hardware ..............................................1-2
           1.3.2 Software ..............................................1-2
           1.3.3 Data ..................................................1-2
          1.4 SUPPORT AND UPGRADES......................................1-3
           1.4.1 Support ...............................................1-3
           1.4.2 Updates to TAS ........................................1-3
           1.4.3 Upgrades to TAS .......................................1-4
           1.4.4 Redistribution of TAS .................................1-4
           1.4.5 Other FlexSoft Products ...............................1-4
           1.4.6 Credits ...............................................1-5
           1.4.7 Disclaimers ...........................................1-5
           1.4.8 Technical Analysis References .........................1-6

          2. INSTALLING TAS.............................................2-1

          2.1 INSTALLING FROM FLOPPY DISK...............................2-1
          2.2 INSTALLING FROM DOWNLOADED FILES..........................2-1
           2.2.1 Initial Program Setup .................................2-2
          2.3 CREATING A TICKER LIST....................................2-3
          2.4 CREATING A SELECTION......................................2-4

          3. COMMAND LINE OPTIONS.......................................3-1


          4. DESKTOP MENUS..............................................4-1

          4.1 THE TAS DESKTOP...........................................4-1
           4.1.1 Multiple Editors, Multiple Windows ....................4-1
           4.1.2 Accessing the menus ...................................4-1
           4.1.3 The Status Bar ........................................4-2
          4.2 FILE......................................................4-2
           4.2.1 New ...................................................4-2
           4.2.2 Open ..................................................4-2
           4.2.3 List ..................................................4-2
           4.2.4 Save ..................................................4-2
           4.2.5 Save As ...............................................4-3
           4.2.6 Print .................................................4-3
           4.2.7 Printer Setup .........................................4-3
           4.2.8 DOS Shell .............................................4-4
           4.2.9 Exit ..................................................4-4
          4.3 FILE TYPES................................................4-4
           4.3.1 Scripts ...............................................4-4
           4.3.2 Selections ............................................4-4
           4.3.3 Ticker List ...........................................4-4
          4.4 SETUP.....................................................4-4
           4.4.1 Data Directories ......................................4-5
           4.4.2 File Directories ......................................4-6





                                  Table of Contents
           4.4.3 Program Options .......................................4-7
           4.4.4 Register Program ......................................4-8
           4.4.5 Set Ticker List .......................................4-9
           4.4.6 Clear Ticker List .....................................4-9
           4.4.7 Colors ................................................4-9
          4.5 WINDOWS..................................................4-10
           4.5.1 Size/Move ............................................4-10
           4.5.2 Zoom .................................................4-10
           4.5.3 Tile .................................................4-10
           4.5.4 Cascade ..............................................4-11
           4.5.5 Next .................................................4-11
           4.5.6 Previous .............................................4-11
           4.5.7 Close ................................................4-11

          5. RUN WINDOW.................................................5-1


          6. SCRIPTS - EDITING TAS SCRIPTS..............................6-1

          6.1 SCRIPT EDITOR KEYBOARD COMMANDS...........................6-1
          6.2 EDITOR FUNCTION KEYS......................................6-5

          7. SELECTIONS - SCAN AND PROFIT TEST..........................7-1

          7.1 ENTERING INPUT INTO THE SELECTION.........................7-1
          7.2 COLUMN MEANINGS...........................................7-2
          7.3 ENTERING FORMULAS.........................................7-3
           7.3.1 Naming the Formula ....................................7-3
           7.3.2 Entering the Formula itself ...........................7-3
           7.3.3 Using the Formula Builder Key .........................7-4
           7.3.4 Entering Titles .......................................7-4
           7.3.5 Entering a Graph Number ...............................7-4
           7.3.6 Hiding a Column of Output .............................7-4
          7.4 ENTERING CONDITIONS.......................................7-5
          7.5 ENTERING PROFIT TEST COMMANDS.............................7-5
           7.5.1 Buy ...................................................7-5
           7.5.2 Sell ..................................................7-6
           7.5.3 Stop Long .............................................7-6
           7.5.4 Stop Short ............................................7-6
          7.6 EDIT MENU.................................................7-6
           7.6.1 Row Commands ..........................................7-6
           7.6.2 Formula Builder .......................................7-7
           7.6.3 Data Options ..........................................7-7
           7.6.4 Profit Test Options ...................................7-8
           7.6.5 Profit Test Stops ....................................7-11
          7.7 RUN MENU.................................................7-12
           7.7.1 Execute ..............................................7-12
           7.7.2 Syntax Check .........................................7-13
          7.8 SELECTION OUTPUT VIEWER..................................7-13
           7.8.1 Display Menu .........................................7-13
           7.8.2 Sort Menu ............................................7-13
           7.8.3 Graph Menu ...........................................7-14
           7.8.4 Printing Your Selection Report .......................7-14





                                  Table of Contents
          7.9 SAMPLE SELECTION.........................................7-14
           7.9.1 Conditions for the Selection .........................7-15

          8. TICKER LISTS - GROUP SECURITIES............................8-2

          8.1 EDIT......................................................8-2
           8.1.1 Select All ............................................8-2
           8.1.2 Unselect All ..........................................8-3
           8.1.3 Rebuild List ..........................................8-3
           8.1.4 Delete Unmatched ......................................8-3
          8.2 SORT......................................................8-3

          9. SCRIPT LANGUAGE DESCRIPTION................................9-1

          9.1 SYNTAX....................................................9-1
          9.2 LANGUAGE OVERVIEW.........................................9-1
          9.3 VARIABLES.................................................9-4
           9.3.1 Declaring Variables ...................................9-4
           9.3.2 String Variables ......................................9-7
           9.3.3 Numeric Variables .....................................9-7
           9.3.4 Date Variables ........................................9-7
           9.3.5 Numeric Array Variables ...............................9-7
          9.4 ASSIGNMENT STATEMENT......................................9-9
          9.5 ARITHMETIC OPERATORS.....................................9-11
          9.6 FUNCTIONS................................................9-11
          9.7 IF STATEMENT.............................................9-11
          9.8 WHILE STATEMENT..........................................9-12
          9.9 FOR STATEMENT............................................9-12
          9.10 FOR EACH POINT STATEMENT................................9-13
          9.11 BREAK STATEMENT.........................................9-14
          9.12 BEGIN..END STATEMENT....................................9-14
          9.13 GOTO STATEMENT AND LABELS...............................9-15
          9.14 GOSUB STATEMENT.........................................9-16
          9.15 RETURN STATEMENT........................................9-17
          9.16 STOP STATEMENT..........................................9-17
          9.17 PROLOG STATEMENT........................................9-17
          9.18 EPILOG STATEMENT........................................9-18
          9.19 LOGICAL OPERATORS.......................................9-18
          9.20 RELATIONAL OPERATORS....................................9-19
          9.21 CROSSED ABOVE/BELOW OPERATOR............................9-20
          9.22 COMMENTS................................................9-20
          9.23 FORMAT SPECIFIERS.......................................9-21

          10. BUILT-IN VARIABLES.......................................10-1

          10.1 HISTORICAL DATA VARIABLES...............................10-1
           10.1.1 Ticker ..............................................10-1
           10.1.2 FullName ............................................10-1
           10.1.3 DataPath ............................................10-1
           10.1.4 Ticker_Period .......................................10-1
           10.1.5 Quote_Count .........................................10-1
           10.1.6 Date ................................................10-2
           10.1.7 Ticker_List .........................................10-2





                                  Table of Contents
           10.1.8 Index_Symbol ........................................10-2
          10.2 PROFIT TEST VARIABLES...................................10-2
           10.2.1 Profit ..............................................10-2
           10.2.2 MaxProfit ...........................................10-2
           10.2.3 MaxLoss .............................................10-2
           10.2.4 DaysInPosition ......................................10-2
           10.2.5 SharesHeld ..........................................10-3
          10.3 PROCESSING FLOW VARIABLES...............................10-3
           10.3.1 First_Ticker ........................................10-3
           10.3.2 Last_Ticker .........................................10-3
           10.3.3 Quote_Range .........................................10-3
           10.3.4 Plot_Phase ..........................................10-3
           10.3.5 Test_Phase ..........................................10-4
           10.3.6 End_Phase ...........................................10-4
          10.4 GRAPH CONTROL VARIABLES.................................10-4
           10.4.1 Color Names .........................................10-4
          10.5 PRE-DEFINED DATA ARRAYS.................................10-5

          11. BUILT-IN FUNCTIONS.......................................11-1

          11.1 DATABASE USAGE..........................................11-1

          12. DATA BASE FUNCTIONS......................................12-2

           12.1.1 DBClose  Close Database File ........................12-2

           12.1.2 DBCreate  Create a Database .........................12-2

           12.1.3 DBDefine  Begin Database Definition .................12-2

           12.1.4 DBField  Define a Database field ....................12-2

           12.1.5 DBFirst  First Database Record ......................12-3

           12.1.6 DBLast  Last Database Record ........................12-3

           12.1.7 DBLoad  Load Database with Delimited Data ...........12-4

           12.1.8 DBNext  Next Database Record ........................12-4

           12.1.9 DBOpen  Open Database File ..........................12-4

           12.1.10 DBPrev  Previous Database Record ...................12-5

           12.1.11 DBRead  Read Database Record .......................12-5

           12.1.12 DBTickList  Set Processing order to Database .......12-5

           12.1.13 DBWrite  Write Database record .....................12-5


          13. DATE FUNCTIONS...........................................13-6





                                  Table of Contents
           13.1.1 DateStr  Create a formatted date ....................13-6

           13.1.2 DayMon  Day of Month ................................13-6

           13.1.3 DayWk  Day of Week function .........................13-6

           13.1.4 MakeDate  Create a date variable ....................13-6

           13.1.5 Month  Month function ...............................13-7

           13.1.6 Now  Current date ...................................13-7

           13.1.7 Year  Year function .................................13-7


          14. GRAPH FUNCTIONS..........................................14-8

           14.1.1 Annotate  Annotate a graph ..........................14-8

           14.1.2 BGColors  Set background color ......................14-8

           14.1.3 CloseGraph  Close Graph screen ......................14-8

           14.1.4 DownArrow  Draw a small down arrow ..................14-8

           14.1.5 DrawLine  Draw a line on a graph ....................14-9

           14.1.6 Graph  Draw a single graph ..........................14-9

           14.1.7 HLine  Draw a horizontal line ......................14-10

           14.1.8 LineColors  Set Line Colors ........................14-10

           14.1.9 OpenGraph  Open a Graph Screen .....................14-10

           14.1.10 PrintGraph  Print the current graph screen ........14-10

           14.1.11 SemiLogGraph  Draw a log/linear graph .............14-11

           14.1.12 SizeGraph  Set Graph Sizes ........................14-11

           14.1.13 TextAlign  Set text alignment .....................14-11

           14.1.14 TextAt  Write text on graph .......................14-12

           14.1.15 TextColor  Set text color .........................14-12

           14.1.16 TextDir  Set text writing direction ...............14-12

           14.1.17 TextFont  Set text font ...........................14-12

           14.1.18 TextSize  Set text size ...........................14-13





                                  Table of Contents
           14.1.19 UpArrow  Draw a small up arrow ....................14-13

           14.1.20 VLine  Draw a vertical line .......................14-13


          15. IO FUNCTIONS............................................15-14

           15.1.1 AClose  Close an ASCII File ........................15-14

           15.1.2 AGet  Get comma separated values ...................15-14

           15.1.3 AGetLn  Get a line from a CSV file .................15-15

           15.1.4 AOpen  Open an ASCII file ..........................15-15

           15.1.5 APut  Put fields to an ASCII file ..................15-16

           15.1.6 APutLn  Put a new record to an ASCII file ..........15-16

           15.1.7 ASeek  Locate a record in an ASCII file ............15-17

           15.1.8 Ask  Ask user for input values .....................15-18

           15.1.9 Dump_Array  Array Contents .........................15-18

           15.1.10 OutputFile  Specify listing file ..................15-19

           15.1.11 Pause  Wait for keyboard input ....................15-19

           15.1.12 VMenu  Vertical Menu for user input ...............15-19

           15.1.13 Write  Write to output screen .....................15-20

           15.1.14 WriteLn  Write to output screen with new line .....15-20


          16. MATH FUNCTIONS..........................................16-22

           16.1.1 Add  Add two arrays ................................16-22

           16.1.2 AddTo  Add number to array .........................16-22

           16.1.3 Const   Constant Array .............................16-22

           16.1.4 COS  Trigonometric CoSine ..........................16-23

           16.1.5 CUM  Cumulative Sum of Array .......................16-23

           16.1.6 DIV  Divide two arrays .............................16-23

           16.1.7 DivBy  Divide array by number ......................16-23





                                  Table of Contents
           16.1.8 EXP  Exponential Function ..........................16-24

           16.1.9 Int  Create Integer ................................16-24

           16.1.10 LOG  Natural Logarithm ............................16-24

           16.1.11 Max  Maximum value of a pair ......................16-24

           16.1.12 MaxPair  Maximum value of two arrays ..............16-25

           16.1.13 MaxVal  Maximum value in array ....................16-25

           16.1.14 MemLeft  Show remaining memory ....................16-25

           16.1.15 Min  Minimum value of a pair ......................16-26

           16.1.16 MinPair  Minimum value of two arrays ..............16-26

           16.1.17 MinVal  Minimum value in array ....................16-26

           16.1.18 MUL  Multiply two arrays ..........................16-27

           16.1.19 MulBy  Multiply by number .........................16-27

           16.1.20 NEG  Negate an array ..............................16-27

           16.1.21 Randomize  Make Random Number truly random ........16-27

           16.1.22 RandomNumber  Generate random number ..............16-28

           16.1.23 RandomSeed  Initialize Random Number Generator ....16-28

           16.1.24 Set  Set Array to Value ...........................16-28

           16.1.25 Sign  Sign of array entries .......................16-29

           16.1.26 SIN  Trigonometric sine ...........................16-29

           16.1.27 SQRT  Square Root .................................16-29

           16.1.28 SUB  Subtract one array from another ..............16-30

           16.1.29 SubFrom  Subtract number from array ...............16-30

           16.1.30 SUM  Sum over a period ............................16-30

           16.1.31 TAN  Trigonometric Tangent ........................16-30

           16.1.32 Zero  Zero Array ..................................16-30

           16.1.33 zScore  Compute Z-Score for array .................16-31





                                  Table of Contents
          17. MISCELLANEOUS FUNCTIONS.................................17-32

           17.1.1 Defined  Check if variable exists ..................17-32

           17.1.2 DOS  Execute a DOS command .........................17-32

           17.1.3 GetFileName  Extract file name .....................17-32

           17.1.4 GetFileType  Extract file extention ................17-33

           17.1.5 GetPathName  Extract directory path ................17-33

           17.1.6 Load  Load a Data Array ............................17-33


          18. PATTERN FUNCTIONS.......................................18-35

           18.1.1 FindFst  Find first value ..........................18-35

           18.1.2 FindLst  Find last value ...........................18-35

           18.1.3 FindPattern  Find pattern in array .................18-35

           18.1.4 Peak  Find Peak in Array ...........................18-35

           18.1.5 Trough  Find Trough in Array .......................18-38


          19. PROFIT TEST FUNCTIONS...................................19-39

           19.1.1 Future  Future array element .......................19-39

           19.1.2 PT_Buy   Profit Test - Buy .........................19-39

           19.1.3 PT_Init  Profit Test Initialization ................19-39

           19.1.4 PT_Options  Profit Test Options ....................19-40

           19.1.5 PT_Price   Profit Test - Get open position entry price19-40

           19.1.6 PT_Sell   Profit Test - Sell .......................19-41

           19.1.7 PT_SetPrice   Profit Test - Set transaction closing

           price .....................................................19-41
           19.1.8 PT_Stop   Profit Test - Stop Long/Short ............19-41

           19.1.9 Redo  Rerun profit test ............................19-42

           19.1.10 Redo_Count  Profit Test Reruns ....................19-42





                                  Table of Contents
           19.1.11 Stop_Maximumloss   Profit Test - Set maximum loss

           amount ....................................................19-42
           19.1.12 Stop_ProfitTarget  Profit Test - Set profit target 19-43

           19.1.13 Stop_Trailing  Profit Test - Set trailing stop loss19-43


          20. SETUP FUNCTIONS.........................................20-44

           20.1.1 Compress  Date Compression .........................20-44

           20.1.2 DateRange  Set Date Range ..........................20-44

           20.1.3 MaxQuotes  Set Maximum Data Points .................20-45


          21. SORT FUNCTIONS..........................................21-46

           21.1.1 SortAlloc  Allocate a new sort buffer ..............21-46

           21.1.2 SortFree  Free a sort buffer .......................21-46

           21.1.3 SortGet  Retrieve one record from Sort Buffer ......21-46

           21.1.4 SortOn  Sort data in buffer on field ...............21-47

           21.1.5 SortOut  Put data in Sort Buffer ...................21-48

           21.1.6 SortPrint  Print contents of Sort Buffer ...........21-48

           21.1.7 SortSetBuf  Set the current sort buffer ............21-49


          22. STRING FUNCTIONS........................................22-50

           22.1.1 Expand  Expand formatted string ....................22-50

           22.1.2 FindStr  Find substring ............................22-50

           22.1.3 Format  Format a number ............................22-50

           22.1.4 ParseString  Parse a comma separated string ........22-51

           22.1.5 StrLen  String Length ..............................22-51

           22.1.6 StrRep  String Replace .............................22-52

           22.1.7 Substr  Substring function .........................22-52

           22.1.8 Trim  Trim blanks from a string ....................22-52





                                  Table of Contents
          23. TECHNICAL ANALYSIS FUNCTIONS............................23-53

           23.1.1 AD  Accumulation/Distribution ......................23-53

           23.1.2 ADX  Average Directional Movement ..................23-53

           23.1.3 ADXR  Average Directional Movement Rating ..........23-54

           23.1.4 Alpha  Alpha function ..............................23-54

           23.1.5 Angle  Angle of a line .............................23-55

           23.1.6 AvgPrc  Average Price ..............................23-55

           23.1.7 BBandB  Bottom Bollinger Band ......................23-55

           23.1.8 BBandT  Top Bollinger Band .........................23-56

           23.1.9 Beta  "Beta" function ..............................23-56

           23.1.10 CCI  Commodity Channel Index Array ................23-57

           23.1.11 CO  Chaikin's Oscillator ..........................23-58

           23.1.12 CorrCoef  Correlation Coefficient .................23-58

           23.1.13 DMI  Directional Movement Index ...................23-58

           23.1.14 DPO  Detrended Price Oscillator ...................23-59

           23.1.15 EMA  Exponential Moving Average ...................23-59

           23.1.16 EMV  Arm's Ease of Movement .......................23-59

           23.1.17 FFT  Fast Fourier Transform .......................23-60

           23.1.18 FFTCycle  Cycle via Fast Fourier Transform ........23-60

           23.1.19 HHV  Highest High Value ...........................23-60

           23.1.20 IfDn  One if Down .................................23-61

           23.1.21 IFF  If Function ..................................23-61

           23.1.22 IFFA  If Function for Arrays ......................23-61

           23.1.23 IfUp  One if Up ...................................23-62

           23.1.24 Isect  Find array intersection ....................23-62

           23.1.25 LinReg  Linear Regression .........................23-63





                                  Table of Contents
           23.1.26 LinReg2  Two Way Linear Regression ................23-63

           23.1.27 LLV  Lowest Low Value .............................23-64

           23.1.28 MACD  Moving Average Convergence/Divergence .......23-64

           23.1.29 MacdX  MACD Extended ..............................23-64

           23.1.30 MASS  " Mass "Index ...............................23-65

           23.1.31 MDI  Minus Directional Movement (-DI) .............23-65

           23.1.32 MFI  Money Flow Index .............................23-65

           23.1.33 MO  Price Momentum ................................23-66

           23.1.34 MOV  Moving Average ...............................23-66

           23.1.35 NVI  Negative Volume Index ........................23-67

           23.1.36 OBV  On Balance Volume ............................23-68

           23.1.37 OSCP  Price Oscillator ............................23-68

           23.1.38 OSCV  Volume Oscillator ...........................23-69

           23.1.39 Over  Over function ...............................23-70

           23.1.40 PDI  Positive Directional Movement (+DI) ..........23-70

           23.1.41 PER  Performance Indicator ........................23-70

           23.1.42 PER1  Performance using Array .....................23-71

           23.1.43 PVI  Positive Volume Indicator ....................23-71

           23.1.44 REF  Reference function ...........................23-72

           23.1.45 ROC  Rate of Change ...............................23-72

           23.1.46 RSI  Wilder's Relative Strength ...................23-72

           23.1.47 SAR  Parabolic Stop and Reverse ...................23-73

           23.1.48 SignMove  Find up/down moves ......................23-73

           23.1.49 Slope  Slope of Line ..............................23-73

           23.1.50 SMA  Simple Moving Average ........................23-74

           23.1.51 STD  Standard Deviation ...........................23-74





                                  Table of Contents
           23.1.52 STOCH  Stochastic Oscillator ......................23-74

           23.1.53 TMA  Triangular Moving Average ....................23-75

           23.1.54 TR  Wilder's True Range ...........................23-75

           23.1.55 TrendLine  Create a Trendline .....................23-75

           23.1.56 TrendPar  Parallel Trendline ......................23-76

           23.1.57 TRIX  Triple Exponential ..........................23-76

           23.1.58 TSF  Time-Series Forecast .........................23-77

           23.1.59 VAR  Statistical Variance .........................23-77

           23.1.60 VHF  Vertical/Horizontal Filter ...................23-77

           23.1.61 VMA  Variable Moving Average ......................23-78

           23.1.62 VOL  Chaikin's Volatility .........................23-78

           23.1.63 WC  Weighted Close ................................23-78

           23.1.64 WILLA  William's A/D ..............................23-78

           23.1.65 WILLR  William's %R ...............................23-80

           23.1.66 ZIG  Zig Zag ......................................23-80


          24. PROFIT TEST STATEMENTS...................................24-1

          24.1 PLOT STATEMENT: DEFINE TECHNICAL INDICATORS.............24-1
          24.2 BUY WHEN - DEFINE BUY CONDITIONS........................24-1
          24.3 SELL WHEN - DEFINE SELL CONDITIONS......................24-2
          24.4 STOP (LONG OR SHORT) CONDITION..........................24-2
          24.5 TAS PROFIT TESTER FUNCTIONS.............................24-2
           24.5.1 Profit Test Phases - Advanced Use Only ..............24-3

          25. "POUND" (#) COMMANDS.....................................25-1

          25.1 OUTPUT_FILE COMMAND.....................................25-1
           25.1.1 Appending to Output File ............................25-1
           25.1.2 Suppressing TAS Report Heading ......................25-2
          25.2 MAX_QUOTES COMMAND......................................25-2
          25.3 SCAN_DATE COMMAND.......................................25-2
          25.4 PROFIT_TEST COMMAND.....................................25-3
          25.5 INDEX COMMAND...........................................25-4
          25.6 INCLUDE COMMAND.........................................25-4
          25.7 TITLE COMMAND...........................................25-4
          25.8 COMPRESS COMMAND........................................25-5





                                  Table of Contents
          26. ASCII FORMAT HISTORICAL DATA FILES.......................26-1


          27. INDEX.......................................................1





                                     Introduction

            1. Introduction

            The first chapters of this book (up through the chapter titled
            "Ticker Lists - Group Securities) contain information about
            the Installation, Customer Support and Operation of Technical
            Analysis Scanner (TAS). The installation and setup instructions
            are explained. In addition, the menu structure and interactive
            commands are described.

            The chapters starting at Script Language Description contain
            information on the TAS Script Language and built-in functions.


            1.1 TAS Description

            Technical Analysis Scanner (TAS) is a computer program that
            lets you scan and analyze your stock, commodity, mutual fund or
            market index data base using the power of your computer.

            You can base your analysis on popular strategies or develop
            your own strategies.  Thus you have at your fingertips a
            powerful tool which can be of help when you make decisions
            about your securities portfolio.


            1.2 TAS Features

            TAS includes numerous special features that make scanning and
            analysis of your securities database easier than ever:

              .  Complete Control - TAS is a generalized technical analysis
                 "tool box".  It is not a "black box" system where you have
                 no knowledge of the rules or control over its decision
                 making process.  With TAS, you have complete control over
                 the indicators chosen, their interpretation, and the
                 output formatting of your reports.

              .  High-Level Analysis - With TAS, you can combine over 60
                 built-in technical indicators, compare their values
                 against other indicators or values, make decisions based
                 on the result of those comparisons, and ultimately, create
                 a report which shows you what you want to see. The TAS
                 "scripting language" can use English words to express the
                 relationships between indicators or price/volume values.

              .  Massive Power- TAS is designed to enable you to go beyond
                 the simpler analytical power available with other charting
                 or scanning programs. TAS lets you apply your simple or
                 complex trading system to all, or any part of, the data in
                 your historical price/volume Data Base.  If you have a
                 trading strategy that relies on technical indicators or





                                     Introduction
                 price action, but you do not have the time to chart all of
                 your stocks everyday, then TAS is the tool you need.

              .  Custom Reports - TAS can also be used to create custom
                 reports on your stocks. For example, you can use it to
                 notify you when a particular stock has reached a certain
                 price, volume or technical indicator value.

              .  Profit Testing - With the Profit Tester feature, you can
                 confirm the profitability of your trading system.  TAS
                 goes back through your historical data, a day at a time,
                 applying your trading rules to the indicators and condi-
                 tions you specify.  It keeps track of the days you bought,
                 sold or were stopped out of positions, tabulating the
                 results on a daily basis, or in a summary report which
                 tells you how your system performed.

            The rest of this book tells you how to take advantage of the
            TAS features listed above.


            1.3 System Requirements

            In order to use TAS, you should have the following software and
            hardware configuration.

            1.3.1 Hardware

              .  An IBM PC processor type 80286 or above
              .  An EGA or VGA Monitor (EGA or VGA required for Charts)
              .  2 Megabytes of Hard Disk space
              .  Microsoft or Logitech Mouse (optional)
              .  2 Megabytes minimum memory


            1.3.2 Software

              .  DOS 5 or later
              .  EMM386
              .  QEMM 7
              .  Other compatible memory manager


            1.3.3 Data

            Historical Price/Volume Data in any of the following formats:

              .  "Computrac" Format historical data files  used by
                 Metastock, Investograph Plus, and Computrac, among others
              .  ChartPro or MegaTech data files
              .  Commodity Systems Incorporated (CSI) format
              .  AIQ data format
              .  Technical Tools data format





                                     Introduction
              .  Generalized ASCII format (*.PRN) files (See page 26-1 for
                 information on defining these files to TAS).
              .  Worden Brothers' "TeleChart 2000 "  data format

            1.4 Support and Upgrades

            1.4.1 Support

            You can get support for TAS problems or questions by contacting
            FlexSoft at the mailing address below:

              FlexSoft
              7172 Regional Street, #276
              Dublin, CA 94568

            or by telephone or fax  at 510-829-9733

            or by Email on the following services:


              OnLine Service     Userid

              Prodigy             JBMD65A

              FlexSoft BBS       SYSOP
              (510-829-2293)

              internet           moore@netco
                                 m.com

              Compuserve          76447,2367



            1.4.2 Updates to TAS

            The version and release identification system for TAS follows a
            decimal number scheme. The number to the left of the decimal is
            the version number, while the number to the right of the
            decimal point is the release number. The initial version of TAS
            was named "TAS 1.00 ", meaning version 1 release 00. The first
            change to TAS within version 1 was named "TAS 1.01 ". Note
            that the number to the right of the decimal point changes
            whenever there is any change to the TAS program, no matter how
            insignificant.

            Within a version, updates to the TAS program are free to
            registered users. Many times, continued development within a
            particular version will entail multiple releases, each of which
            adds new functions or features to the program. These additional
            features are generally not sufficient to justify a major
            version change, but in the aggregate, from release 00 to the
            latest release can be a significant enhancement to the program.





                                     Introduction
            Update versions of TAS are changes  to the product which are
            provided free of charge on the FlexSoft BBS (510-829-2293).

            On internet, you can use ftp to download fixes from the site
            ftp.netcom.com directory /pub/mo/moore.

            You can also obtain updates to TAS by U.S. Mail. If you need an
            update by U.S. Mail, please send $10 for shipping and handling
            in addition to the Upgrade Registration Fee (if applicable).
            Methods of payment are by check,  money order,  VISA,  or
            Mastercard credit card number (include expiration date).

            1.4.3 Upgrades to TAS

            When a  new version of TAS is released, the version number
            portion  of the name will increase by one and the release
            number will be reset to "00 " again. An Upgrade Release will
            require a new Registration Code and  an Upgrade Registration
            Fee.

            The FlexSoft BBS has an online order system which you can use
            to purchase your new TAS upgrade.  You will need a VISA ,
            Mastercard, or American Express credit card number to order
            your update to TAS when using the online order system. Once
            your order is confirmed, you will be notified of your new
            Registration Code.

            1.4.4 Redistribution of TAS

            You may redistribute TAS to BBS systems or other public loca-
            tions as long as you distribute the entire package (either .ZIP
            or self-extracting .EXE file format).


            1.4.4.1 Registration Code Secrecy
            You may not divulge or redistribute your registration code ,
            nor may you transfer it to anyone else.

            If you give your registration code to an unregistered party, or
            parties, that registration code will be invalidated and your
            code will not work for future upgrades to TAS or any other
            FlexSoft product until a new code is obtained at the full price
            for the product whose code was compromised.

            1.4.5 Other FlexSoft Products

            FlexSoft also has two companion products for users who wish to
            order them. The first product is called PTT (Personal Ticker
            Tape), and the second is called PDL. With the combination of
            TAS, PTT and PDL, you have "end to end" access to your stock
            market data. PDL downloads the quotes, PTT updates the
            database, and TAS allows you to search, analyze, report, and
            chart the data.  PTT and PDL are described below.





                                     Introduction
            Each of these programs can be ordered from FlexSoft or
            downloaded from internet,  Compuserve or other online systems
            (over which we have no control).


            1.4.5.1 PDL (Prodigy Down Loader)
            PDL is a program that downloads, or captures, daily quote data
            and market indices from the Prodigy Information Service. PDL
            can download up to 4,000 daily quotes in a single run. If you
            need to download more quotes, then you can run PDL several
            times. It uses the Quote Track and/or Market Close features of
            Prodigy to obtain the quotes, so there is no need to go into
            Prodigy and enter the quotes by hand, as some systems require
            you do. The creation of the ticker list of quotes to download
            can be done with a simple TAS script.

            PDL also has a "vacation mode" that will enable you to go on
            vacation or leave town for extended periods and still gather
            daily quote data.


            1.4.5.2 PTT (Personal Ticker Tape)
            PTT converts quotes from GEnie, DowJones, Prodigy, Dial Data
            and Compuserve  into MetaStock data files and an ASCII format
            for input to spreadsheets.

            PTT produces summary reports on all your Metastock files
            whether you update the files with PTT or not. Colors are used
            to highlight those stocks which exceed either price or volume
            limits you set in the installation procedure. PTT also creates
            a Summary Report file.

            PTT can also be used to download closing quotes directly from
            Dial Data, Compuserve, GEnie, or Dow Jones News data services.

            1.4.6 Credits

              .  MetaStock Professional is a stock charting program from
                 Equis Inc.
              .  ChartPro and MegaTech are stock charting programs produced
                 by Ret-Tech
              .  GEnie is a trademark of General Electric Co.
              .  Prodigy is a trademark of Prodigy Services Co.
              .  WindowsR is a product of Microsoft.
            1.4.7 Disclaimers

            In no event will FlexSoft (or any of  its employees or owners)
            be liable to you for any damages, including any lost profits,
            lost savings, or other incidental or consequential damages
            arising out of the use of, or inability to use the program.
            This product is distributed "as is" with no warranty expressed
            or implied.





                                     Introduction
            FlexSoft reserves the right to make modifications at any time.
            Prices are subject to change without notice.

            1.4.8 Technical Analysis References

            The_Encyclopedia_of_Technical_Market_Indicators, Colby &

            Meyers, Dow Jones Irwin Press, 1988, ISBN 1-55623-049-4
            New_Concepts_in_Technical_Trading_Systems, J. Welles Wilder

            Jr., Trend Research, 1978, ISBN 0-89459-027-8
            The_New_Commodity_Trading_Systems_and_Methods, Perry J.

            Kaufman, John Wiley and Sons 1987, ISBN 0-471-87879-0
            Metastock_Professional_Users_Guide, Equis International

            Technical_Analysis_of_Stocks_and_Commodities_, Technical

            Analysis Inc., numerous issues cited when used.





                                    Installing TAS

            2. Installing TAS

            The TAS 6 package is distributed as two separate .ZIP format
            files.

            The first of the two files is named TAS6rr.ZIP (where "rr " is
            the release number).  The name of the file is  based on the
            version and release level of TAS. For version 6 release 00, the
            name will be 'TAS600.ZIP, and in general, the name will be
            'TASvrr.ZIP where 'v' is the Version and 'r' is the Release.

            The second file is named TAS6XX.ZIP. The TAS6XX.ZIP file is a
            group of compiler, graphics, and printer drivers that do not
            change from release to release. You should only download the
            TAS6XX.ZIP file one time. The main TAS 6 program code and
            release related files are in the TAS6rr.ZIP file.

            The following section shows how to get TAS up and running on
            your system initially.


            2.1 Installing from floppy disk

            If you received TAS on a floppy disk, follow the installation
            instructions that came with the disk. You should place the
            diskette in the appropriate floppy drive, "log" to that drive
            (e.g., type A:<Enter>), then type INSTALL. Choose the TAS
            Installation option and follow the instructions.


            2.2 Installing from downloaded files

            If you have found TAS 6 on a BBS or other online system, you
            should initially download both  files, TAS6XX.ZIP and
            TAS6rr.ZIP. ("rr " = release number).

            Be sure that you have both files before proceeding with the
            following steps to install TAS 6.

              1. Create a directory to contain TAS software. It can be any
                 name you choose. The following instructions assume the
                 subdirectory name is "\TAS". To create a directory named
                 \TAS on your C: drive, type "MD C:\TAS"

              2. You should copy TASvrr.ZIP into directory \TAS  by typing
                 COPY TASvrr.ZIP C:\TAS
                 COPY TAS6XX.ZIP C:\TAS
                 CD \TAS

              3. Type
                 PKUNZIP TASvrr -d
                 that is, if the file is TAS600.EXE, type 'TAS600 -d'. This





                                    Installing TAS
                 will start a file extraction procedure that sets up the
                 files necessary for running TAS. You should reply "Y" to
                 the prompt tha tinitially appears.

              4. Type
                 PKUNZIP TAS6XX -d
                  to extract the compiler and support files for TAS 6.

            2.2.1 Initial Program Setup

            Once the files are installed in the TAS subdirectory.

              1. Type TAS  and press ENTER.

              2. If you have not registered TAS yet, you will see a help
                 window telling you that you are running a Trial Version of
                 TAS. Press the ESC key to leave this screen.

              3. If you have never run TAS before, or if you are installing
                 into an empty directory , you will now be placed in the
                 Main Menu/Setup/Register Program screen of TAS.

              4.  If you have registered TAS, it is time to enter your
                 registration code and name. Enter your name using upper
                 and lower case as a proper name should be entered, and
                 then enter your registration code as given to you on your
                 FlexSoft invoice or by other means. After you enter the
                 registration code, hit the ENTER key or click on the OK
                 button to save your settings. Now leave the program to
                 make the registration procedure take effect. The next time
                 you enter TAS,  you will not be placed in the
                 Setup/Register Program dialog box. If you want to make
                 sure you are registered correctly, choose the Help/About
                 command.

              5. After restarting TAS, choose Setup to display the Setup
                 menu.

              6. Now choose Data Directories from the Setup menu. You
                 should use this dialog box to inform TAS of the
                 location(s) of your historical data files. You can add an
                 individual directory by choosing the Add button, or you
                 can let TAS scan your disk for candidate directories by
                 choosing the Scan button.



                     Use the Scan button to search for directories



                      To Scan for candidate directories and automatically
                      determine the historical data format and the





                                    Installing TAS
                      directory name, choose the Scan button. This will
                      open a dialog box where you can choose the types of
                      directories to search. You should then enter a
                      starting drive and directory in the Path to Scan
                      field. For example, if you have all your Metastock
                      format directories under the main directory
                      E:\msdata, you would enter that name in this field.
                      Choose OK to start the scan. After the scan
                      completes, all directories containing the type(s) of
                      data you specified will be added to the directory
                      list.



                   Use the Add Button to add indiividual directories



                      To add an individual directory, choose the Add
                      button. You will be presented with a Change Directory
                      dialog box which displays directories and
                      subdirectories in a "tree " format. Using the mouse
                      or the cursor, navigate by clicking on a directory
                      name. To choose another drive, double click on the
                      Drives word in the list box. Once the directory
                      containing the historical data files you desire to
                      add is shown in the list box, double click it with
                      the mouse, or highlight it and use the TAB key to
                      move to the OK button. TAS will scan the directory
                      and determine the historical data directory format
                      from the directory's contents.



                                TAS is now installed .



              1. When all your historical data directories have been added
                 to the directory list, choose the OK button to save your
                 directory list settings.


            2.3 Creating a Ticker List

            Before you can use TAS with your data directories, you should
            create a ticker list. The following steps take you through the
            creation of a sample ticker list. For additional instructions
            on using the Ticker List Editor, see Ticker Lists - Group
            Securities, page 8-2.

              1. Go to the File Menu item. Select New. You will see a
                 submenu open with several file type choices. Choose Ticker





                                    Installing TAS
                 List by moving the cursor bar down to that selection and
                 pressing ENTER. If you have a mouse, you can click on the
                 menu item itself.

              2. After a moment, TAS will present you with a list of all
                 the tickers it found in the Data Directories you defined
                 in the Setup/Data Directories dialog.You will now see a
                 dialog containing two lists. The list on the left is the
                 Unselected ticker list. The list on the right is the
                 Selected ticker list. At this point, no ticker symbols
                 have been selected. Move the cursor (the highlighted bar)
                 to the ticker symbol you wish to select, then press the
                 SPACE bar. The selected ticker symbol will be moved from
                 the Unselected list to the Selected list on the right.

              3. Continue selecting ticker symbols for your ticker list
                 until you have done them all.

              4. To Save this ticker list, choose the File/Save As menu
                 item (using the mouse or by typing alt-F/A.  You will now
                 be presented with a File Save Dialog where you should
                 enter the name of the ticker list. Enter the word
                 "MYTICK " in the File Name field. Press ENTER or click on
                 the OK button. This will save the ticker list you just
                 created.

              5. Now, to activate the ticker list as the default ticker
                 list, go to the Setup screen and choose the command Set
                 Ticker List. In the Open Ticker List dialog box that
                 appears, choose the name of the ticker list you just
                 created ("MYTICK.TCK "). Click on the OK button to close
                 the dialog box. You should see the word "MYTICK " appear
                 in the lower right corner of the screen. This is the name
                 of the currently active ticker list.


            2.4 Creating a Selection

            The first selection you will create will show all securities
            for which the 30 period Rate of Change of the Close is greater
            than 0% and whose Close is greater than the 21 day exponential
            moving average. For additional instructions on using the
            Selection Editor, see, Selections - Scan and Profit Test page
            7-1.

              1. At the Main Menu, select  File/New/Selection. This action
                 will open up the Selection Editor, a spreadsheet-like grid
                 containing rows and columns.

              2. Since this is a new selection, there are no formulas or
                 conditions displayed. Your cursor will be positioned in
                 the first row of the editor. This cell contains the letter
                 "F ", indicating this is a formula type cell.





                                    Installing TAS
              3. Move the cursor to the second column, and press the ENTER
                 key. Pressing the ENTER key opens up the cell for your
                 typed input. Type the word  FML1. This is the name we will
                 use for the first indicator. Press ENTER to save the
                 changes to the cell.

              4. Press the TAB key to move to the third column. Place the
                 formula ROC(C,30,'%') and press ENTER. This will compute
                 the 30 day percentage Rate of Change of the close.

              5. Now, to add a second row, choose the Edit/Insert Row
                 command (type Alt-E, and move the cursor to the Insert Row
                 menu command). A new row will appear below the first row.

              6. Move the cursor to the second column of the second row.
                 Type ENTER or double click with the mouse in this cell.
                 Now type FML2 in the cell. Press ENTER to save the name.

              7. Press TAB to move to the third column and enter the
                 formula EMA(C,21). This is the 21 day exponential moving
                 average formula.

              8. Add another row as described in step 5 above. Press ENTER
                 in the first column of the new row. Move the cursor to the
                 line containing the word Condition and press ENTER. This
                 makes the row a Condition row.

              9. Move to the third column (skipping the second), press
                 ENTER and place the words
                 "FML1 >  0 AND FML2 < CLOSE "
                 in this cell (without the quotation marks). Press ENTER.

              10.Choose File/Save to save the selection. Give it any name
                 you choose.

              11.Choose Run/Execute to run the selection. When the run
                 completes, you will see a Selection Output View (see page
                 7-13 for complete instructions).

              Choose Display/True Conditions to reduce the list to those
                 securities matching your conditions. You can then sort or
                 print this list.





                                 Command Line Options

            3. Command Line Options

            You can start TAS with the following format command:

            TAS [switches] [scriptName] [tickerListName]  [@parameters]

            The options in brackets are optional and need not be specified.

            You can start TAS in "MENU MODE" by simply typing "TAS" by
            itself. TAS has switches available which you can specify on the
            command line. They are:


            Switch    Meaning

            -b        Black and white color
            -c        Color screen
            -l        Large 43 line screen
            -o        Create an encoded
                      object file (*.TAO)
            -m        Use Monochrome color
                      scheme
            -p        Use IniFileName
            IniFileNa instead of TAS.INI
            me


            If you are a registered user of TAS, you can also start TAS in
            "batch mode" by specifying the name of a SCRIPT, the
            scriptName,  and the Ticker List, the tickerName, on the
            command line. So, if you had a TAS script named "SELECT.TAS"
            and a Ticker List named "MYSTOCK.TCK", you could run the SELECT
            script against the stocks in the list MYSTOCK by typing:

                 TAS SELECT MYSTOCK

            If you wanted TAS to process all of the stock symbols (Tickers)
            in your data base, you can omit the Ticker List name.

            You can also specify initial script statements to be executed
            at the beginning of the script by specifying parameters on the
            command line, preceded by the "@" sign. Each statement should
            be terminated by a semi-colon, just as it would be if it were
            inserted at the beginning of the script.

            .





                                     Desktop Menus

            4. Desktop Menus


            4.1 The TAS Desktop

            The TAS Main Menu is the starting point when you work with TAS.
            It contains a horizontal menu with four items, File, Setup,
            Windows, and Help.





                                                           4.1.1 Multiple
                                                           Editors,
                                                           Multiple
                                                           Windows

                                                           The TAS menu
                                                           follows the
                                                           structure of a
                                                           typical
                                                           WindowsR
                                                           program. TAS
                                                           implements a
                                                           " multiple
                                                           document
                                                           interface "
                                                           that provides
                                                           you with a
            desktop on which you can view or edit multiple file types  in
            multiple windows. These windows can be manipulated with the
            commands found under the Windows menu as described on page 4-
            10.

            At any time, when there is at least one window on the desktop,
            there is one active window. A window can be made active by
            clicking in it with the mouse, or by using the Windows/Next or
            Windows/Previous command to set it active.

            Depending on the type of window that is active, the horizontal
            top menu will adapt to the commands and options that are
            available for that window or file type.

            4.1.2 Accessing the menus

            There are several ways to activate or access commands in the
            menu structure. To activate a particular menu, you can press
            the Alt key plus the letter of the menu you wish to activate.
            For example, to activate the File menu, press the Alt key and
            the F key together. This will cause the File menu to "drop
            down , exposing its menu items.





                                     Desktop Menus
            You can also use the mouse to directly click on a menu item,
            causing the menu to drop down.

            The F10 function key will activate the horizontal menu without
            dropping a menu down. You can then use the arrow keys to
            navigate left or right to the menu item you want to access.

            4.1.3 The Status Bar

            There is a Status Bar at the bottom of the desktop. This
            contains useful commands that are active or available at that
            time. If a command shown on the Status Bar is not available, it
            is greyed.  You can use the commands on the status bar by
            clicking on the highlighted command with the mouse, or by
            typing the command keys directly.


            4.2 File

            When you select the menu command File/New or File/Open, TAS
            prompts you for the type of file to open. For each file type
            (page 4-4), TAS invokes a different editor to display and
            modify the particular file type.

            4.2.1 New

            The New command lets you create a new window. This menu choice
            will open a submenu from which you can choose the type of file
            editor window to create. See the File Types section (page 4-4)
            for the types of file editor windows you can create.

            4.2.2 Open

            The Open command lets you open an existing file (or a new file
            if you specify a file name that does not exist). This menu
            choice will open a submenu from which you can choose the type
            of file to open. See the File Types section (page 4-4) for the
            types of files you can open.

            4.2.3 List

            The List command shows you a list of  TITLES from the files in
            the directory.. This menu choice will open a submenu from which
            you can choose the type of files to list.  See the File Types
            section (page 4-4)  for the types of files you can list.

            4.2.4 Save

            The Save command will save the file in the active window to the
            same location and type as when it was last saved with the Save
            As command.





                                     Desktop Menus
            If the file was just edited with the New command, TAS will
            display the Save As dialog box so you can name the file for the
            first time.

            4.2.5 Save As

            The Save As command lets you specify a new name or location for
            the active file.This command opens a Save As dialog box which
            lists the files of the active window's file type.

            4.2.6 Print

            The Print command will print the contents of the active window
            to the printer defined in the Printer Setup printer port.

            4.2.7 Printer Setup

            In order to print from a file editor or use the PrintGraph
            function or the "alt-P" key while displaying a graph to print a
            graph with TAS,  you need to prepare TAS with the Printer Setup
            screen. The values you need to set are described below.

            The Printer Setup command opens a printer setup dialog box.
            Once all options have been set correctly, click the OK button
            or hit ENTER to save the settings.


            4.2.7.1 Printer Port
            Choose the printer port to which your printer is attached. If
            you intend to send the output to a file, choose FILE rather
            than a specific printer port name.


            4.2.7.2 Printer Type
            The Printer Type field describes the printer or printer capture
            file to which you want to send your PrintGraph output. The
            choices are shown in the list box under the label.


            4.2.7.3 Resolution
            Choose a resolution from Low, Medium or High.


            4.2.7.4 Orientation
            The orientation choice is either Portrait or Landscape.
            Portrait orientation will print the graph with the shorter side
            of the paper at the top of the graph. Landscape is usually
            better for graph printing.





                                     Desktop Menus
            4.2.8 DOS Shell

            The DOS Shell command can bring up a DOS shell from which you
            can return to TAS by typing EXIT. This command will only work
            if you have at least 128Kb free memory available while in TAS.

            4.2.9 Exit

            The Exit command will close all windows and return to DOS. If
            you have any modified windows that might need to be saved,  you
            will be asked whether they should be saved.


            4.3 File Types

            The File/Open, File/New, and File/List menu items will show a
            popup menu that lists the file types available in TAS. The file
            types are

            4.3.1 Scripts

            A Script is a free form text file containing TAS Script
            statements used to control the processing of a TAS run.
            Selections (described below) are scripts as well, but they are
            specially formatted to be used with the TAS Selection editor.

            4.3.2 Selections

            Selections are a special kind of script that can be used for
            scanning, profit testing, sorting and/or ranking, as well as
            graphing securities. A Selection file ends with the file
            extension "SEL ".

            4.3.3 Ticker List

            A Ticker List is a special file containing a list of security
            ticker symbols which can be treated as a subset of your total
            historical database.


            4.4 Setup

            The Setup Menu is used to tell TAS the location of your Data
            Directory(ies), your specific Program Options, where TAS is to
            look for each of its file types, color settings and
            Registration.

            The Setup options are accessed from the main menu item Setup.
            Each of the items on the Setup menu is described below:





                                     Desktop Menus
            4.4.1 Data Directories

            The Data Directory menu choice presents a panel that appears as
            shown below:



            Up to 180 directories can be defined on the Setup/Data


















            Directories dialog.

            The Data Format types are:


            Description                 File
                                        Types

            Metastock/Computrac format  *.DAT
            files
            ChartPro/MegaTech files     *.PRO
            Commodity Systems Inc       *.DTA
            files
            Technical Tools Data        *.TTD
            AIQ Stock Expert/Trading    *.DTA
            Expert files
            ASCII format *.PRN files    *.PRN
            TeleChart 2000 format       *.NDX
            files





                                     Desktop Menus

            4.4.2 File Directories

            The File Directories menu enables you to set default directory
            locations for the various types of  files that TAS will access.
            This is not required, but you might find it neater to separate
            your scripts from you selections from ticker lists  and other
            file types by keeping them in individual directories rather
            than all in                                     the TAS
            directory.




            4.4.2.1 Scri                                    pt Directory
            This is the                                     directory that
            will be                                         accessed when
            you specify                                     a script name
            without a                                       directory
            qualifier.


            4.4.2.2 Sele                                    ction
            Directory
            This is the                                     directory that
            will be                                         accessed when
            you specify                                     a selection
            without a   `                                   directory
            qualifier.


            4.4.2.3 Ticker List Directory
            This is the directory that will be accessed when you specify a
            ticker list without a directory qualifier.


            4.4.2.4 Output Files
            This is the directory in which your listing files will be
            placed in the absence of a directory name on the #OUTPUT_FILE
            specifier.


            4.4.2.5 ASCII I/O Directory
            This is the directory where the AOpen  (ASCII File Open)
            function looks for the file being opened.


            4.4.2.6 Data Base Directory
            This is the directory where the *.DBF and *.NDX DBase III
            compatible files are located. It is also the location of the
            *.DBD (Data Base Definition) files.





                                     Desktop Menus



















            4.4.3 Program Options



            The Program Options menu item opens a new menu which can be
            used to modify settings used within TAS.




            4.4.3.1 Include Ticker Period
            If you only have one type of data file (Daily or Weekly or
            Monthly), you should leave this option unchecked.

            Otherwise, this option should be checked if you have multiple
            tickers with the same ticker symbol but different "periods".
            For example, if you have a DAILY and a WEEKLY file for the
            symbol AAPL, you will need to check this option in order to
            distinguish between the daily and weekly ticker files.



            If you have TICKER LISTS created with this option checked,
            they will not work if you uncheck this option  (and vice
            versa). You will have to re-select the tickers again. TAS is
            distributed with this value unchecked (which means "No").
            Note also, that if you have this option checked, you must
            include the ticker file period in every reference to a ticker
            name, including references on the #INDEX command.





                                     Desktop Menus
            4.4.3.2 Access Tickers in Order of List
            Normally TAS will access security files in the order in which
            they are encountered in the historical data directories. The
            first directory is matched against the ticker list, then the
            second, etc.

            If you want to access the security data files in the order of
            the ticker list, rather than the directory order, check this
            option.

            The use of this option can have a detrimental effect on
            performance, since it might be necessary for TAS to switch from
            one directory to another as it moves from one security file to
            the next.


            4.4.3.3 Maximum Bars to Read
            The Maximum Bars to Read parameter specifies a default value
            for the number of quotes you want TAS to read into memory when
            loading a historical data file.. The higher this number, the
            longer the processing will take.

            This parameter only takes effect if the script or selection
            being processed does not contain a Max_Quotes setting. If the
            script or selection contains its own Max_Quotes setting, then
            that setting overrides this default value.



            This parameter can  have a significant impact on the
            processing time that TAS uses for each symbol. It should be
            set to as low a value as possible (based on the time periods
            you use in your indicators) so that the TAS processing is
            minimized.



            4.4.3.4 Default Index Symbol
            The Default Index Symbol is the ticker symbol name for the
            INDEX data array when no #INDEX command is present in the
            script or selection.

            4.4.4 Register Program

            When you register TAS , you will receive a Registration Code
            based on your Name. Whatever name you include in the file
            REGISTER.DOC will be used to form an encrypted code. Use the
            same name as sent  in the  REGISTER.DOC file. Place the
            Registration Code sent to you in the appropriate field.

            If you received an invoice with your TAS order, your name as it
            is expected to be entered, is shown on the invoice. You must





                                     Desktop Menus
            use the same upper and lower case settings as shown on the
            invoice for your name to match the coded registration code.

            4.4.5 Set Ticker List

            This menu item will invoke a File Open dialog box to allow you
            to choose the name of a Ticker List file which is used for
            running scripts and selections.

            The lower right corner of the TAS desktop shows the name of the
            currently active Ticker List.

            4.4.6 Clear Ticker List

            This menu item will clear the Ticker List to be used for
            running scripts and selections. When no ticker list is
            specified, TAS will process all securities in all directories.
            In other words, clearing the Ticker List means that TAS is to
            use all symbols when running a script or selection.

            4.4.7 Colors

            You can change the displayed color of most desktop and editor
            objects using this command. When Setup/Colors is chosen, a
            submenu opens containing Change and Reset commands. The Change
            command will open a color selection dialog box where you can
            choose the desktop or window attribute you wish to change. The
            Reset option will reset the color scheme to the default color
            scheme.

            Once the changes you desire are made, you can choose OK to save
            your color settings. Until the colors are changed or reset
            again, they will be used as you set them. The color settings
            are saved into the file TASCOLOR.STR.


            4.4.7.1 Change
            This command opens a color selection dialog box. On the left is
            a list of desktop, window or dialog classes. On the right is a
            list of attributes for each object on the left (the list
            changes as the left list is scrolled).

            Finally, on the far right are two colored boxes with Foreground
            and Background color choices. With the exception of a Graph
            color, you create a color by choosing a foreground and a
            background color (e.g. Red on Black).

            To set Graph colors, you only need to choose one of the
            foreground colors, since the background color is set
            separately.





                                     Desktop Menus
            4.4.7.2 Reset
            If you find that the colors you have chosen are not attractive
            or unreadable, you can use the Reset command to set the color
            scheme back to its original state.


            4.5 Windows

            Each of the open windows on the desktop is assigned the next
            available number from 1 to 9. The upper right portion of the
            title bar of the window contains the window number. You can use
            the Alt key plus the window number (e.g. Alt-3) to immediately
            activate the window with the window number 3.

            4.5.1 Size/Move

            The Size/Move command lets you change the size or location of a
            window on the desktop. You can use the mouse to size a window
            by holding down the left mouse button while positioned over the
            lower right corner of the window.

            4.5.2 Zoom

            The Zoom command  will enlarge a window to the full desktop
            area, or if already enlarged, will restore the window to its
            previous size.

            4.5.3 Tile

            The Tile command will create a tile pattern of the open windows
            on the desktop. Below is an example of a tiled desktop. Observe
            the four distinct windows that are tiled in each quadrant of
            the desktop.





                                     Desktop Menus


            4.5.4 Cascade

            The Cascade command will overlay window on top of each other so
            that just the title bar of each window is visible.

            4.5.5 Next

            The Next command will activate the next window on the desktop.

            4.5.6 Previous

            The Previous command will activate the previous window on the
            desktop.

            4.5.7 Close

            The Close command will close the active window, prompting you
            to save it if it has been modified since the last time it was
            saved.





                                      Run Window

            5. Run Window

            When you execute a script or selection, a "Run Window " opens
            on the desktop. This window becomes the active window until the
            selection ends, or until you use one of the Window commands to
            switch to another window.

            Any output WriteLn or other script screen output will be placed
            in the Run Window. While the Run Window is active, the menu
            shown below will appear.

            The Run menu                                      item
            contains one                                      selection,
            Pause/Contin                                      ue, which
            "toggles "                                        (stops or
            restarts)                                         the output
            from the                                          running
            script or                                         selection.
            You can also                                      toggle the
            output state                                      by entering
            the Alt-C                                         key or by
            pressing the                                      SPACE bar.

            Once the                                          script or
            selection is                                      paused, you
            can  use the                                      page
            movement                                          keys (PgUp,
            PgDn, End,                                        and Home)
            to scroll                                         the window
            back and forth, left and right. You can also use the scroll
            bars at the right and bottom of the window to move around the
            output area. A maximum of 2000 lines can be held in the output
            view buffer, meaning you can only view up to 2000 lines
            previous to the current output line.

            While a script or selection is running, you can switch to
            another window (using the Window menu), or edit another file
            using the File menu.  You can Tile, Cascade, or Size this
            window and any other windows while a script or selection is
            running.



            Note that while a script or selection is running, you cannot
            run a second script or selection. Once it completes, the
            Execute command will be re-enabled.





                             Scripts - Editing TAS Scripts

            6. Scripts - Editing TAS Scripts

            TAS has a built-in text editor which can be used to create and
            modify TAS script files. All TAS script files end with the
            suffix ".TAS".

            If you select the command File/Open/Script, the editor screen
            will then appear with the contents of the file displayed.

            If you select the command File/New/Script , you will see an
            empty input area where you can enter new lines of script
            statements.

            To save or print the Script Editor file in the active window,
            use the File menu.


            6.1 Script Editor Keyboard Commands


            Key(s)    Action Taken

            Ctrl+A    Moves one word left

            Ctrl+C    Scrolls down one screen

            Ctrl+D    Moves the cursor right one
                      column, accounting for the
                      autoindent setting

            Ctrl+E    Moves the cursor up one line

            Ctrl+F    Moves one word right

            Ctrl+G    Deletes the character to the
                      right of the cursor

            Ctrl+H    Deletes the character to the
                      left of the cursor

            Ctrl+I    Inserts a tab

            Ctrl+L    Edit|Search Again

            Ctrl+N    Inserts a new line

            Ctrl+P    Causes next character to be
                      interpreted as an ASCII
                      sequence

            Ctrl+R    Moves up one screen





                             Scripts - Editing TAS Scripts

            Ctrl+S    Moves the cursor left one
                      column, accounting for the
                      autoindent setting

            Ctrl+T    Deletes a word

            Ctrl+V    Turns insert mode on/off

            Ctrl+W    Moves down one screen

            Ctrl+X    Moves the cursor down one
                      line

            Ctrl+Y    Deletes a line

            Ctrl+Z    Moves the cursor up one line

            Ctrl+Shi  Performs an incremental
            ft+S      search

            End       Moves to the end of a line

            Home      Moves to the start of a line

            Enter     Inserts a new line with a
                      carriage return

            Ins       Turns insert mode on/off

            Del       Deletes the character to the
                      right of the cursor

            Tab       Inserts a tab

            Space     Inserts a blank space

            Ctrl+Lef  Moves one word left
            t Arrow

            Ctrl+Rig  Moves one word right
            ht Arrow

            Ctrl+Hom  Moves to the top of a file
            e

            Ctrl+End  Moves to the end of a file

            Ctrl+PgD  Moves to the bottom of a
            n         screen

            Ctrl+PgU  Moves to the top of a screen





                             Scripts - Editing TAS Scripts

            p

            Ctrl+Bac  Move one word to the right
            kspace

            Ctrl+Del  Deletes a currently selected
                      block

            Ctrl+Spa  Inserts a blank space
            ce

            Shift+Ta  Deletes the character to the
            b         left of the cursor

            Shift+Ba  Deletes the character to the
            ckspace   left of the cursor

            Shift+Le  Selects the character to the
            ft Arrow  left of the cursor

            Shift+Ri  Selects the character to the
            ght       right of the cursor
            Arrow

            Shift+Up  Moves the cursor up one line
            Arrow     and selects from the left of
                      the starting cursor position

            Shift+Do  Moves the cursor down one
            wn Arrow  line and selects from the
                      right of the starting cursor
                      position

            Shift+Pg  Moves the cursor up one
            Up        screen and selects from the
                      left of the starting cursor
                      position

            Shift+Pg  Moves the cursor down one
            Dn        line and selects from the
                      right of the starting cursor
                      position

            Shift+En  Selects from the cursor
            d         position to the end of the
                      current line

            Shift+Ho  Selects from the cursor
            me        position to the start of the
                      current line





                             Scripts - Editing TAS Scripts

            Shift+Sp  Inserts a blank space
            ace

            Shift+En  Inserts a new line with a
            ter       carriage return

            Ctrl+Shi  Selects the word to the left
            ft+Left   of the cursor
            Arrow

            Ctrl+Shi  Selects the word to the right
            ft+Right  of the cursor
            Arrow

            Ctrl+Shi  Selects from the cursor
            ft+Home   position to the start of the
                      current file

            Ctrl+Shi  Selects from the cursor
            ft+End    position to the end of the
                      current file

            Ctrl+Shi  Selects from the cursor
            ft+PgDn   position to the bottom of the
                      screen

            Ctrl+Shi  Selects from the cursor
            ft+PgUp   position to the top of the
                      screen

            Alt+Back  Edit|Undo
            space

            Alt+Shif  Edit|Redo
            t+Backsp
            ace





                             Scripts - Editing TAS Scripts
            6.2 Editor Function Keys

              F1      HELP Key
                      If you need help with the editor, hit the F1 (Help)
                      Key. You will see a list of editor commands.
              F2      Save Script File Key
                      When you are done with your editing, you can save the
                      file by hitting the F3 (Save) Key. If you do not want
                      to save the file, hit the ESC (Abort) Key.

              Ctrl-F9 Run Script Key
                      The Run Script key will run the script you are
                      currently editing without_saving_it back to its

                      original script file. 

              Alt-F9  Check Script Key
                      If you wish to check your script file for errors in
                      syntax, press the Alt-F9 key. If there are errors in
                      the script which can be detected by the Check Script
                      function, an error message showing the type of error
                      encountered and the line and column number on which
                      the error occurred will appear in a window at the
                      bottom of the screen. This window will disappear
                      after a few seconds or when you hit a key. Then the
                      script file will be positioned so that the cursor is
                      on the line where the error was detected. It is
                      usually the case that the error is somewhere either
                      on that line or on the previous line.

              F7      Formula Builder Key
                      One key available in the editor is the Formula
                      Builder Key. This key will bring up a list of
                      Technical Indicator functions and Pre-defined Data
                      Arrays. If you select one of the functions or arrays,
                      the subsequent parameters of the function (e.g. MOV
                      "Moving Average" requires 3 additional parameters)
                      will be prompted. Enter each parameter. When you are
                      done, the formula and parameters will be placed into
                      your script file at the location of the cursor when
                      you hit F7.





                           Selections - Scan and Profit Test

            7. Selections - Scan and Profit Test

            Using the Selection feature of TAS, you can create your own
            custom report containing columns of calculated formulas or data
            values for each security data file. You can use Conditions to
            specify conditions so you can restrict your report to
            securities matching the conditions you specify. The selection
            output report is a horizontally and vertically scrollable view
            of all calculated values and conditions.

            You can use the same formulas and conditions to scan, sort, or
            filter data as of the current date, or you can combine the
            formulas and conditions from your selection with profit test
            buy and sell conditions which will allow you to test the system
            over time.

            If your selection includes buy and sell conditions, and you
            choose to run it without turning on the profit test processing,
            TAS will inform you if any buy or sell conditions occurred as
            of the current date.

            To begin using the Selection Editor, choose File/New/Selection
            or File/Open/Selection to open a new or existing selection
            file.

            7.1 Entering Input into the Selection

            When you open a selection editor, the arrow keys and the mouse
            will allow you to navigate from cell to cell.

            If you want to modify a cell's contents, you must press ENTER
            or double-click with the mouse on the cell to be modified. Once
            you do this, the cell will open for input. Make your changes
            and then press ENTER to save your modifications back to the
            cell.

            If, after having opened the cell for input by pressing ENTER,
            you decide you want to restore the cell to its original
            contents, press the ESC key.

            While a cell is opened for input, you can use the editor keys
            described in Script Editor Keyboard Commands (page 6-1). with
            the following exceptions:

             Use of the vertical cursor movement keys (Up Arrow, Down
            Arrow, Page Up,  etc), will implicitly generate an ENTER key to
            accept your changes, prior to performing the cursor movement.

            In addition, the TAB and Shift-Tab keys will store your changes
            and move to the right or left column, respectively.





                           Selections - Scan and Profit Test
            7.2 Column Meanings

            The Selection editor is similar to a spread-sheet in
            appearance. It is displayed as a grid of rows and columns. Each
            row/column position in the grid is referred to as a cell. The
            editor consists of rows of six columns, where each row
            represents a formula to be calculated in the final report or a
            condition for selection or profit testing.  The column headings
            are fixed, but the number of rows is variable.

            The Selection columns are labeled as shown below:


             1     2         3        4     5    6

            Typ  Formu  Formula/Con  Tit  Grap  Hid
            e    la     dition       le   h     e
                 Name   Description  Tex  Numb
                                     t    er

            .

            The Type column contains a letter indicating the type of row to
            its right. When you modify a cell in this column, a list box
            opens up with the following choices:


            Cod Field   Meaning
            e   Type


            F   Formul  An expression that
                a       computes a result value
                        to be used in the
                        output or to create
                        another formula


            C   Condit  A True or False
                ion     expression used for
                        selecting subsets of
                        resulting report


            B   Buy     A Buy condition


            S   Sell    A Sell condition


            L   Stop    A stop condition for a





                           Selections - Scan and Profit Test

                Long    long position


            T   Stop    A stop condition for a
                Short   short position




            By choosing one of the types from the list box, you define the
            contents of the row containing the cell. The following topics
            provide additional information on each of the row types.


            7.3 Entering Formulas

            Position the cursor on the row you want to modify. If no empty
            row exists, pres s the alt-I (Insert Row) key to add a new row.
            To modify a cell in a row, remember to press the ENTER key
            first.

            Move the cursor to the first column. Press the ENTER key. Move
            the cursor to the Type entry for Formula. Press ENTER to save
            the result.

            7.3.1 Naming the Formula

            If you intend to use this formula in a subsequent condition or
            formula, you will need to give it a name. Move the cursor to
            the second column. Press ENTER. Enter a unique name for the
            formula. This name should not conflict with any builtin TAS

            variable or function names (e.g., do not name a formula
             "OV ", since this is the name of the Moving Average
            function). To be on the safe side, you might start by using
            FML1 through FMLn for your formula names. Press ENTER to save
            the result.

            7.3.2 Entering the Formula itself

            Now, move the cursor to the 3rd column (Formula/Condition
            Description). This cell is required for a formula type row.
            This is where you place the indicator or combination of
            indicators you want to compute. You can place any formulas or
            data value in this area. To modify this cell, press ENTER. You
            can type in the formula or expression directly with the
            keyboard at this point, or you can use the F7 (Formula Builder)

            key.





                           Selections - Scan and Profit Test
            7.3.3 Using the Formula Builder Key

            If you press the F7 key while modifying the third column, a
            dialog box containing a list of built-in  functions will be
            shown on the screen. Move the cursor to the indicator function
            you want to include and press ENTER. You will be prompted for
            the parameters of the function. Enter each parameter and press
            ENTER when complete. Now click on OK to store the formula in
            the cell.

            7.3.4 Entering Titles

            Once you have entered a formula, you can assign a name to it
            that will appear on the output report. This name can be up to
            10 characters. Move the cursor to the fourth column, press
            ENTER, and type in your formula name as you wish it to appear
            on the report output column heading.

            If you do not enter a title in this column, the formula
            description from the third column will appear in the report
            output instead.

            7.3.5 Entering a Graph Number

            You can use the selection screen to pre-define the graphs you
            want to view when the selection report output screen is being
            viewed. To add a graph window number to the computed formula,
            move to the fifth column of the row, press ENTER.

            If you want to be able to build a quick graph of the resulting
            list of securities after running this selection, enter a "graph
            number" in this column.

            The "graph number" tells TAS which portion of the chart area to
            graph the formula.



                          Including the High/Low/Close chart



            If you want to include the price/volume high-low-close bar
            graph in the n'th window, add a formula for the Closing price
            ("C") and place the letter "P" in front of the graph window
            number. For example, to place the high-low-close bar graph in
            the 2nd window, place a "P2" in a row containing the CLOSE
            data array as the Formula value.

            7.3.6 Hiding a Column of Output

            Normally, each Formula and condition you specify in the
            Selection Editor will appear as a column of output in the





                           Selections - Scan and Profit Test
            Selection Report. Sometimes, either to reduce the size of the
            report, or to compute intermediate results of no interest, it
            is desirable to hide or suppress the result from the Selection
            Report output.

            In order to suppress the result of a calculation from the
            output, move to the sixth column of the row and enter the
            letter "Y " in this column. Any character placed in this
            column will hide the result from the Selection Report screen.


            7.4 Entering Conditions

            Conditions are True/False results of a comparison or relational
            expression. If you want to restrict your Selection Report
            output to only those securities that match a condition or group
            of conditions, you should enter your conditions when you build
            the selection.

            An example of a condition is "Close of Today less than Close
            of  Yesterday . This statement is either true or false when
            evaluating the closing price of a particular security.

            To add a condition, move to the Type column (column 1), press
            ENTER, and select Condition from the list box. Press ENTER
            again. This makes the row on which the cursor is positioned
            into a condition type row.

            If you need to refer to the condition in a later row, you
            should give it a name, just as you would a formula (see Naming
            the Formula, page 7-3, for an explanation of naming formulas
            and conditions).

            Finally, if you want to show a title on the Selection Output
            report for the results of this condition, you should enter a
            title in the column labeled Title (see Entering Titles on page
            7-4).


            7.5 Entering Profit Test Commands

            A Selection can be used to do a Profit Test as well as a daily
            scan. If you add rows containing any of the following types,
            you will be able to use the selection either way. When run as a
            profit test, it will process your security data from some point
            you specify in the past to the point at which you say it should
            end, accumulating results of buy, sell and stop transactions.

            7.5.1 Buy

            The Buy type row contains a condition which if true instructs
            the Profit Tester to issue a buy transaction according to the





                           Selections - Scan and Profit Test
            rules you specify when you fill out the Edit/Profit Test
            Options dialog (page 7-8).

            7.5.2 Sell

            The Sell type row contains a condition which if true instructs
            the Profit Tester to issue a sell transaction according to the
            rules you specify when you fill out the Edit/Profit Test
            Options dialog (page 7-8).



            7.5.3 Stop Long

            The Stop Long type row contains a condition which if true
            instructs the Profit Tester to issue a stop from a long
            position according to the rules you specify when you fill out
            the Edit/Profit Test Options dialog (page 7-8). This
            transaction will sell any long positions.

            7.5.4 Stop Short

            The Stop Short type row contains a condition which if true
            instructs the Profit Tester to issue a stop from a short
            position according to the rules you specify when you fill out
            the Edit/Profit Test Options dialog (page 7-8). This
            transaction will buy to cover for any short positions.


            7.6 Edit Menu

            The Edit menu of the Selection Editor contains commands to add,
            delete and move rows. It also contains commands to open dialog
            boxes which set options for the selection, for profit testing,
            and for setting automatic profit test stops.

            7.6.1 Row Commands

            You can manipulate entire rows of the the Selection Editor with
            the following commands. These commands are accessed from the
            Edit menu of the Selection Editor. Each of the commands also
            has a hot key name next to it when you display the edito menu.

            7.6.1.1 Insert Row
            This command will insert a new row after the row containing the
            cursor. The Type of the row will be copied from the preceeing
            row. If you need to change the row type,  do so after the
            insertion.


            7.6.1.2 Delete Row
            This command will delete the row containing the cursor. If this
            is a formula or condition row with a name in the second column,





                           Selections - Scan and Profit Test
            make sure that any subsequent rows referring to the row's name
            are modified or deleted as well.


            7.6.1.3 Up Row
            This command will move the row containing the cursor up one row
            position.


            7.6.1.4 Down Row
            This command will move the row containing the cursor up one row
            position.

            7.6.2 Formula Builder

            You can use the Formula Builder command to insert built-in TAS
            functions with their parameters (or you can type the function
            and its parameters directly). The Formula Builder command opens
            a dialog box that contains a list of built-in TAS functions,
            sorted alphabetically by function name. To choose a function,
            move the cursor in the list box to the function name and press
            ENTER. A new dialog box will open to prompt you for the
            parameters and their types.

            For example, if you select MOV (Moving Average), the dialog box
            will contain three input lines, for an array, an integer, and a
            character variable entry. These correspond to the three
            parameters of the MOV function.

            7.6.3 Data Options

            The Data Options command of the Edit menu will open a dialog
            box where you can set options for the Selection or Profit Test,
            such as the Minimum and Maximum Quotes to Read to read, and any
            Index file you might want to use.


            7.6.3.1 File Title
            You can enter a File Title for the file that will appear when
            you choose the File/List/Selections menu. Enter a descriptive
            title for the file in the input area to the right of the
            label..

            7.6.3.2 Compression
            This is a combination listbox and input area (a ComboBox) If
            you want to compress your data to Weekly, Monthly or Yearly,
            click on the downarrow character at the right of the box. This
            will pull up a list box containing the choices for the standard
            compression periods.
            To revert to no compression, hit the SPACE bar when you first
            move to this field.
            If you enter a number in this field, the compression will be
            for groups of records containing the number you specify.





                           Selections - Scan and Profit Test
            7.6.3.3 Minimum Quotes
            You can specify the minimum number of quotes to load for the
            selection. If a security file has less quotes than this number,
            the file will be skipped.


            7.6.3.4 Maximum Quotes
            You can specify the maximum number of quotes to load for the
            selection.  Setting this value high enough to compute each
            indicator correctly and no higher will speed the processing of
            each ticker, since only relevant data will be loaded.


            7.6.3.5 Start Date
            If you want to start your selection on a specific date, specify
            that date here. Make sure that the date is a date you have in
            the file. If it is not, the test will begin on the first date
            prior to that date.


            7.6.3.6 End Date
            If you want to end your selection on a specific date, specify
            that date here. Make sure that the date is one you have in the
            file. If it is not, the test will end on the first date prior
            to the end date.


            7.6.3.7 Index Ticker
            If you want to run a selection that uses some index, such as
            the SP-500, you can specify the ticker here. Then, in your
            formulas for the selection, you refer to the index ticker's
            value with the INDEX array name.

            7.6.4 Profit Test Options

            The Profit Test Options command of the Edit menu will open a
            dialog box that has a number of options for running a profit
            test.


            7.6.4.1 Test Type
            The Test Type setting is a pair of checkboxes.

            Click on the Long check box to perform a profit test that buys
            long. A Long test only takes long positions, that is, it only
            buys to open a position and sells to close it.

            Click on the Short check box to perform a profit test that
            sells short. A Short test only takes short positions, selling
            to open and buying to close ("cover") the position.

            To test both long and short positions, reversing from one to
            the other on a buy or cover transaction, set both checkboxes.





                           Selections - Scan and Profit Test
            To run the selection without profit testing, leave both boxes
            unchecked. A Long and Short test opens a long or short position
            and reverses each time a signal is generated to "go the other
            way". This is essentially a "stop and reverse" system.


            7.6.4.2 Initial Cash
            This is the amount of "money" the trading should start with. It
            must be sufficient to buy the amount of shares specified by the
            Share Purchase option below. For example, if you start with
            $1,000 and you are buying Round Lots (100 shares), your stock
            had better not sell for more than $10 per share or you won't
            have enough money to buy a round lot.

            The profit tester keeps track of the cash available in the
            account at all times. Your Initial Cash setting determines the
            amount that the account starts with when it begins testing a
            security. Closed transactions' profits and losses are added or
            subtracted from the cash position.


            7.6.4.3 Reinvest Profits
            This choice should be checked if you wish to reinvest profits
            with each transaction. As explained above, the profit tester
            maintains your cash balance by adding and subtracting profits
            and losses from closed trades. When this item is checked, the
            amount of cash used to purchase or sell shares will be the
            total amount in the cash account.
            If this box is not checked, the profit tester will use the
            Initial Cash amount to make trades.

            7.6.4.4 Commissions
            You can use several commission structures for your simulated
            trading. The commissions for Charles Schwab,  OLDE Discount,
            and PCFN brokerages are built into the profit tester. These
            commissions are accurate as of 1/1/93.

            If you wish to specify a fixed commission amount or a
            percentage commission amount  for each trade, you should choose
            the Constant Value/Percent choice from the list box. If you
            choose this choice, you should enter a commission amount or
            percentage in the Commission Amount/Percentage input box. To
            use a fixed amount per trade, enter a number (e.g. 25.50 for
            25.50 units of currency per trade). To use a percentage amount,
            follow the amount in percent by a percent sign "% ".

            Finally, you can suppress commissions altogether by choosing
            None in the list box.


            7.6.4.5 Price Slippage
            Price Slippage refers to the price at which you want to
            exercise the trade. Generally, you cannot execute a trade at





                           Selections - Scan and Profit Test
            the exact price you want, nor can you always trade at the
            previous day's closing price. So, you have several options for
            choosing the trade price.


                 Price Slippage  Meaning
                 Type

                  Today's Close  Today's
                                 closing price

                  Next Average   Tomorrow's
                                 (High+Low+Clos
                                 e)/3

                  Next Open      Tomorrow's
                                 Open Price

                  Next Close     Tomorrow's
                                 Close Price

                  Next High      Tomorrow's
                                 High Price

                  Next Low       Tomorrow's Low
                                 Price



            The prices at which the BUY, SELL and STOP transactions occur
            are obtained from the choices given on the Profit Test Build
            Options screen. There are several choices, one of which is to
            buy at the close for the prior day. This is the default. If you
            have OPEN data, you should choose the option to buy at the OPEN
            price. If not, then you can choose an average of the price
            range, or several other choices.

            Just to elaborate on the profit testing, suppose on day
            2/15/90, your buy signal is reached..in other words, the BUY
            WHEN is true. The price at which your buy is made is most
            accurately at the OPEN of the next day (since you are using
            CLOSING data for your test up to 2/15/90, you wouldn't have
            been able to really buy at the CLOSE for 2/15/90). If you don't

            have OPEN data, you can use some other choice from the prices
            on 2/16, the following day.

            But, in every case, the actual BUY takes place on 2/16/90, the

            day following the date the signal was given (can't buy after

            the close).





                           Selections - Scan and Profit Test
            7.6.4.6 Share Purchases
            You can elect to purchase shares of the security in either
            Round Lots,  using All Available Cash or One Contract/Share at
            a time.

            If you choose Round Lots, your profit test will purchase or
            sell stocks in groups of 100. This is important if you are
            using a real commission schedule, since the commission per
            share is reduced when you trade in round lots.

            Choosing All Available Cash will buy as many integer shares as
            possible with the cash amount available.

            Choose One Contract/Share to buy or sell only one contract or
            share with each transaction. This is useful for futures and
            commodity traders who are testing products that do not make a
            move of one currency unit per point.


            7.6.4.7 Report Detail
            There are three choices for this option: DETAIL, TICKER SUM-
            MARY, and TOTAL SUMMARY.




               DETAIL        Show every trade


               TICKER        Show totals for
              SUMMARY        each ticker

               TOTAL         Show totals only
              SUMMARY        for all tickers




            7.6.5 Profit Test Stops

            You can use the Edit/Profit Test Stops command to open a dialog
            box containing settings for the three types of money management
            stops available in the profit tester.
            Each stop type is enabled by placing a checkmark next to the
            name of the stop rule on the left of the dialog box. For those
            stops that are enabled, you must enter a numeric value or
            percentage numeric value which is associated with the stop rule
            as described below.
            These stop rules will issue sell or buy stops based on your
            current position's gain or loss.





                           Selections - Scan and Profit Test
            7.6.5.1 Trailing Stop
            The Trailing Stop takes effect once the position has achieved a
            profit, and then the position loses more than the stop value
            amount or percentage.

            For example, if the Trailing Stop value is 10%, and the
            position has moved from $100/share to $120/share without
            retracing. If the position drops below $108/share ($120 - 10% *
            $120), the stop will be issued.


            7.6.5.2 Maximum Loss
            The Maximum Loss stop is used to prevent position losses
            greater than the amount or percentage specified. This stop will
            take effect when the position's loss exceeds the amount or
            percentage shown in the input box to the right.

            If you enable this stop, make sure that the Maximum Loss amount
            is larger than the commission amount for the trade, or your
            position will be stopped out immediately on making a trade.

            For example, if you have set the Maximum Loss to 7%, and your
            position's commission plus drop in equity value has exceeded 7%
            of the initial cost, then a stop of this type will be
            triggered.


            7.6.5.3 Profit Target
            The Profit Target stop is used to "take profits" after the
            position profit has risen by an amount or a percentage
            exceeding the value specified.

            This value can either be a numeric amount or a percentage.


            7.7 Run Menu

            7.7.1 Execute

            Once you have completed your changes to the selection, you can
            Execute it by choosing the Run/Execute command. This will cause
            the selection to execute with the currently chosen Ticker List
            (see Set Ticker List on page 4-9).

            A run window will open, and if the selection is being run as a
            profit test, the output from the profit tester will appear in
            this window. If the selection has profit test Buy or Sell
            conditions, but is not being run as a profit test, any
            triggered signals for buy or sell will appear in the run
            window.

            Once the selection has processed all the tickers in the ticker
            list (or after you Close the run window while the selection is





                           Selections - Scan and Profit Test
            still executing), a new Selection Output Viewer  window will
            open (see Selection Output Viewer below).

            The desktop will now contain three windows associated with your
            selection: the selection editor window, the run window with any
            output from the selection profit testing, and the selection
            output viewer. You can switch from one window to the other by
            using the Window/Next/Previous commands, or by using the mouse
            to click on the window you wish to view.

            7.7.2 Syntax Check

            Prior to executing your selection, if you want to verify that
            there are no syntax errors in the selection formulas, choose
            the Run/Syntax Check command.

            If you have any errors in the Selection you have created, you
            will be told about them when you try to run or syntax check the
            Selection. An error message  will be displayed and then the
            selection editor screen's cursor will be positioned to the line
            in error.


            7.8 Selection Output Viewer

            Once your SELECTION is built, you can run it using the
            Run/Execute (Ctrl-F9) command.

            As the Selection is running, there may be some output generated
            to the screen, if you have any Buy/Sell conditions in your
            Selection. Once the SELECTION completes, a spreadsheet like
            "report" will display on your screen with the Ticker Symbol in
            the first column, the full descriptive name of the security in
            the second column,  and the non-hidden formula values and
            conditions in each subsequent column.

            7.8.1 Display Menu

            You can use the Display menu to restrict the rows displayed to
            only those that match all of the Condition type rows. When the
            Selection Output is initially displayed, all conditions are
            shown, whether true or false. If you issue the Display/True
            Conditions command , the rows containing any zeros in the
            condition column will be omitted from the display.

            The entire set of rows can be re-displayed with the Display/All
            command.

            7.8.2 Sort Menu

            You can sort the rows in the output view by the contents of any
            column by moving the cursor to the column on which you wish to
            sort, and choosing the Sort/Ascending (or Sort/Descending )





                           Selections - Scan and Profit Test
            command. The rows will be sorted on the contents of the column
            containing the cursor and redisplayed.

            Sorting the rows drops any Graph Selection marks that have been
            set.

            7.8.3 Graph Menu

            If you have designed your selection to graph its results (see
            Entering a Graph Number page 7-4) you can use this menu to
            control the rows to be graphed.

            A row that is tagged to be graphed has a right arrowhead symbol
            in its first column.

            You can also use the keyboard and/or mouse to tag/untag rows to
            be graphed. If you want to toggle the graph tag, press the
            SPACE bar on the row to be toggled.

            If you choose Select All, every row displayed will be tagged
            for graphing. If you choose Unselect All, every row will be un-
            tagged for graphing.

            Once the rows to be graphed have been tagged, you can choose
            the Graph/Display Graph(s) menu command.

            7.8.4 Printing Your Selection Report

            To PRINT the contents of your report in the current sort order,
            select the command File/Print. If you want to print to a file,
            make sure that the File/Printer Setup dialog shows File as the
            Port. The printout will be saved in the file with the same name
            as the selection file, but with an extension of LST.


            7.9 Sample Selection

            The figure below shows the equivalent of the MetaStock Utility
            "Rank" option where the first formula is the Current Price ("C"
            is the Closing Price), the second formula is the 26 day Rate of
            Change (ROC). The third formula is the 10 day Simple Moving
            Average of the price. The fourth is the 10 day Simple Moving
            Average of "F2", where "F2" is the 26 day ROC. Finally, the
            last formula F5 is the percentage by which the Price is above
            or below the moving average contained in F3.





                           Selections - Scan and Profit Test






                                                  7.9.1 Conditions for the
                                                  Selection

                                                  Move the cursor to the
                                                  last formula row. Use
                                                  the Alt-I key to insert
                                                  a new row after the last
                                                  formula.

                                                  Press ENTER in the Type
            column. Choose the Condition element from the list box that
            appears.  The Condition entries are used to allow you to
            "select" only those tickers that match all_the conditions

            specified. The conditions are specified in terms of the
            formulas given above. In the example above, if you only wanted
            to see tickers whose ROC (Formula 'F2') was greater than 50,
            then you could set

                 Condition C1    F2 > 50

            Also, if you had another condition, for example the current
            price of the ticker is greater than $5, you could place that
            condition as follows

                 Condition C2    C > 5

            and that would select only tickers whose ROC is greater than 50
            and whose price is greater than 5.





                            Ticker Lists - Group Securities

            8. Ticker Lists - Group Securities

            You can create "ticker lists" with TAS. A "ticker list" is a
            list of stock or ticker symbols which you can name as a group.
            This allows you to create individualized lists of symbols
            against which you can run your TAS scripts. As an example, you
            could create a ticker list containing the Dow Jones 30
            Industrials, or a list containing only stocks you hold.

            When you choose the File/New/Open/Ticker List  command, the
            Ticker List editor window will appear with all the ticker
            symbols contained in the Data Directories you have configured.
            Those symbols that have been selected for the ticker list will
            appear in the list box on the right side of the window, and
            those tickers which have not been selected (unselected tickers)
            will appear in the list box on the left side of the window. To
            select or unselect a symbol, move the cursor to the symbol in
            its list box and hit the SPACE bar (or double click with the
            mouse). If the symbol is selected, it becomes unselected and
            vice versa.

            Once you have created the ticker list, choose the File/Save or
            File/Save As command to save the ticker list. If you do not
            want to save the list, choose the Window/Close command.

            If you have set the Setup/Program Options option Include Ticker
            Period to "Yes", your ticker names will be followed by a slash
            and the period of the file, e.g. "AAPL/D" for APPLE COMPUTER
            Daily data. The period is not available with ChartPro data
            files.

            In order to avoid significant delays while reading the tickers
            for every data directory, TAS will read the ticker symbols one
            time and create a special file with all tickers and their full
            names. TAS places the total list in a file called ALLTICK.SYM.
            Subsequent ticker list modification requests will read the
            ALLTICK.SYM file rather than going to the directories
            themselves. This speeds up ticker list loading many times over.


            8.1 Edit

            8.1.1 Select All

            If you want to Select All Tickers, choose  the Select All
            command from the Edit menu.

            All ticker symbols will be copied from the unselected list to
            the selected list, leaving the unselected list with the symbol
            <empty> displayed.





                            Ticker Lists - Group Securities
            8.1.2 Unselect All

            To Unselect All Tickers, choose Edit/Unselect All from the
            menu.

            All ticker symbols will be copied from the selected list to the
            unselected list, leaving the selected list with the symbol
            <empty> displayed.

            8.1.3 Rebuild List

            If you change, add or  delete ticker symbols from your
            directories, or if your directory list changes in any way,  the
            ALLTICK.SYM list is out of date. To refresh the list, use the
            Edit/Rebuild List command to re-read the symbols in all the
            directories again.

            8.1.4 Delete Unmatched

            Any symbols in the ticker list that cannot be found in any of
            the data directories are considered unmatched. These unmatched
            ticker symbols are allowed to remain in the ticker list unless
            you delete them with this command.

            For example, if you load the DJ30.TCK ticker list, it initially
            contains the symbols for the Dow 30 Industrial securities. If
            you were to issue the Delete Unmatched command, those ticker
            symbols which are in the list, but which are not currently in
            your data base will be deleted. This is not necessarily what
            you want to do, since the list would no longer contain the Dow
            30 symbols.


            8.2 Sort

            The ticker symbols are displayed initially in ticker symbol
            order. You can use the Sort menu command to sort the symbols by
            Directory, Full Name, or Symbol. The ticker list will be saved
            in the order in which it is sorted.





                             Script Language Description

          9. Script Language Description

          The Script Language makes it possible for you  to precisely
          specify what you want to look for, compute, print, graph, and
          test. TAS scripts are simply text files that contain statements
          of what you want the program to do. These files can then be run
          to perform specific searching or computational tasks.

          The choices made in the way you  tell TAS to do something are
          what can be called the "syntax" or grammar of the Script lan-
          guage.  In a way, this language is similar to English, where you
          would say "If a is greater than b then tell me about it", except,
          as you will see, TAS also has abbreviations for relationships
          like "is greater than". Other than that, however, the language
          can be read like English and mathematical/algebraic notation
          combined. The following sections will give an explanation of the
          Script Language.

          In addition, the TAS package contains numerous examples of TAS
          Scripts. You should print them and look at them while reading the
          next section. The sample scripts contain "comments" which explain
          what the script is doing at each point of the script.


          9.1 Syntax

          In the subsequent discussion, the word "statement" is used. A
          "statement" is like a sentence in English. Like a sentence, it is
          composed of "words".

          A semi-colon (;) is used to tell TAS that the statement you just
          entered is done. Every statement should be terminated by a semi-
          colon.

          In the syntax descriptions below, words you must use are in UPPER
          CASE, and parts of the statement that are up to you are in lower
          case.

          Optional parameters are surrounded by square braces "["  and
          "] ".

          Alternate choices are enclosed in "curly " braces " {"  and
          "} ".


          9.2 Language Overview

          The language elements of the Script Language refer to the words
          and symbols of the language. Just as a "natural " language like
          English is composed of nouns, verbs, adverbs, conjunctions and
          other "language elements ", the Script Language also classifies
          words and symbols according to their use.





                             Script Language Description
          The Script Language is made up of reserved words and variables in
          addition to variables names of your own choosing. A variable name
          of your own must not be the same as any of the reserved words or
          variables that make up the Script Language.

          This section gives a brief overview of the script language
          elements. More detailed information about each element of the
          language is covered in the sections that follow, starting on page
          9-4).


          9.2.1.1 Variables
          Variables are named values. You can put values into or, in the
          case of "pre-defined" variables, get values from them.

          A variable name The names are anything you choose, but they have
          to start with a letter of the alphabet or an underscore
          character. Following characters in the variable name must consist
          of characters from the following set {A to Z, 0 to 9, and
          underscore}. Other characters are not allowed in the variable
          name.


          9.2.1.2 Assignment Statement
          The ASSIGNMENT statement ("=") is used to move a value from one
          variable or function result to a variable.


          9.2.1.3 Arithmetic Operators
          These are ADD(+), SUBTRACT (-), MULTIPLY(*) and DIVIDE(/),
          EXPONENTIATION (^) and MODULUS(%).


          9.2.1.4 Functions
           A "function" is a built-in TAS technical indicator , math
          function,  input/output, database, or miscellaneous function
          which can return a value or perform some predefined action.
          Function names are reserved words of the Script Language and must
          not be used as variable names.


          9.2.1.5 IF statement
          An "IF" statement is used to test a condition or value. Once the
          condition is tested, you can perform certain actions "if" it is
          TRUE or "if" it is false.


          9.2.1.6 WHILE statement
          The WHILE statement is used to control the execution of a
          sequence of instructions that need to be repeated while some
          condition is true.





                             Script Language Description
          9.2.1.7 FOR statement
          The FOR statement is used to describe the values to be used for a
          "loop" or sequence of statements that need to be executed a
          certain number of times.

          There is also a FOR EACH POINT form of the FOR statement that
          automatically determines the loop steps and termination point.


          9.2.1.8 BEGIN-END Blocks
          A BEGIN-END block is a way to "group" several statements into one
          block which is treated as a single statement. For example, the IF
          statement only allows you to execute the following "statement".
          However, if you use a BEGIN followed by multiple statements, fol-
          lowed by an END, the whole series of statements from the BEGIN
          through the END is considered to be ONE statement. It is similar
          to putting parentheses around an arithmetic expression.


          9.2.1.9 Logical AND
          The AND word takes a left-hand side and a right-hand side. If
          both are TRUE, the whole is TRUE.


          9.2.1.10 Logical OR 
          The OR word also has a left and right side. If either is TRUE,
          the whole is TRUE.


          9.2.1.11 Relational Operators
          These are how you test the "relation" between two single values.
          Relational operators include the less than, equal to, and greater
          than operators and combinations of these operators, such as
          greater than or equal to.  These operators can be expressed in
          English form or mathematical symbolic form as described on page
          9-19.


          9.2.1.12 Special Relational Operator for Arrays
          The CROSSED ABOVE/BELOW operator is used to determine if one
          indicator or data arrays crossed above or below another. It only
          works with array values.


          9.2.1.13 Comments
          These are used to "document" the script. They perform no function
          beyond communicating with the reader of the script.They should
          help the reader to understand what is going on in the general
          area of the script. They are good to use and should be included
          in the script to make it easier to understand.





                             Script Language Description
          9.3 Variables

          A Variable  is a name given t1 a "place" to put a "value". Think
          of it as a "name for a value" .

          Except for pre-defined variables (see page10-1) and built-in
          function names, you can make up the names for the variables in
          your script.

          A variable name must start with an alphabetic letter or an
          underscore character, contain only letters, numbers and
          underscores ("_"). Some valid names are:

            movArray, my999, m9, M32_togo, Beethoven, _Temp, etc
          Variable names are not "letter case-sensitive ", so that a
          variable named "AAA " is the same as the variable named " aaa "
          or any combination of upper and lower case "a "'s.

          Generally, you first use variables in "assignment statements",
          that is, you first "put" something into them. Subsequently, you
          can use them as values passed to functions or another statement
          such as an IF statement or a WHILE statement.

          9.3.1 Declaring Variables

          In some cases, you need to declare a variable's type before you
          use it. This is most often necessary if the variable is to be
          passed as an argument to a builtin function prior to its use in
          any other form.

          Generally, you define your own array because you want to put some
          indicator value into it, or you want to create your own new
          indicator from existing functions and data.

          Most builtin indicators create arrays of numbers. When using a
          charting program, you can see these numbers as a line on a graph.
          Each of the points on the line are values of the indicator for a
          particular day. Now, suppose you wanted to know what the value of
          the indicator was two days ago.

          Normally, when an indicator is computed, it returns (creates) an
          array. However, if you don't put the result of the indicator
          function into an array (declared via the ARRAY declaration as

                              
          1The variable names are anything you choose, but they have to
           start with a letter of the alphabet and must consist of
           characters from the following set {A to Z, 0 to 9, and
           underscore}. Other characters are not allowed in the variable
           name.





                             Script Language Description
          shown above), then the result stored is the indicator value for
          the current day only.

          In order to "look" at the indicator value for other than the last
          day loaded, you must place it into an array that you have already
          declared. For information on accessing the individual elements of
          an array after placing the results of a function into an array,
          see Numeric Array Variables (page 9-7).


          9.3.1.1 Explicit Typing
          There are two ways to declare a variable's type. The first
          method, explicit typing, is of the form

            1. VariableName : Type;

            2. VariableName IS A Type;

            3. Type VariableName = expression;

          where VariableName is the variable's name, and Type is one of the
          valid types (STRING, ARRAY, NUMBER,  DATE) described below.  The
          first and second forms declare the variable and its type without
          assigning anything to them. The third form is a convenience where
          you can declare the variable and its type at the time you made an
          assignment.

          For example, you can define your own variable array by
          "declaring" it (prior to first using it) as follows:

            VariableName : ARRAY;
               OR
            Variablename IS AN ARRAY;


          where VariableName is the name by which you want to refer to the
          array. If you want to declare more than one variable of the same
          type, you can also declare each separated from the next by a
          comma, and ending with a colon followed by the type of each of
          the variables. For example, to declare strings named S1,S2, and
          S3, you could say

            S1,S2, S3 : STRING;



          9.3.1.2 Implicit Typing
          With the exception of ARRAY type variables, a variable can be
          impliicitly declared by simply assigning a variable or constant
          whose_type_is_known to it. If you want a variable to have a

          STRING type, you can assign a string to it. The type of the





                             Script Language Description
          source variable is copied to the destination variable in the
          assignment.

            X = `This is a string';
          will assign the string `This is a string' to the variable named
          X. The Type of the variable X is converted to STRING. If you then
          assigned variable X to variable Y, Y would also be a string type
          variable (since X's type is known).

          When an expression is assigned to a variable, TAS will attempt to
          determine the type of the variable by the result of the
          expression.  If you assign a STRING to a variable, it becomes a
          STRING variable. If you assign a number to a STRING variable, it
          will become a NUMBER variable.

          Due to the performance impact of copying arrays of numbers, there
          is an exception for ARRAY variables with respect to implicit
          typing. If you really want a variable to be an ARRAY, you must
          use explicit typing.  If you say:

            X = CLOSE;
          without defining X to be an array, TAS will take the shortcut of
          creating the (single) NUMBER variable named "X " and assigning a
          single value to it (namely, the latest Closing Price value). This
          avoids the potentially more time-consuming process of copying
          each and every value from the CLOSE array to a new array called
          "X ".

          If you really want to copy one array to another in this example,
          you would need to define X as an array prior to the assignment
          statement. Then, the variable X will contain all  the closing
          prices.

            X IS AN ARRAY;
           of the closing prices (in this case), and then:

            X IS AN ARRAY;
            X = CLOSE;
          OR

            ARRAY X = CLOSE;
          to ensure that X contains all of the closing prices. After this
          assignment, the variable X can be used in any function that
          requires an array as an argument, e.g., a MOV (moving average
          function) or a Graph function.


          9.3.1.3 Variable Types in Functions
          Builtin functions expect certain types of variables in each
          argument position. In general, the use of a variable before it
          has been declared or used doesn't make sense.





                             Script Language Description
          For example, the ASK (get user input) function requires each
          argument to be pre-declared or implicitly typed so that it can
          correctly interpret the results. If you were to use ASK to get
          two string variables from the user, you would have to pre-declare
          the names of the variables with the type STRING (explicit
          typing) or assign a STRING to the variables prior to using them
          (implicit typing).



          9.3.2 String Variables

          These are variables to hold text information, like 'IBM', or
          'Signal Buy at this price ".  String variables must be surrounded
          by single-quote (') characters.  String variables can be
          different lengths, depending on what you put into them. They can
          contain blanks at the end of the variable, which you may need to
          remove with the TRIM function.



          9.3.3 Numeric Variables

          These are variables that hold numbers, like 32, or -75.69, or
          10000034.

          There are two types of numeric variables, INTEGERS and REAL
          numbers. An INTEGER is a number which has no decimal point and
          must be smaller than 32,767 in value.

          An INTEGER can be no greater than  32,767 in magnitude. Numbers
          larger than 32,767 are converted internally into REAL numbers
          with an implied decimal point. To convert a REAL NUMBER to an
          INTEGER, you can use the INT function.

          9.3.4 Date Variables

          Date variables contain dates in the form YYMMDD (year-month-day).
          They can be printed like numeric values, but they can also be
          manipulated with the built-in operators for addition and
          subtraction.
          The result of subtracting one date variable from another date
          variable is the difference in days between the two dates. Adding
          or subtracting a number to/from a date variable will increment
          the date or decrement the date by that many days.
          9.3.5 Numeric Array Variables

          These are variables that hold many numbers in an "array"  (or
          collection of numbers). All of the numbers in the array have the
          same variable name You must pick out one of the numbers of the
          array by specifying its "location" in the array.





                             Script Language Description
          Each array has exactly QUOTE_COUNT entries. The variable
          QUOTE_COUNT is "filled in" by TAS when the script runs for the
          ticker file.  Given a ticker that has 100 quotes (or the maximum
          number of quotes to load, MAX_QUOTES, set to 100) the following
          indices are usable for any array in the ticker file:




               English Lan-    Index       Index
               guage Index     Relative    Relative to
                               to Today    First Day

               Today           0           100
               Yesterday       -1          99
               2 Days Ago      -2          98
               3 Days Ago      -3          97
               ..............  .....       .....
               ......
               99 Days Ago     -99         1



          An example of an array that is always available when a ticker is
          processed is the Closing Price array,"C". Obviously, there are
          many Closing Prices (one for each quote, in fact), and in order
          to refer to the Closing Price on a particular day, there must be
          some way to reference it.

          In the absence of any explicit reference to a particular day in
          an array, TAS will assume the reference is for the entire array.
          In other words,  the statement below

            X = H + C;
          means

            X = ADD(H, C);
          Performing a calculation on an entire array can be time-consuming
          if it is not necessary. If, for example, you only wanted to add
          the High and the Close for the latest day, you would say

            X = H[0] + C[0];
               or

            X = High of Today + Close of Today
          If you need to know what the value of the Closing Price was two
          days before the last quote's day, you have to tell TAS that you
          want the quote two days before. You can do this in one of three
          ways. Suppose you have 100 days of data loaded. To get the
          Closing Price quote from two days  prior to the last day, you
          could say:

               1)C[-2]   





                             Script Language Description
               2)C[98]
               3)        C OF 2 DAYS AGO
          Methods (1) and (2) above use "subscript" notation to tell TAS
          which number in the array is needed. In the first case, you are
          saying "give me the Closing Price array entry 2 days backward
          from the last entry". The negative number says to start
          "counting" back days from the last day.

          The second version, shown in (2), says "give me the Closing Price
          array entry 98 days from the first day loaded". Since we had
          stipulated 100 days were loaded, this is the same as the price
          two days ago (100-98 = 2).

          Finally, the last expression, shown in (3), says in English that
          you want to retrieve the Closing Price 2 days ago. In the
          interest of readability, this version is the best, but it is more
          wordy and does incur a very slight performance penalty when you
          run the script, since TAS has extra work to do in order to
          interpret the English phrase.

          In addition, you can also describe the current day's Closing
          value by saying

            CLOSE OF TODAY
          and you can refer to yesterday's Closing price by saying

            CLOSE OF YESTERDAY


          Other pre-defined data arrays, like H, L, C, V (for High Price,
          Low Price, Closing Price and Volume) are examples of arrays.

          If you want to refer to a closing price 10 days ago (using our
          earlier example of 100 days loaded), you can say

                         C[-10] or C[90] or CLOSE 10 DAYS AGO
          Each time you refer to an "element" of an array, you need to
          either provide the "subscript" in square brackets, e.g. [-10],
          which means "subscript minus ten" or say "xx DAYS AGO".


          9.4 Assignment Statement

          The Assignment Statement is used to set the contents of a
          variable or array to the result of an "expression". An
          "expression" is a term, that means sequence of mathematical
          operations, a logical relation  and/or the result of a
          "function".

          It might help to give some examples of assignment operations:





                             Script Language Description
                                    a = b + 3 / 4;
                                                                2.
          The "=" (equal)  is the operator that says "assign to"   So,
          reading the above assignment, in English, it says "add the con-
          tents of variable 'b' to the result of dividing 3 by 4. Place
          this result in variable 'a'". If variable 'b' contained 6 when
          this statement was encountered, then variable 'a' would contain
          6.75 (6 + 3/4).

          Another example is:

                                a = (c[-1] + c[0]) / 2;


          In this example, the array 'c' is pre-defined as the "closing
          price array". So, the statement is adding the closing price
          yesterday (c[-1]) to the closing price today (c[0]). It is then
          dividing the total of this addition by 2 and placing the result
          in variable 'a'.

          Note the use of the parentheses to "group" the addition so that
          it would be done before the division by 2. If there were no
          parentheses, the result would have been considerably different.
          Instead, it would have divided today's closing price by 2, added
          it to yesterday's closing price, and placed the result in 'a'.

          Another example of an assignment is the result of a "function"
          call. All Technical Indicators available in TAS are created by
          making a "function" call. In other words, the Technical Indicator
          is referred to by its name (the "function"). So, for example,

                                  a = mov(c,21,'E');


          calculates the 21 day exponential moving average ("mov" function)
          of the closing price array. If variable 'a' has been declared to
          be an ARRAY prior to this point, then 'a' contains all the moving
          average "points". If 'a' has not been declared as an ARRAY, then
          'a' will contain the value of the moving average at the last
          point of the range, i.e., today's value. See the section titled
          "Numeric ArrayVariables  for a description of arrays and
          "subscripts".






                              
          2    TAS will also accept a simple "equal" sign in lieu of the
           "colon-equal" sequence of characters for an assignment
           statement.





                             Script Language Description
          9.5 Arithmetic Operators

          Arithmetic Operators are addition (plus sign '+'), subtraction
          (minus sign '-'), multiplication (asterisk '*') , division (slash
          '/') . "exponentiation" (caret "^") and modulus  ("% ").

          When you write an arithmetic expression, you should use
          parentheses to guarantee the order in which the operations are
          performed. In general, exponentiation is performed first, then
          division, multiplication and modulus are performed, then lastly,
          addition and subtraction.

          The modulus operator will return the remainder of an integer
          division of the two operands. For example, the expression "10 %
          3 "  is equal to 1, since 10 is divisible by 3 with a remainder
          of 1.


          9.6 Functions

          A "function" is a reference to a "built-in" Technical Indicator
          function (like "MOV(...)"), an output function (like WRITE or
          WRITELN), or an array manipulation function (like DIVBY).


          9.7 IF Statement

          The IF statement is perhaps the most powerful  feature of TAS. It
          enables you to create complex relationships between indicators
          based on their relationship with other indicators and values.

          An IF statement is written as follows:

            IF condition THEN
               statement to execute if the condition is true
            ELSE
               statement to execute if the condition is false;


          The ELSE part of the IF statement is optional, but sometimes it
          is convenient to make a two way decision about something. You
          could alternatively say:

            IF condition THEN
               statement to execute if the condition is true;


          The TAS language does not require you to include the word THEN
          after the IF part of the statement. You must terminate each IF
          statement with a semi-colon. Note, however, that IF statements
          containing an ELSE part are terminated after the ELSE part. For
          example,





                             Script Language Description
            IF a IS GREATER THAN b THEN
            WRITELN('a is greater than b, hurray!')
            ELSE
            WRITELN('a is not greater than b, sorry.');


          Note how there is a semi-colon on the last line, but not after
          the first WRITELN. However, if you wanted to print a message only
          if "a" is greater than "b", then you would say

            IF a GREATER THAN b THEN
            WRITELN('a is greater than b, hurray!');


          Note the semi-colon after the last line.


          9.8 WHILE Statement

          The WHILE statement executes a statement (or group of statements
          surrounded by a BEGIN..END) as long as the condition given in the
          WHILE statement is true.

          A WHILE statement is written as follows:

            WHILE condition
               statement to execute "while" the condition is true
          An example of the use of the WHILE statement is below. The WHILE
          condition is true until the sort buffer contains no more records.

            WHILE SortGet(symbol,price)
            WRITELN(symbol,price);

          9.9 FOR Statement

          The FOR statement executes a statement (or group of statements
          surrounded by a BEGIN..END)  a certain number of times, and while
          a condition is true.

          The FOR statement has three parts to it. each part separated from
          the previous part by a semi-colon. The first part is done once,
          before the statement following the FOR is executed. This part of
          the FOR statement is called the initializer. The second part is
          the test of the condition that controls the loop.  This part is
          called the condition. The third part is executed each time after
          the statement following the FOR has been executed. This third
          part is called the re-initialization step.

          The format of the FOR statement is

               FOR initializer; condition; re-initialization;

                    statement;





                             Script Language Description
          As an example, suppose you wanted to add the HIGH and the LOW for
          each day of the security's loaded data and also get the
          difference of the HIGH and the LOW3. Also suppose you wanted to
          place both of these values in their own array. You could put a
          FOR loop "outside" of the actions you wanted to perform for each
          day. Using the index variable i to refer to each day's array
          entry, you would set it up as follows:

            HIGHLOWSUM : ARRAY; 
            HIGHLOWDIFF : ARRAY;
            FOR i = 1; i  <= QUOTE_COUNT; i = i+1;
            BEGIN
               HIGHLOWSUM[i] = CLOSE[i] + HIGH[i];
               HIGHLOWDIFF[i]  = CLOSE[i] - HIGH[i];
            END;
          This statement is a very powerful and convenient way to "iterate"
          or loop through some portion of the price or indicator data.


          9.10 FOR EACH POINT Statement

          The For Each Point statement is another (and perhaps easier)
          method of  processing each loaded data point. Unlike the For
          statement, the For Each version will handle all the subscripting
          or indexing for the statement that follows.

          The format of the FOR EACH statement is

          FOR EACH POINT STARTING AT initial_index [USING variable]

                    statement;

          where initial_index is an expression which will be the first
          quote day  accessed in statement and the optional variable will
          be set to the index of the day to be accessed.

          As an example, the following three routines are identical in what
          they do. Each will add today's close minus yesterday's high to
          the variable A, for each day in the file. Each starts at day 2,
          since the statement that follows refers to the prior day.

          (1)


                              
          3Of course, you really wouldn't want to do this with a FOR
           statement, since both of these values can be computed by the
           following two simpler statements:

           HighLowSum = C + H;

           HighLowDiff = C - H;





                             Script Language Description
            For I=2 ; I <= Quote_Count; I = I + 1;
               A = A + C[I] - H[I-1];
                    and

          (2)

            For Each Point Starting at 2 Using I
               A = A + C[I] - H[I-1];
                    and

          (3)

            For Each Point Starting at 1
               A = A + C[0] - H[-1];


          Example (1) uses the For statement as described in the previous
          topic. Note how the subscript I is used in both examples (1) and
          (2) to reference the current day index.

          In example (3), there is no use of the variable I to reference
          each day, since the day index is implied by the For Each
          statement when the Using variable portion is omitted.


          9.11 BREAK Statement

          The BREAK statement can be used within either a FOR or WHILE loop
          to "break" out of a loop before the terminating condition has
          been reached.

          You must not use a GOTO statement to leave a FOR or WHILE loop.


          9.12 BEGIN..END Statement

          Suppose you want to do more than one thing if the condition "a is
          greater than b" is true. In that case, you would need to use a
          BEGIN .. END block.

           A "BEGIN..END" block "groups" all statements between the BEGIN
          and the END so that the entire "group" is treated as if it were
          one statement.

          This is useful in the case of the IF  (or FOR and WHILE) state-
          ment, because the action to be taken following the statement THEN
          or ELSE part of the IF can only be one statement. But if you use
          the BEGIN..END block to group several statements, the entire
          block is treated as a "single" statement. Think of BEGIN..END
          blocks in the same way you would think of parenthesized
          arithmetic expressions. You use parentheses to "group" some
          operations so that they are treated as a group.





                             Script Language Description
          An example of the use of the BEGIN..END block in an IF statement
          is shown below:

            IF a GREATER THAN b THEN
            BEGIN
            a = a - 1;
            b = mov(c,21,'E');
            WRITELN('New values for a and b are:' ,a,' ',b);
            END;


          All three statements following the BEGIN will be executed (acted
          upon) if the value of "a" is greater than the value of "b". If
          you had left out the BEGIN..END section, only the first statement
          ("a = a - 1") would have been done if "a GREATER THAN b" was
          true. The following two statements would have ALWAYS been done,
          since they were not part of the IF.


          9.13 GOTO Statement and LABELS

          You can use the GOTO statement in a script to transfer control to
          a LABEL you define in the script.

          A LABEL is defined by a COLON (":")  immediately followed by a
          LABEL NAME. For example, in the script below, the third line has
          the sequence ":AGAIN". This makes "AGAIN" the name of a LABEL. On
          the tenth line of the script, there is a "GOTO AGAIN" which
          transfers the "flow of control" of the script back to the
          statement just following the label 'AGAIN'. The purpose of the
          script below is to show an example of GOTO and LABEL's, but
          incidentally, it also computes all the moving averages for
          periods from 20 days to 40 days and prints them4.

            ma_array10 IS AN array;
            n = 20;
            :AGAIN
            ma_array10 = mov(c,n,'e');
            writeln(  ticker,
               date,int(n),
               ' day moving average is ',
               ma_array10);
            n = n+1;
            if n LESS THAN 40 then
            GOTO AGAIN;


          When you use the GOTO within a BEGIN..END block, you must be
          careful not to GOTO someplace outside of the block. Your script
                              
          4This example is rather contrived, since it is easily replaced
           by a FOR loop which doesn't require using a LABEL or a GOTO.





                             Script Language Description
          must encounter the END statement which matches the previous BEGIN
          statement.


          9.14 GOSUB statement

          The GOSUB statement is used to "go to a subroutine". This
          statement can be used when you have the same section of script
          code that you want to execute several times.

          Rather than including the same lines in the script in each place
          you want to use them, you can place them in one location in the
          script and use GOSUB each place you want to execute them.

          When you use GOSUB, you specify a label where the 'subroutine'
          starts. When the subroutine is completed, it should have a RETURN
          statement. The RETURN statement will return the script control
          back to the statement FOLLOWING the GOSUB.

          Here is a sample script using the GOSUB statement:

            a = 5;
            gosub s1;
            gosub s2;
            return;
            :s1
            begin
            writeln(ticker);
            writeln('s1 entered, a = ',int(a));
            return;
            end;
            :s2
            a = a+1;
            begin
            writeln('s2 entered, a = ',int(a));
            gosub s3;
            return;
            end;
            :s3
            a = a+1;
            begin
            writeln('s3 entered, a = ',int(a));
            return;
            end;
          The output from this script is:





                             Script Language Description
            AMH
            s1 entered, a =     5
            s2 entered, a =     6
            s3 entered, a =     7

          9.15 RETURN statement

          The RETURN statement in a script will stop processing the current
          ticker or return from a GOSUB call. For example, if you want to
          avoid computing several complex indicators if there are less than
          100 quotes in the file or the price is less than $5, you could
          put the following section of code BEFORE your calculations in the
          script:

            IF quote_count LESS THAN 100 OR close LESS THAN 5 THEN
            RETURN;


          Or, if you have a subroutine that you call with the GOSUB
          statement, you need to return back to the place where the GOSUB
          was made by using a RETURN statement at the end of the
          subroutine.


            GOSUB SUB1;       {Call subroutine 1}
            RETURN;           {Return to TAS and end script}
            :SUB1            { BEGINNING OF SUB1}
            { DO WHATEVER SUB1 DOES HERE
               ......................}
            RETURN;           { RETURN FROM SUB1}

          9.16 STOP Statement

          The STOP statement can be used to completely stop a script's
          processing and return to TAS without processing any more ticker
          symbols.

          If a script executes a STOP statement, it will immediately start
          executing the EPILOG statement, unless the STOP was executed
          while in the EPILOG statement.


          9.17 PROLOG statement

          The PROLOG statement is executed once before any other data has
          been read for any ticker, and before any other statement in a
          script.

          It can be used to set headings, initialize your variables, get
          user input via the Ask function.





                             Script Language Description
          9.18 EPILOG statement

          The Epilog statement is executed once after all other data has
          been read for all tickers, and just before the script is going to
          complete.

          It can be used to produce totals, do the final SORT actions
          required by your script, or anthing else that will finish up and
          complete your processing.

          Within the EPILOG statement, you have access to all data arrays.
          The historic price/volume data arrays are those for the last
          security file processed.


          9.19 Logical Operators

          You can combine relations by using the words "AND" and "OR" and
          "NOT". They have the same sense as in English. Whenever you use
          AND and OR, you can use parentheses to group your relations to be
          sure they are computed the way you want them to be understood.
          For example:

            IF a GREATER THAN b AND b EQUAL TO 1 THEN
            WRITELN('a is greater than b and b is equal to 1');

          This example compares "a" to "b". If "a" is greater than "b",
          then it compares "b" to the number 1. If "b" is equal to 1, then
          the message

            a is greater than b and b is equal to 1
          will be printed. If either of the "relations" (a in "relation" to
          b AND b in "relation" to 1) is not true, then the WRITELN will
          not be done.

          On the other hand, suppose we want to print the message if either
          of the conditions is true. Then we would say:

            IF a > b OR b = 1 THEN
               WRITELN('a is greater than b OR b is equal to 1');

          In this case, it would print the message if "a" were greater than
          "b" or if "b" were equal to 1.

          You can also ask for a condition to be false by preceding it with
          the word "NOT" as in





                             Script Language Description
            IF NOT a GREATER THAN b THEN
               WRITELN('a is NOT greater than b');

          9.20 Relational Operators

          Relational Operators describe a "relationship" between the ex-
          pression on the left of the operator and the expression on the
          right of the operator. For example, "a > b". 'a' is on the left
          side, 'b' is on the right side, and the operator is '>' which
          means "greater than". Relational operators can be expressed using
          mathematical notation (">", "<", "<>", ">=") or by using English
          forms of the same relation, such as "GREATER THAN", "LESS THAN",
          etc).

          You can only use relational operators with single numeric values,
          that is, you cannot ask if one array is greater than another
          array, though you can ask if one entry in an array is greater
          than another entry in an array.

          The English form of the operators and the symbolic form for the
          operators are shown in the table below. You may use either form
          for expressing an equality or inequality relationship.


               English Language   Symbolic
               Keyword form       form


               EQUAL              =


               GREATER THAN       >


               GREATER THAN OR    >=
               EQUAL


               LESS THAN          <


               LESS THAN OR EQUAL <=


               NOT EQUAL          <>





                             Script Language Description
          9.21 Crossed Above/Below Operator

          TAS has a special operator to determine if one array has crossed
          above or below another array within a specified number of days.

          The way you use this operator is to say

          array1 CROSSED ABOVE array2 WITHIN n DAYS

          or

          array1 CROSSED BELOW array2 WITHIN n DAYS

          both array1 and array2 must be arrays.

          For example, if you wished to see if the Closing price had
          crossed above the 20 day simple moving average of the Close
          within the last two days, you could say

            If Close CROSSED ABOVE sma(C,20) WITHIN 1 DAYS
          which counts a crossover today as 0 days ago, yesterday as 1 day
          ago. So, in this case, asking for a crossover today or yesterday
          would be "within 1 days".


          9.22 Comments

          There are two ways you can add comments or descriptive notes to a
          TAS script.

          Comments can be surrounded on both sides by "curly braces". These
          are the characters at the right of your keyboard. They look like
          this:

               {    - Left "curly brace"

               }    - Right "curly brace"

          You can place these "curly braces" around any thing in your
          script file that you do not want TAS see. It is only for your
          eyes and the eyes of other humans.

          The second form of comment is to use two "forward slashes" to
          tell TAS to ignore anything to the right of the slashes. For
          example you could say:

            valuex = 32;     // set the value of the x variable
          Double slash comments are slightly easier to type than using
          opening and closing braces, and since comments are good to use,
          anything that makes them easier to write is also good.





                             Script Language Description
          9.23 Format Specifiers

          Format strings are composed of  format specifiers which have the
          following form:

          % [flags] [width] [.prec] [F|N|h|l|L] type_char

          Each format specifier begins with the percent character (%).

          After the % come the following, in this order:


          Compon  Opt./R What It Controls or Specifies
          ent     eq

          [flags         Flag character(s)  Output
          ]       (Optio justification, numeric signs,
                  nal)   decimal  points, trailing
                         zeros, octal and hex prefixes
          [width          Width specifier  Minimum
          ]       (Optio number of characters to
                  nal)   print, padding with blanks or
                         zeros
          [.prec          Precision specifier  Maximum
          ]       (Optio number of characters to
                  nal)   print; for integers, minimum
                         number of digits to print
          [F|N|h          Input size modifier
          |l|L]   (Optio Override default size of next
                  nal)   input argument
          type_c          Conversion type character
          har     (Requi s  : string
                  red)   c  : character
                         d  : integer
                         f  : number type



          For example, to print exactly 4 characters in no more than 4
          character positions, you would say "%4.4s".

          If you want to print a STRING variable in a fixed size field of
          16 characters, left justified, you would use the format string
          "%-16s ".





                                 Built-in Variables

          10. Built-in Variables

          TAS has reserved variable names for specific uses as described
          below. These variables can provide additional information "under
          the covers "of TAS so you can tailor your scripts or profit
          tests to your own needs.


          Builtin pre-defined variables such as Close, High, and other data
          arrays, need  not be (and should not be) declared or modified.
          They are `read-only' variables that are set by the data itself.



          10.1 Historical Data Variables

          Historical Data Variables are variables that are "filled in" when
          each security file is processed or at specific times during the
          processing of ticker files. These variables are in addition to
          the pre-defined data arrays described on page 10-5 below.



          10.1.1 Ticker

          This STRING variable contains the 'ticker' symbol currently being
          processed. The ticker symbol is obtained from the historical data
          file.

          10.1.2 FullName

          This STRING variable contains the 'full name' (if available in
          the historical data format) of the historical price/volume data
          file currently being processed.

          10.1.3 DataPath

          This STRING variable contains the DOS file name of the historical
          data subdirectory currently being processed.

          10.1.4 Ticker_Period

          This STRING variable contains the periodicity of the ticker file.
          "D " for Daily data, " W " for Weekly data, "M " for Monthly
          data.

          10.1.5 Quote_Count

          This INTEGER variable contains the number of quotes loaded from
          the historical data file. For daily data, this is the number of
          trading days loaded, for weekly data, it is the number of weeks
          loaded, and similarly for other periodicities.





                                 Built-in Variables
          10.1.6 Date

          This is a STRING variable containing the formatted date of the
          latest quote in the file in the format "MM/DD/YY ".

          10.1.7 Ticker_List

          This STRING variable contains the name of the ticker list file
          which is being  processed.The name of the ticker list does not
          include the path part of the name, nor does it include the .TCK
          extension. For example,  if the ticker list is in
          E:\TAS\TICKERS\SP-500.TCK, the Ticker_List variable will contain
          the string "SP-500 ".
          10.1.8 Index_Symbol

          This STRING variable contains the security ticker symbol of the
          index file to be used by the script. This variable can be set by
          the PROLOG of a script rather than using the #INDEX command.

          10.2 Profit Test Variables

          Profit Test variables are filled in by TAS as a profit test is
          being run.
          10.2.1 Profit

          This numeric variable contains the current profit position on the
          current open trade. If there is no open trade, the value of this
          variable is zero. The Profit variable includes any commissions
          and is calculated based on the current closing price.
          10.2.2 MaxProfit

          This variable contains the highest profit in the current open
          position. The MaxProfit is checked for each period in which the
          profit test is run.
          Once the position is closed, the MaxProfit amount is set to zero
          again.
          10.2.3 MaxLoss

          This variable contains the maximum loss  in the current open
          position. The MaxLoss amount is checked for each period in which
          the profit test is run.
          Once the position is closed, the MaxLoss amount is set to zero
          again.
          10.2.4 DaysInPosition

          This INTEGER variable contains the number of trading bars since
          the current open position was begun. The day the position is
          opened will show DaysInPosition equal to zero. The next day, if
          the position is still open, will show a value of one in this
          variable, and so on.
          If no position is open, this variable contains negative one (-1).





                                 Built-in Variables
          10.2.5 SharesHeld

          This NUMERIC variable contains the number of shares or contracts
          purchased or shorted in the current open position.

          10.3 Processing Flow Variables

          The variables described in this section are used to indicate the
          phase of processing of the TAS script. These variables are used
          by some scripts  written for versions of TAS prior to TAS 6, but
          they are generally not needed for this version of TAS.

          10.3.1 First_Ticker

          INTEGER variable, which, if equal to 1 (one), indicates this
          ticker is the first to be processed.

          Note: This variable serves no purpose beyond that which can be
          achieved by using the PROLOG statement. It is provided for
          compatibility with TAS Version 5. It may be dropped in the next
          major upgrade.

          10.3.2 Last_Ticker

          INTEGER variable, which, if equal to 1 (one), indicates this
          ticker is the last to be processed. Note that this variable will
          not be set if there are any ticker symbols in your ticker list
          that are not in your historical data files.

          Note: This variable serves no purpose beyond that which can be
          achieved by using the EPILOG statement. It is provided for
          compatibility with TAS Version 5. It may be dropped in the next
          major upgrade.



          10.3.3 Quote_Range

          This INTEGER variable is initially set to Quote_Count by TAS. The
          Quote_Range variable can be modified by the script to set the
          index of the last quote in the file for computation ( See the
          note below).

          Note: This variable serves no purpose beyond that which can be
          achieved by using the FOR EACH POINT statement. It is provided
          for compatibility with TAS Version 5. It may be dropped in the
          next major upgrade.

          10.3.4 Plot_Phase

          INTEGER variable which is set to 1 when the Profit Test Script is
          entered for the first time for a ticker.





                                 Built-in Variables
          10.3.5 Test_Phase

          INTEGER variable which is set to 1 when the Profit Test Script is
          entered for the EACH quote for a ticker.

          10.3.6 End_Phase

          Numeric Variable which is set to 1 when the Profit Test Script is
          entered for the last quote for a ticker.


          10.4 Graph Control Variables

          10.4.1 Color Names

          Several functions use colors as part of their action. The colors
          are actually just numeric values corresponding to each of the 16
          possible colors supported. The following Color Table lists
          mnemonic names which can be used whenever a color value is
          required.





                                 Built-in Variables

                    Color Name     Numeric Value

                    _BLACK                    0

                    _BLUE                     1

                    _GREEN                    2

                    _CYAN                     3

                    _RED                      4

                    _MAGENTA                  5

                    _BROWN                    6

                    _LIGHTGRAY                7

                    _DARKGRAY                 8

                    _LIGHTBLUE                9

                    _LIGHTGREEN               10

                    _LIGHTCYAN                11

                    _LIGHTRED                 12

                    _LIGHTMAGENTA             13

                    _YELLOW                   14

                    _WHITE                    15




          10.5 Pre-Defined DATA Arrays

          A pre-defined DATA Array contains one entry of one type of value
          for each day in the ticker file. There are as many entries in
          each array as there are days loaded for the ticker.

          Unlike user-defined arrays,  the pre-defined arrays should not be
          defined within the script with the array declaration. Since they
          are pre-defined, they are always available for use within the
          script.  There are two ways to refer to each of the pre-defined
          arrays. There is an English language name, such as CLOSE and a
          "short variable name", such as "C", for the Closing Price array.
          The names for the pre-defined arrays are shown in the table that
          follows:





                                 Built-in Variables





                                 Built-in Variables

              Pre-defined DATA Arrays



           English       Short     Description
           language      Variable
           name for      Name
           array

           OPEN          O         The OPEN
                                   PRICE "data
                                   array"

           HIGH          H         The HIGH
                                   "data array"

           LOW           L         The LOW
                                   "data array"

           CLOSE         C         The CLOSE
                                   "data array"

           VOLUME        V         The VOLUME
                                   "data array"

           OPEN_INTERES  OI        The OPEN
           T                       INTEREST
                                   "data array"

           EQUITY        EQUITY    During a
                                   profit test,
                                   this array
                                   contains the
                                   equity
                                   position
                                   (cash plus
                                   shares *
                                   price) of
                                   the test.

           INDEX         INDEX     Array
                                   containing
                                   the CLOSE
                                   quotes for a
                                   TICKER de-
                                   fined by an
                                   INDEX
                                   command.





                                 Built-in Variables

           DATES         DATES     Array of
                                   DATES
                                   associated
                                   with each of
                                   the price
                                   entries.
                                   These dates
                                   are in
                                   number for-
                                   mat, not
                                   string
                                   format.





                                 Built-in Functions

          11. Built-in Functions

          TAS has an extensive library of built-in technical indicator and
          other functions. Technical indicator functions are used to
          manipulate price and/or volume data in a manner described by the
          author of the function. Other functions within TAS are used for
          doing mathematical operations on indicator or data arrays, to
          present output to the screen, to save or retrieve data from text
          files, or to access database information.

          Many of the TAS  built-in indicators and functions are also
          available in the Equis International program MetaStock. If a
          function is available in both TAS and Metastock it will have the
          same name and same parameters5 as documented in the MetaStock
          Custom Formulas Section of the MetaStock "User's Manual".

          Refer to the Metastock documentation, the Encyclopedia_of

          Technical_Market_Indicators, or any other technical analysis

          reference for additional information about these functions and
          their computation and use.


          11.1 DataBase Usage

          In addition to historical price/volume information associated
          with a security, TAS can also maintain and access addtitional
          items of information stored in a DBASE III compatible data
          format. This data format allows you to access information stored
          in a keyed, random access file supporting rapid retrieval and
          automatic formatting.

          You can access up to 8 databases at once using the functions
          described in this section.

          A database is composed of records and columns (or fields). For
          example, a record might contain the following fields: Symbol,
          Shares,SICcode,EPS1,EPS2,EPS3,EPS4 where Symbol is the security
          ticker symbol, Shares is millions of shares outstanding, SICcode
          is the Standard Industry Code of the security, and EPS1-EPS4 are
          the quarterly earnings per share from the most recent quarter to
          4 quarters ago.
                              
          5    In some instances, the parameter to a MetaStock named
           function has to have single quotes around it. This is the case
           with any function that passes a single character as a pa-
           rameter, such as the last parameter in the "mov" (Moving Aver-
           age) function.





                                 Built-in Functions
          Symbo Shar  SICco   EPS1 EPS2 EPS3  EPS4
            l     es    de

          AAPL  117.   3571   0.34 0.02   -   0.92
                  2                     1.63
          INTC  418.   3674   1.35 1.33 1.30  1.24
                  2
           MOT  278.   3660   1.15 0.88 0.81  0.73
                  0

                                       Table 0

          If the contents of the table shown above were in the database
          file "EPS.DBF ", there would be 3 records in the database, one
          each for security (as shown by the rows of the table). Each
          record would contain 7 fields, as shown across the top of the
          table.

          When a record from this database is accessed by TAS, each of the
          fields is automatically copied to a TAS variable with the same
          name as the column heading. These variables will hold the values
          from the current record. If the second record containing the data
          for INTC were the current record, then the variables Symbol,
          Shares, SICcode, EPS1, EPS2, EPS3 and EPS4 would contain the
          values "INTC ", 418.2, " 3674 ", 1.35, 1.33, 1.30 and 1.24
          respectively.

          The first field of the database record is considered to be the
          "key " field. A key field is a field on which you can do a rapid
          search of the entire database for the record matching the value
          you specify (see the DBRead function below). When the database is
          created or modified, TAS automatically adds the key field to the
          index file associated with the database record. The index file is
          named with the file extension ".NDX " and has the same file name
          as the database itself (whose extension is ".DBF ").

          Records are accessed by the database "navigation " functions:
          DBFirst, DBLast, DBNext, DBPrev and DBRead. Each of these
          functions causes a new database record to be read, and after
          being read,  the record's field contents are copied to TAS
          variables whose names are the same as the field names of the data
          base columns.

          Using the database described above in Table 0, the following
          script will print out a report of the contents of each of the
          database fields:





                                 Built-in Functions
            Prolog Begin
            dbf1 = DBOpen('EPS');
            While 1 Begin
               WriteLn(Symbol,Shares, SICcode,Q1eps,Q2eps,Q3eps,Q4eps);
               if DBNext(dbf1) = 0 then Break;
            End;
            Stop;        // Stop the script





                                                        Data Base Functions

          12. Data Base Functions


          12.1.1 DBClose      Close Database File


          Usage:         DBCLOSE( FileNo )
          Returns:  None
          Description : 
          Terminate (close) the link between TAS and the database that was
          opened with the DBOPen function that  returned FileNo as its
          result.
          If you do not close a database after opening it, TAS will
          automatically close it at the end of the script.



          12.1.2 DBCreate          Create a Database


          Usage:         DBCREATE( DBDFileName,DBFFileName )
          Returns:  Success/Failure
          Description : 
          The DBCreate function will create the database whose file name is
          DBFFileName, using the Data Base Definition file named
          DBDFileName. The Data Base Definition file is a text file that
          describes the fields, their types, and their sizes. You need to
          give the name of the Data Base Definition file whose extension
          ends with ".DBD ", and the name of the new data base file.



          12.1.3 DBDefine          Begin Database Definition


          Usage:         DBDEFINE( DBD File Name )
          Returns:  None
          Description : 
          Begin a database definition whose specification will be saved in
          the file specified by DBDFileName.
          This statement must be followed by a group of DBField statements
          containing the definition for each database field.
          The database definition must be terminated by a DBCreate
          function.



          12.1.4 DBField      Define a Database field


          Usage:         DBFIELD( DBD Line )
          Returns:  None


                                        12-2





                                                        Data Base Functions
          Description : 
          Define a single database field.
          The DBDLine contains a string with the following values
          <infn> <fieldName>,<type>,[,<len>[,<decimals>]]
          <infn> is always present (input field number)
          <infn> = C, field not present in ASCII input file
          <fieldname> is always present
          <type> is
          C   - Character or string field
          D   - Date field
          N   - Numeric field
          L   - Logical (Yes/No)
          M   - Memo field
           <len> is the length of the field. It is only present for
          types C and N.
           <decimals> is present only for type "N" field

          Example:
            The following will create a database named "TEST.DBF " with
            three fields, SYMBOL, SHARES, RPTDATE.
            DBDefine(`TEST.DBD');
            DBField(`1 SYMBOL C 10');
            DBField(`2 SHARES   N 6 2');
            DBField(`3 RPTDATE D');
            DBCreate(`TEST.DBD','TEST.DBF');
            If you had comma-delimited data file with one line for each
            record, you can then use the DBLoad function to load the data
            base.


          12.1.5 DBFirst      First Database Record


          Usage:         DBFIRST( FileNo )
          Returns:  Record Number
          Description : 
          Read and load database column variables from the first database
          record.
          The returned value from this function is the record number which
          must be greater than zero. Any value less than or equal to zero
          is an error or means that the operation did not complete (e.g.
          dbNext when there are no more records).


          12.1.6 DBLast       Last Database Record


          Usage:         DBLAST( FileNo )
          Returns:  Record Number
          Description : 
          Read and load database column variables from the last database
          record.



                                        12-3





                                                        Data Base Functions
          The returned value from this function is the record number which
          must be greater than zero. Any value less than or equal to zero
          is an error or means that the operation did not complete (e.g.
          dbNext when there are no more records).


          12.1.7 DBLoad       Load Database with Delimited Data


          Usage:         DBLOAD( DLMFileName,DBDFileName )
          Returns:  Success/Failure
          Description : 
          Load a database from the file DLMFileName (located in the ASCII
          File Directory), using the data base definition (DBD) file named
          DBDFileName. The database is assumed to exist with the DBD file
          in the DataBase File Directory and to be named the same as the
          DBD file name.
          Example:
            Assuming you have a comma separated value (CSV) file named
            CSVINP.PRN, and a Data Base Definition (DBD) file named
            MYCSV.DBD, the following will load each record from CSVINP.PRN
            into the database named MYCSV.DBF:
            DBLoad(`CSVINP.PRN','MYCSV.DBD');


          12.1.8 DBNext       Next Database Record


          Usage:         DBNEXT( FileNo )
          Returns:  Record Number
          Description : 
          Read and load database column variables from the next database
          record.
          The returned value from this function is the record number which
          must be greater than zero. Any value less than or equal to zero
          is an error or means that the operation did not complete (e.g.
          dbNext when there are no more records).


          12.1.9 DBOpen       Open Database File


          Usage:         DBOPEN( dbfName )
          Returns:  File Number
          Description : 
          Establish a link between TAS and the DBASE 3 compatible database
          named in the dbfName parameter.
          Once the function completes, a FileNumber is returned. If the
          FileNumber is less than zero, the function did not complete
          successfully.
          The FileNumber must be used in all other Dbxxxx function calls.




                                        12-4





                                                        Data Base Functions

          12.1.10 DBPrev      Previous Database Record


          Usage:         DBPREV( FileNo )
          Returns:  Record Number
          Description : 
          Read and load database column variables from the previous
          database record.
          The returned value from this function is the record number which
          must be greater than zero. Any value less than or equal to zero
          is an error or means that the operation did not complete (e.g.
          dbNext when there are no more records).


          12.1.11 DBRead      Read Database Record


          Usage:         DBREAD( FileNo,KeyValue )
          Returns:  Record Number
          Description : 
          Locate the record in the database (referred to by FileNo) whose
          first database field has a value equal to KeyValue. If such a
          record is found, the record number of the record is returned and
          all the database fields are loaded into TAS variables of the same
          name.



          12.1.12 DBTickList       Set Processing order to Database


          Usage:         DBTICKLIST( FileNo )
          Returns:  Integer
          Description : 
          Given a ticker list and a database, also containing ticker
          symbols, this function tells TAS to use the order of the symbols
          in the database, rather than the order of the historical data
          files as the ticker list order.



          12.1.13 DBWrite          Write Database record


          Usage:         DBWRITE( FileNo )
          Returns:  Record Number
          Description : 
          Copy all TAS variables whose names match the database fields to
          the database record matching the key variable value.





                                        12-5





                                                             Date Functions

          13. Date Functions


          13.1.1 DateStr      Create a formatted date


          Usage:         DATESTR( d )
          Returns:  String
          Description : 
          Create a "date string" in the form MM/DD/YY from the DATES array
          entry 'd'.



          13.1.2 DayMon       Day of Month


          Usage:         DAYMON( d )
          Returns:  Number
          Description : 
          Returns the "DAY OF THE MONTH" of the DATE contained in variable
          "d". The value returned is the day of the month. For example,
          daymon(910204) will return 4.



          13.1.3 DayWk        Day of Week function


          Usage:         DAYWK( d )
          Returns:  Number
          Description : 
          Returns the "DAY OF THE WEEK" of the DATE contained in variable
          "d". The value returned is a number from 0 to 6, where 0 is
          Sunday, 1 is Monday, 2 is Tuesday, 3 is Wednesday, 4 is Thursday,
          5 is Friday and 6 is Saturday.



          13.1.4 MakeDate          Create a date variable


          Usage:         MAKEDATE( month,day,year )
          Returns:  Date
          Description : 
          Create a date variable from the month, day, and year parameter
          values.
          The MakeDate(month,day,year) function call creates a date
          variable that can be added to some number of days, or subtracted
          from another date to get a difference in dates.
          Example:



                                        13-6





                                                             Date Functions
            Suppose you wanted to find the number of days until Christmas
            1995. You could do the following:
            DaysTillXmas = MakeDate(12,31,95) - Now();
            WriteLn(`Days until Christmas 1995 is `,DaysTillXmas);



          13.1.5 Month        Month function


          Usage:         MONTH( d )
          Returns:  Number
          Description : 
          Returns the Month (1-12) of the date value contained in the DATE
          type parameter "p ".



          13.1.6 Now          Current date


          Usage:         NOW(  )
          Returns:  Date
          Description : 
          Returns the current date at the time TAS is running. This date is
          a Date type variable in the form yymmdd.



          13.1.7 Year         Year function


          Usage:         YEAR( d )
          Returns:  Number
          Description : 
          Returns the Year (0-99) of the date value contained in the
          parameter.


















                                        13-7





                                                            Graph Functions

          14. Graph Functions


          14.1.1 Annotate          Annotate a graph


          Usage:         ANNOTATE( s1,s2,s3,....,sN )
          Returns:  None
          Description : 
          The ANNOTATE function will place the strings {s1, s2, .. sN} on
          the previously drawn Graph in the lower left corner of the graph,
          with s1 at the top of the annotation, s2 below it, up to sN on
          the bottom line of the graph.



          14.1.2 BGColors          Set background color


          Usage:         BGCOLORS( color )
          Returns:  None
          Description : 
          The BGColor(color) function will set the background color of a
          graph to the color specified.



          14.1.3 CloseGraph        Close Graph screen


          Usage:         CLOSEGRAPH(  )
          Returns:  None
          Description : 
          The CloseGraph function causes all the graphs since the last
          OpenGraph function to be displayed. It waits for you to hit a key
          to proceed.
          If you hit an ESC the graphing (and the script) stop completely.
          If you type the key combination ALT-P at this point, a graph will
          be printed to the printer device specified in the File/Printer
          Setup menu.


          14.1.4 DownArrow         Draw a small down arrow


          Usage:         DOWNARROW( color, day_index,y-value )
          Returns:  None
          Description : 
          The DownArrow function draws a small downward-pointing arrow at
          the height specified by y-value, the x value (day index)
          specified by day_index, using the color value.



                                        14-8





                                                            Graph Functions


          14.1.5 DrawLine          Draw a line on a graph


          Usage:         DRAWLINE( color,x1,y1,x2,y2,start,end )
          Returns:  None
          Description : 
          This function will draw a line from the point (x1,y1) to (x2,y2)
          starting at point start and ending at point end. The color
          parameter can be in the range from 0 (black) to 15 (white).



          14.1.6 Graph        Draw a single graph


          Usage:         GRAPH( [yl,yh],a1,l1,a2,l2...,aN,lN )
          Returns:  None
          Description : 
          This is the function that defines what lines (arrays) are charted
          in a graph window. The function has a variable number of
          arguments, since you can have a variable number of lines in a
          graph window.
          The yl and yh are optional arguments that set the y-axis scale
          from a low of yl to a high of yh. If you omit these arguments,
          the graph is automatically scaled to hold the highest and lowest
          values of all charted arrays.
          For each array to be graphed, you can specify one or two
          arguments. The first argument, a1 in the description, is the
          array to be graphed. The second optional argument, l1,  is a
          character string containing the legend to be printed in the graph
          title area in the same color as the charted line.
          Subsequent arrays are indicated as additional pairs of
          array/legend values.
          The special graph named HLC will draw a graph of the
          High/Low/Close/Open for the current security.

          Example:
            Each of the arrays and legends specified in the GRAPH command
            are graphed in the same window, one on top of the other. For
            example, to graph +DI, -DI and ADX on the same graph, you would
            say
            GRAPH(0,100,PDI(14),'+DI',MDI(14),'-DI',ADX(14),'ADX 14');
            Note that this graph function requests a y-axis scaling from 0
            to 100, since that is the range of the directional movement
            indicators. If you had omitted the "0,100 " arguments, the
            graph would have charted with automatic scaling and would have
            included enough of the y-axis to contain the highest and lowest
            values of the three indicators.





                                        14-9





                                                            Graph Functions
          14.1.7 HLine        Draw a horizontal line


          Usage:         HLINE( y-value, color, linestyle )
          Returns:  None
          Description : 
          HLine draws a horizontal line on the previously drawn graph with
          the color and linestyle specified. The horizontal line's y-axis
          value is given by y-value.
          The linestyle can be a number from 0 to 32767, where the 0 is no
          line and 32767 is a solid line. The linestyle is a value, which
          when converted to hexadecimal format, indicates the number of
          pixels which are set in every 16 pixels group.



          14.1.8 LineColors        Set Line Colors


          Usage:         LINECOLORS( c1,c2,c3,...,cN )
          Returns:  None
          Description : 
          The LineColors function will set the colors of lines drawn on a
          graph. Each array drawn by the Graph command will take the color
          given by the LINECOLORS i-th argument. See the BBAND.TAS script
          example for the use of the colors to set both the top and bottom
          Bollinger Bands to light red.
          LINECOLORS with no arguments will reset the colors to the default
          settings.



          14.1.9 OpenGraph         Open a Graph Screen


          Usage:         OPENGRAPH( numgraphs[,start,end] )
          Returns:  None
          Description : 
          This function prepares for numgraph graph windows to be dis-
          played. The dates displayed are from quote start to quote number
          end. For example, to prepare to display 3 graphs of the last 50
          days, you would say:
                  OPENGRAPH(3,-50,0);
          The start and end values are optional, so you don't have to spec-
          ify them. If they are not specified, the default is to display
          from the first to the last quote.



          14.1.10 PrintGraph       Print the current graph screen


          Usage:         PRINTGRAPH(  )


                                        14-10





                                                            Graph Functions
          Returns:  None
          Description : 
          The PrintGraph() function will print the last screen of graphs
          drawn.
          In order to print successfully, you need to have filled in the
          Printer Setup menu.
          Once the printing is complete, the graph screen is "closed"
          automatically, so you do not use the CloseGraph function.



          14.1.11 SemiLogGraph          Draw a log/linear graph


          Usage:         SEMILOGGRAPH( [yl,yh],a1,l1,a2,l2...,aN,lN )
          Returns:  None
          Description : 
          This is the function that defines what lines (arrays) are charted
          in a semi-log graph window. The function has a variable number of
          arguments, since you can have a variable number of lines in a
          graph window.
          See the description and examples for the Graph function for the
          meaning of the parameter values.


          14.1.12 SizeGraph        Set Graph Sizes


          Usage:         SIZEGRAPH( S1, S2,...Sn )
          Returns:  None
          Description : 
          where S1..Sn are the number of 'shares' of the display area each
          graph prepared by the OPENGRAPH function will get when shown. For
          example, as above, with 3 graphs to be displayed, if you want the
          first graph to have 2 times as much space as the second or third,
          you would say
                  SIZEGRAPH(2,1,1);
          Note that there must be as many parameters to the SIZEGRAPH
          function as the number in the first parameter of the OPENGRAPH
          function (numgraphs above).



          14.1.13 TextAlign        Set text alignment


          Usage:         TEXTALIGN( horiz,vert )
          Returns:  None
          Description : 
          Usage: TextAlign(horizontal, vertical) where
          horizontal = _LEFT, _CENTER, _RIGHT
          vertical   = _TOP, _CENTER, _BOTTOM



                                        14-11





                                                            Graph Functions
          This function will align text written with TextAt so that it is
          either left, center, or right aligned in the horizontal direction
          and aligned at the top, center or bottom in the vertical
          direction. The alignment for the TextAt function is around the
          point at which the text is to be written.



          14.1.14 TextAt      Write text on graph


          Usage:         TEXTAT( day, height, string )
          Returns:  None
          Description : 
          will print "string "on the graph at the day specified by "day"
          and the height specified by "height".



          14.1.15 TextColor        Set text color


          Usage:         TEXTCOLOR( color )
          Returns:  None
          Description : 
          This function will set the text color (legends, annotations,
          dates) of a graph to the color specified.



          14.1.16 TextDir          Set text writing direction


          Usage:         TEXTDIR( direction )
          Returns:  None
          Description : 
          The TextDir function will set the direction of subsequent text
          output according to the "direction" value:
               0 = left to right
               1 = bottom to top



          14.1.17 TextFont         Set text font


          Usage:         TEXTFONT( fontId )
          Returns:  None
          Description : 
          Usage: TextFont(fontId) function to set the text output font on
          graphs. Font types are:
          0       8x8 bit mapped font
          1       "Triplex" stroked font


                                        14-12





                                                            Graph Functions
          2       Small stroked font
          3       Sans Serif stroked font
          4       Gothic stroked font



          14.1.18 TextSize         Set text size


          Usage:         TEXTSIZE( horiz,vert )
          Returns:  None
          Description : 
          Usage: TextSize(horizontal, vertical) The TextSize function takes
          two parameters, a horizontal width and a vertical height,
          expressed in 1/8'ths of "normal" size. For example, to set the
          text to be twice as wide and half as high, you would say
          TextSize(16,4);
          since 16/8'ths = 2 and 4/8'ths = 1/2.



          14.1.19 UpArrow          Draw a small up arrow


          Usage:         UPARROW( color, day_index,y-value )
          Returns:  None
          Description : 
          The UpArrow function draws a small upward-pointing arrow at the
          height specified by y-value, the x value (day index) specified by
          day_index, using the color value.



          14.1.20 VLine       Draw a vertical line


          Usage:         VLINE( day_index, color, linestyle )
          Returns:  None
          Description : 
          The VLine function draws a vertical line at the day index
          specified by day_index, using the color value and linestyle
          specified.













                                        14-13





                                                               IO Functions

          15. IO Functions


          15.1.1 AClose       Close an ASCII File


          Usage:         ACLOSE( Handle )
          Returns:  None
          Description : 
          The AClose function closes and releases the file which was opened
          with handle.
          See the AOpen description for an example.



          15.1.2 AGet         Get comma separated values


          Usage:         AGET( Handle,v1[,v2,..,vn] )
          Returns:  Integer
          Description : 
          The AGet function will read the variables v1,v2,...vN from the
          file whose handle was returned by an AOpen function. This
          function will only work if the file was AOpen'd for reading.
          The function returns the number of fields successfully parsed.
          In order for the AGet function to work correctly, you must pre-
          declare each variable prior to using it in the AGet function.
          This can be done by either assigning something of the correct
          type to it, or by declaring it (as shown in the AOpen example on
          page Error! Bookmark not defined.).

          Example:
            As an example of use, suppose you have a file that contains the
            ticker symbol and the P/E in a file called PE.DAT. Then, if you
            do
            Prolog handle = AOpen('PE.DAT','r');
            If ASeek(handle, TICKER) = 1 Then
            Begin
                  t : String;
                  pe: Number;
                  AGet(handle, t, pe);
                  WriteLn(t,pe);
            End;
            You will get a listing of ticker symbols and P/E's for those
            found in the file.        Be sure to AClose the file in your
            Epilog. See the sample script AIO.TAS and AIO.DTA for a
            complete example.







                                        15-14





                                                               IO Functions
          15.1.3 AGetLn       Get a line from a CSV file


          Usage:         AGETLN( Handle,v )
          Returns:  Truth value
          Description : 
          The AGetLn function will read the next line in the file whose
          handle was returned by an AOpen function.  The entire contents of
          the line (minus the new line character) are placed into the
          variable v.
          This function will only work if the file was AOpen'd for reading.
          In order for the AGetLn function to work correctly, you must pre-
          declare variable v prior to using it in the AGetLn function. This
          can be done by either assigning something of the correct type to
          it, or by declaring it.

          Example:
            As in the AGet example, you have a file that contains the
            ticker symbol and the P/E in a file called PE.DAT. Then, if you
            do
            Prolog handle = AOpen('PE.DAT','r');
            If ASeek(handle,TICKER) = 1 Then
            Begin
                  s, t : String;
                  pe: Number;
                  AGetLn(handle,s); // Get the line in s
                  ParseString(s,t,pe);
                  Writeln(t,pe);
            End;
            Once again, you will get a listing of ticker symbols and P/E's
            for those found in the file.


          15.1.4 AOpen        Open an ASCII file


          Usage:         AOPEN( Filename,IOtype )
          Returns:  Handle
          Description : 
          The AOpen function will open the file named name for either
          reading or writing, depending on the contents of the type
          parameter. If type is 'r', the file will be opened for reading.
          If type is 'w', it will be opened for writing. If you want to
          append to the existing file, use the type "a ".
          The handle value returned by the function is a number which is
          used to tell the other file functions which file you are
          referring to. You can have more than one file of this sort opened
          at the same time.

          Example:
            Suppose you have a file named STOCK.DAT which contains three
            items per line. The first item is a security name, the second
            is a number of shares purchased, and the third is the purchase


                                        15-15





                                                               IO Functions
            date. You could read each line and print it with the script
            below:
            StockName is a String;
            NumberOfShares is a Number;
            DatePurchased is a Number;
            hp = Aopen('STOCK.DAT','r');
            While (AGet(hp,StockName,NumberOfShares, DatePurchased))
            Begin
              WriteLn(StockName,NumberOfShares,DatePurchased);
            End
            AClose(hp);


          15.1.5 APut         Put fields to an ASCII file


          Usage:         APUT( Handle,v1[,v2,..,vn] )
          Returns:  None
          Description : 
          The APut function will put the variables v1,v2,...vN to the file
          whose handle was returned by an AOpen function. This function
          will only work if the file was AOpen'd for writing or append.
          Note that this function does not terminate the line with a
          newline character.



          15.1.6 APutLn       Put a new record to an ASCII file


          Usage:         APUTLN( Handle,v1[,v2,..,vn] )
          Returns:  None
          Description : 
          See description for APut . The APutLn function will also
          terminate the ASCII record with a new line after the last
          variable is written.
          Example:


















                                        15-16





                                                               IO Functions
            symbol : STRING;
            price : NUMBER;
            hdl = AOPEN(`myfile.dat','a');
            APutLn(hdl,ticker,close);
            ACLOSE(hdl);
            will write the ticker symbol and the current close to the file
            `myfile.dat'. Note that the AOPEN is done with the "a "
            (append to end of file) flag. Otherwise this file would be re-
            written each time it is opened.

            Suppose you want to create a ticker list from a script while
            generating some report or other scanning results. You only want
            to include those securities whose Close has crossed their 21
            day moving average in your ticker list:
            Prolog Begin
            handle = AOpen('BUYLIST.TCK','w');
            End;
            If Over(C,Mov(C,21,'E')) <= 0 Then
            Begin
            APutLn(handle,Ticker);
            End;
            Epilog
            AClose(handle);



          15.1.7 ASeek        Locate a record in an ASCII file


          Usage:         ASEEK( Handle,keyString )
          Returns:  Truth value
          Description : 
          looks for a record starting with         the initial string value
          "s" in the file opened with handle "h" whose handle was returned
          by an AOpen function. This function will only work if the file
          was AOpen'd for reading.
          If the string "s" is found, the function returns 1, otherwise it
          returns 0.

          Example:















                                        15-17





                                                               IO Functions
            symbol : STRING;
            price : NUMBER;
            hdl = AOPEN(`myfile.dat','r');
            IF ASEEK(hdl,Ticker)
            BEGIN
                AGET(hdl,symbol,price);
               WRITELN(symbol,price);
            END;
            ACLOSE(hdl);
            would open the file MYFILE.DAT, look for a line containing the
            current ticker symbol in the first field. If found, it would
            read the record's two fields (presumably the ticker symbol and
            some price value).

          15.1.8 Ask          Ask user for input values


          Usage:         ASK( p1,v1[,p2,v2,.pN,vN] )
          Returns:  Truth value
          Description : 
          The Ask function builds an input panel with prompt text
          p1,p2,...pN and gets input into variables v1,v2,...,vN.
          The Ask function returns -1 if the user pressed the ESC key while
          the input panel was displayed.
          As described in the AGet function above,  you must pre-declare
          each variable prior to using it in the Ask function. This can be
          done by either assigning something of the correct type to it, or
          by declaring it (as shown in the AOpen example on page Error!
          Bookmark not defined.).

          Example:
            You want to write a script that can be used to check for 21 day
            exponential moving average crossovers, but you don't want to
            change the script each time you want to change either the
            moving average period or the moving average type. You can use
            the Ask function to get the period and type of moving average
            when you run the script.
            Prolog Begin
            Period  =  21;
            Type = 'E';
            Ask('Enter Moving Average Period',Period,
               'Enter Moving Average Type (S,E,W)',Type);
            End;
            If Close crossed above Mov(C,Period,Type) within 0 days Then
            WriteLn(Ticker,' is over ',Period,' Day Moving Average');



          15.1.9 Dump_Array        Array Contents


          Usage:         DUMP_ARRAY( a1,a2...aN )
          Returns:  None


                                        15-18





                                                               IO Functions
          Description : 
          Dump the contents of arrays"a1" to "aN" to the screen or a file.
          Each entry in the array is shown as a decimal number with the
          entry number in square brackets to the left, followed by the
          date. DUMP_ARRAY can be called with up to 12 array names. They
          will be printed side-by-side on the display.
          This function is useful for checking out the contents of an ar-
          ray...in other words, it is a debugging tool, not a report
          generating tool.

          Example:
            DUMP_ARRAY(H,L,C,V);
            will print the contents of each bar's high, low, close, and
            volume arrays.

          15.1.10 OutputFile       Specify listing file


          Usage:         OUTPUTFILE( f[,h,a] )
          Returns:  None
          Description : 
          The outputFile function can be used to set the file name f into
          which the script output is to be directed.

          The optional  s (skip heading) argument can be specified If you
          want to omit the  normal TAS headings in the output file. Specify
          "Y " to skip headings, " N " to include the TAS heading.

          The optional a (append heading)  argument can be specified if you
          want to append to the output file. Specify "Y " to append, " N "
          to overwrite.

          Example:
            OutputFile(`TEST.OUT');
            directs all WriteLn output to the file TEST.OUT in the OUTPUT
            directory (see the Setup/File Directories menu).


          15.1.11 Pause       Wait for keyboard input


          Usage:         PAUSE( s )
          Returns:  None
          Description : 
          The pause function will wait for up to s seconds or until a
          keystroke is pressed.



          15.1.12 VMenu       Vertical Menu for user input


          Usage:         VMENU( s1,s2,....sN )


                                        15-19





                                                               IO Functions
          Returns:  Integer
          Description : 
          The VMenu function will create a vertical menu with the first
          line containing the string s1, the second line containing s2 and
          the n-th line containing the string sN . The function returns the
          line number selected, or -1 if  the ESC key is pressed when the
          menu is presented.
          If you want to associate a "hot key" with a menu item, precede
          the "hot key" letter or number with an ampersand character. This
          will cause the following letter to be highlighted and will select
          that menu item if the letter is pressed.

          Example:
            The following will display a vertical menu asking for the type
            of study to run. If the user presses ESC, the script will stop.
            line = VMenu('&RSI Study',
                    '&MOV Study',
                    '&CCI Study');
            if line < 0 then STOP;


          15.1.13 Write       Write to output screen


          Usage:         WRITE( v1[,v2,..,vn] )
          Returns:  None
          Description : 
          See description for WriteLn


          15.1.14 WriteLn          Write to output screen with new line


          Usage:         WRITELN( v1[,v2,..,vn] )
          Returns:  None
          Description : 
          There are two direct output functions, Write and WriteLn. The
          WriteLn function is identical to the Write function, except that
          WriteLn causes a NEW LINE to be added at the end of the last
          field.
          The parameters to Write (and WriteLn) are either text strings,
          like 'this is a text string', surrounded by single quotes ('), or
          "variable values". A variable value is a value that you have
          assigned to a name by use of a formula or constant setting. There
          are "pre-defined" variables, such as H, L, C, V, O, TICKER,
          FULLNAME. These pre-defined variables are "filled in" when TAS
          reads the data values for each symbol.
          You can control the formatting of your output to some extent by
          using the characters sequence "\t" (backslash tee) in your text
          string. This will place a "tab" character in the output. TAS
          places "tab stops" every 4 columns of the output line.
          You can cause a new page to be printed by placing a "\p"
          (pagefeed) in your WriteLn string.


                                        15-20





                                                               IO Functions
          In addition, the sizes of the two types of "numbers", are con-
          stant. If you are printing an INTEGER value, it is five
          characters wide, left-justified. If you are printing a number
          with a decimal point, it is eight characters wide (99999.999).
          This will allow you to line up the output with column headings.

          Example:
            WriteLn(`Current = `,Ticker,Close, High, RSI(14)[-1]);
            would write the words "Current=" ,  followed by the current
            ticker symbol, its close and high,  and the value of the
            RSI(14) of the prior bar.

            Note: if you want to print a percent sign in your line, specify
            two percent signs in a row (i.e. "%% ").









































                                        15-21





                                                             Math Functions

          16. Math Functions


          16.1.1 Add          Add two arrays


          Usage:         ADD( Array1,Array2 )
          Returns:  Array
          Description : 
          Add each element of array Array1 to the corresponding element of
          array Array2 and return the resulting Array..
          Example:
            ARRAY X = ADD(C,H);
            would add each bar's close to each bar's high and assign the
            result to the array "X ".
            This can also be accomplished with the statement:
            ARRAY X = C + H;


          16.1.2 AddTo        Add number to array


          Usage:         ADDTO( a,n )
          Returns:  Array
          Description : 
          Adds the number "n" to each entry of array "a" and returns the
          result in an array.

          Example:
            ARRAY X = ADDTO(C,1);
            would add 1 to each bar's closing price and assign the
            resulting values to the array "X ".
            This can be accomplished by the statement
            ARRAY X = C + 1;
            as well.

          16.1.3 Const             Constant Array


          Usage:         CONST( n )
          Returns:  Array
          Description : 
          The const(n) function returns an array containing a "constant"
          value n.  For example, CONST(100) creates an array that contains
          the number 100 in each element of the array. Contrast this to the
          SET function which sets an array to a constant value. CONST is
          preferable to SET, since its result can be used in a formula.

          Example:





                                        16-22





                                                             Math Functions
            IF RSI(14) CROSSED ABOVE CONST(20) THEN .
                WRITELN(`RSI CROSSED OVER 20');
            would look for an RSI crossover of  constant value 20.


          16.1.4 COS          Trigonometric CoSine


          Usage:         COS( Array1 )
          Returns:  Array
          Description : 
          Cosine of each entry in Array1.
          Use the cos_(n) function to compute the cosine of a single number
          "n".


          16.1.5 CUM          Cumulative Sum of Array


          Usage:         CUM( Array1 )
          Returns:  Array
          Description : 
          Computes the sum of all prior entries in Array1.
          Example:
            x = Cum(Close)
            would add up all the closing prices and place the sum in
            variable "x ".


          16.1.6 DIV          Divide two arrays


          Usage:         DIV( Array1,Array2 )
          Returns:  Array
          Description : 
          Divide each element in Array 1 by the corresponding element of
          Array2. Return the resulting divided array.
          Example:
            ARRAY X = DIV(C,H);
            would divide each bar's close by each bar's high, placing the
            result in each entry of the array "X ".


          16.1.7 DivBy        Divide array by number


          Usage:         DIVBY( a,x )
          Returns:  Array
          Description : 
          Divide each element of array "a" by the value of "x". In this
          case, "x" is a single number.

          Example:


                                        16-23





                                                             Math Functions
            ARRAY X = DIVBY(C,2);
            will divide the closing price for each bar by 2 and place the
            contents of the result into the array "X ".


          16.1.8 EXP          Exponential Function


          Usage:         EXP( Array1 )
          Returns:  Array
          Description : 
          Computes the exponential value of each element of Array1:
          2.71828a[i] ("e" raised to the "a[i]" power).
          Use the exp_(n) function to compute the exponential of a single
          number "n".



          16.1.9 Int          Create Integer


          Usage:         INT( x )
          Returns:  Integer
          Description : 
          Turns the number "x" into an "integer" by dropping any part of
          the number to the right of the decimal point. An integer is a
          number without a fractional part (the part after the decimal).
          The maximum number that you can turn into an integer is 32,767.

          Example:
            I = INT(CLOSE OF TODAY);
            will put the integer portion of the closing price into the
            variable "I ". If the close is 58.875, the variable " I " will
            contain "58 ".


          16.1.10 LOG         Natural Logarithm


          Usage:         LOG( Array1 )
          Returns:  Array
          Description : 
          Natural logarithm (loge) of each entry in array Array1. Use the
          log_(n) function to compute the natural logarithm of a single
          number "n".


          16.1.11 Max         Maximum value of a pair


          Usage:         MAX( a,b )
          Returns:  Number
          Description : 


                                        16-24





                                                             Math Functions
          This function will return the maximum number between a pair of
          numbers. The statement
               result = max(a,b);
          is equivalent to
               If a > b then result = a else result=b



          16.1.12 MaxPair          Maximum value of two arrays


          Usage:         MAXPAIR( a,b )
          Returns:  Array
          Description : 
          This function will create an array containing the pair by pair
          maximum values in the arrays a and b. The statement
               result : array;
               result = maxPair(a,b);
          is equivalent to
               result : array;
               For Each Point using I
                    If a[I]> b[I] then
                         result[I] = a[I]
                    else
                         result[I] = b[I]



          16.1.13 MaxVal      Maximum value in array


          Usage:         MAXVAL( a )
          Returns:  Number
          Description : 
          This function will return the maximum value in the array a. The
          statement
               result = maxVal(a);
          is equivalent to
               result = 0;
               For Each Point using I
                    If a[I]> result then result = a[I]



          16.1.14 MemLeft          Show remaining memory


          Usage:         MEMLEFT(  )
          Returns:  Array
          Description : 
          The memleft function will return the number of bytes of
          available memory.



                                        16-25





                                                             Math Functions


          16.1.15 Min         Minimum value of a pair


          Usage:         MIN( a,b )
          Returns:  Number
          Description : 
          This function will return the minimum number between a pair of
          numbers. The statement
               result = min(a,b);
          is equivalent to
               If a < b then result = a else result=b



          16.1.16 MinPair          Minimum value of two arrays


          Usage:         MINPAIR( a,b )
          Returns:  Array
          Description : 
          This function will create an array containing the pair by pair
          minimum values in the arrays a and b. The statement
               result : array;
               result = minPair(a,b);
          is equivalent to
               result : array;
               For Each Point using I
                    If a[I]< b[I] then
                         result[I] = a[I]
                    else
                         result[I] = b[I]

          Example:
            Array X = MINPAIR(C,EMA(C,21));
            would place in X the lower of the CLOSE or the 21 day EMA of
            the CLOSE for each bar.

          16.1.17 MinVal      Minimum value in array


          Usage:         MINVAL( a )
          Returns:  Number
          Description : 
          This function will return the minimum value in the array a. The
          statement
               result = minVal(a);
          is equivalent to
               result = 9999999;
               For Each Point using I
                    If a[I]< result then result = a[I]



                                        16-26





                                                             Math Functions
          Example:
            X = MINVAL(C);
            is equivalent to
            X = LLV(C,QUOTE_COUNT);

          16.1.18 MUL         Multiply two arrays


          Usage:         MUL( Array1,Array2 )
          Returns:  Array
          Description : 
          Multiply each element of array Array1 by the corresponding
          element of array Array2. The result is returned as an array whose
          elements are
          Array1[i] * Array2[i]
          Example:
            Array X = MUL(CLOSE,V);
            is equivalent to
            Array X = CLOSE * V;

          16.1.19 MulBy       Multiply by number


          Usage:         MULBY( Array1,x )
          Returns:  Array
          Description : 
          Multiply each element of array Array1 by the value of "x". In
          this case, "x" is a single number.

          Example:
            Array X = MULBY(CLOSE,2);
            is equivalent to
            Array X = CLOSE * 2;

          16.1.20 NEG         Negate an array


          Usage:         NEG( Array1 )
          Returns:  Array
          Description : 
          The result is -Array1[i] for each element of the result array.


          16.1.21 Randomize        Make Random Number truly random


          Usage:         RANDOMIZE(   )
          Returns:   Number
          Description : 
          Randomize will initialize the random number generator to a truly
          random number. Contrast this with the RandomSeed function which
          sets the initial seed value from which subsequent random numbers
          are produced.


                                        16-27





                                                             Math Functions
          Using a deck of cards as an analogy, the Randomize function is
          equivalent to shuffling the deck.

          Example:
            Randomize();
            X = RandomNumber(50,200);
            will generate a different random number between 50 and 200.


          16.1.22 RandomNumber          Generate random number


          Usage:         RANDOMNUMBER( LowRange,HighRange )
          Returns:  Number
          Description : 
          Generate a pseudo-random number between LowRange and HighRange
          (inclusive).
          Example:
            X = RandomNumber(50,200);
            will generate a random number between 50 and 200.


          16.1.23 RandomSeed       Initialize Random Number Generator


          Usage:         RANDOMSEED( SeedNumber )
          Returns:  Number
          Description : 
          The RandomSeed function will set the initial seed value for the
          random number generator. This is useful if you want to obtain
          "random " numbers that are consistent from one run of a script
          to another.
          Example:
            RandomSeed(41);
            X = RandomNumber(50,200);
            will generate the same random number between 50 and 200 for
            each run of the script.


          16.1.24 Set         Set Array to Value


          Usage:         SET( a,v )
          Returns:  None
          Description : 
          Sets all entries in array 'a' to the value 'v'. For example, you
          could use this function to create an array where each entry is
          22.5.

          Example:





                                        16-28





                                                             Math Functions
            OpenGraph(1);
            Graph(CUM(CONST(1));
            CloseGraph();
            would show a line increasing by 1 for each date.

          16.1.25 Sign        Sign of array entries


          Usage:         SIGN( a )
          Returns:  Array
          Description : 
          This function will create an array of the "signs" of each entry
          in the array a.
          The statements
               result : array;
               result = sign(a);
          is equivalent to
               For each Point using  I
                    if a[I] > 0 then
                         result[I] = +1
                    else
                    if a[I] < 0 then
                         result[I] = -1
                    else
                         result[I] = 0;



          16.1.26 SIN         Trigonometric sine


          Usage:         SIN( Array1 )
          Returns:  Array
          Description : 
          Computes the sine of each entry in array 'Array1 "
          Use sin_(n) for the sine of a single number.



          16.1.27 SQRT        Square Root


          Usage:         SQRT( Array1 )
          Returns:  Array
          Description : 
          Computes the square root of each entry in array 'Array1'.
          Use the sqrt_(n) function to compute the square root of a single
          number "n".







                                        16-29





                                                             Math Functions
          16.1.28 SUB         Subtract one array from another


          Usage:         SUB( Array1,Array2 )
          Returns:  Array
          Description : 
          Subtract each element of Array2 from the corresponding element of
          Array1.
          Example:
            Array X = SUB(H,C);
            is equivalent to
            Array X = H-C;

          16.1.29 SubFrom          Subtract number from array


          Usage:         SUBFROM( a,n )
          Returns:  Array
          Description : 
          Subtract the number "n" from each entry in array "a" returning
          the result in an array.

          Example:
            Array X = SUBFROM(CLOSE, 5);
            is equivalent to
            Array X = CLOSE - 5;

          16.1.30 SUM         Sum over a period


          Usage:         SUM( Array1,Period1 )
          Returns:  Array
          Description : 
          Sums the elements of Array1 over Period1 bars.  This function is
          similar to the CUM function, the difference being the cumulative
          sum for each element is limited to Period1 days.


          16.1.31 TAN         Trigonometric Tangent


          Usage:         TAN( Array1 )
          Returns:  Array
          Description : 
          Compute the trigonometric tangent of each entry in Array1.
          Use tan_(n) for the tangent of a single number.


          16.1.32 Zero        Zero Array


          Usage:         ZERO( Array1 )
          Returns:  None


                                        16-30





                                                             Math Functions
          Description : 
          Sets each entry of array  Array1 to zero. See the const function
          for a more flexible method of setting an array to a constant
          value.



          16.1.33 zScore      Compute Z-Score for array


          Usage:         ZSCORE( Array )
          Returns:  Array
          Description : 
          zScore(a)  = (a[i] - mean(a))/std(a)
          From TASC Oct 94, page 80 Heading "Converting to Z Scores".  The
          mean of the zScore array is 0 and the standard deviation is 1,
          either way.
          The advantage of the zScore function is that it creates an array
          that is as variable as the original array's values, but it is
          scaled from +4 to -4 standard deviations. You can use this
          function to compare to arrays with different scales.
          Example:
            This example shows that you can load and chart two securities
            that have large differences in their y-axis range, such that if
            you charted them together (the first Graph function), they
            would not be easy to view together, but if you use the zScore
            on them, they are scaled similarly.

            Array IbmA = Load(`IBM','C');
            Array SPXA = Load(`SP-500','C');
            OpenGraph(2);
            Graph(IbmA,SPXA);
            Graph(zScore(IbmA),zScore(SPXA));
            CloseGraph();





















                                        16-31





                                                    Miscellaneous Functions

          17. Miscellaneous Functions


          17.1.1 Defined      Check if variable exists


          Usage:         DEFINED( v )
          Returns:  Truth
          Description : 
          Returns zero if the variable v has not been defined or used prior
          to this point in the script. This function is used frequently
          when you  have a script that can be passed variable values from
          the DOS command line. If no variable values are passed on the
          command line, you would want to set the variables to some
          "default" value.

          Example:
            The script is written to use the moving average period
            contained in the variable period. If the period value is
            specified on the command line, it should use that value, but if
            not, it should use 21. The script would be written as follows:
            IF NOT DEFINED(period) THEN
            PERIOD = 21;
            MA = MOV(C,PERIOD,'S');
            You could invoke the script using the parameter @PERIOD=50 to
            use a 50 day period, or if you didn't specify anything, the
            script would use a 21 day period.


          17.1.2 DOS          Execute a DOS command


          Usage:         DOS( 'command' )
          Returns:  None
          Description : 
          This function executes the DOS command specified by "command".
          The DOS command must be a string surrounded by single quotes, or
          a string variable.

          Example:
            If while processing the ticker symbol "IBM" the DOS function is
            called as follows,
            DOS('Copy '+TICKER+'.PRO B:');
            it will issue the DOS command
            COPY IBM.PRO B:
            copying the file "IBM.PRO" to drive B:


          17.1.3 GetFileName       Extract file name


          Usage:         GETFILENAME( DOS Path String )


                                        17-32





                                                    Miscellaneous Functions
          Returns:  String
          Description : 
          This function returns the file name from the path string.
          Example:
            Given the string `D:\STOCKS\A\IBM.PRN' in variable PName:
            X = GetFileName(PName);
            WriteLn(X);
            would print
            `IBM'

          17.1.4 GetFileType       Extract file extention


          Usage:         GETFILETYPE( DOS Path String )
          Returns:  String
          Description : 
          This function returns the file extention from the path string.
          Example:
            Given the string `D:\STOCKS\A\IBM.PRN' in variable Pname:
            X = GetFileType(PName);
            WriteLn(X);
            would print
            `PRN'

          17.1.5 GetPathName       Extract directory path


          Usage:         GETPATHNAME( DOS Path String )
          Returns:  String
          Description : 
          This function returns the directory portion of the path string.
          Example:
            Given the string `D:\STOCKS\A\IBM.PRN' in variable Pname:
            X = GetPathName(PName);
            WriteLn(X);
            would print
            `D:\STOCKS\A'

          17.1.6 Load         Load a Data Array


          Usage:         LOAD( t,f )
          Returns:  Array
          Description : 
          The Load function will retrieve the first occurrence of a ticker
          from the historical data directories. The ticker is specified as
          the first parameter to the Load function.
          The second parameter of the load function is the field to be
          loaded from the ticker file. The name of the field must be sur-
          rounded by single quotes or it must be a string variable contain-
          ing the name of the field. The field names are the same as the
          pre-defined data array names, that is, C for closing price, H for
          high price, etc.


                                        17-33





                                                    Miscellaneous Functions
          The value returned from the Load function is an array containing
          the portion of the ticker file requested by the field name.  If
          the security symbol was not found, the current day's value will
          be zero.

          The field argument can also be a string containing the word
          "All ". If this is the case, all data arrays from the requested
          security symbol are loaded into the pre-defined arrays High, Low,
          Close, Open, Open Int, Dates, Volume.














































                                        17-34





                                                          Pattern Functions

          18. Pattern Functions


          18.1.1 FindFst      Find first value


          Usage:         FINDFST( a,v )
          Returns:  Number
          Description : 
          findfst finds the first occurrence of the numeric value v in the
          array a and returns the day index (negative days in the past) on
          which the value occurred. If the value v was not found in a, the
          findfst function returns a positive number.



          18.1.2 FindLst      Find last value


          Usage:         FINDLST( a,v )
          Returns:  Number
          Description : 
          findlst finds the last occurence of the numeric value v in the
          array a and returns the day index (negative days in the past) on
          which the value occurred. If the value v was not found in a, the
          findlst function returns a positive number.



          18.1.3 FindPattern       Find pattern in array


          Usage:         FINDPATTERN( array,patternString )
          Returns:  Array
          Description : 
          Using the patternString, scan the array and return a "1" at each
          point where the pattern is matched and a zero in all other
          positions. The pattern consists of the symbols "+", "-" and "0",
          representing up bar, down bar, no change, respectively.
          Example:
            A is an Array;
            A = findPattern(Close,'---++');
            will place a 1 in the array A on each day where the preceding 5
            bars contained 3 down bars followed by 2 up bars.


          18.1.4 Peak         Find Peak in Array


          Usage:         PEAK( a,n )
          Returns:  Integer
          Description : 


                                        18-35





                                                          Pattern Functions
          returns the index of the 'n'-th peak value in array 'a'. A 'peak'
          is defined as a high value surrounded by lower values. The value
          returned from this function is the array index to the peak value.




















































                                        18-36





                                                          Pattern Functions























































                                        18-37





                                                          Pattern Functions
          In the figure above, the peak(C,2) call would return the index of
          the point marked P2. If you consider the volume vertical bars a
          day, then the value returned in this example would be '-13', or
          13 days prior to the last day.



          18.1.5 Trough       Find Trough in Array


          Usage:         TROUGH( a,n )
          Returns:  Integer
          Description : 
          returns the index of the 'n'-th "trough" value in array 'a'. A
          'trough' is defined as a low value surrounded by higher values.
          The value returned from this function is the array index to the
          trough value.
          In the figure shown with the peak function above, the trough(C,2)
          call would return the index of the point marked 'T2'.  Based on
          the volume bars shown, the value returned in this example would
          be '-11', or 11 days prior to the last day.


































                                        18-38





                                                      Profit Test Functions

          19. Profit Test Functions


          19.1.1 Future       Future array element


          Usage:         FUTURE( a,n )
          Returns:  Number
          Description : 
          This function can be used in a profit test to "cheat" by looking
          into the "future" to a date that is not currently under
          investigation by the profit test routines. The function returns
          the value of the array "a" as of the point "n" days into the
          future.



          19.1.2 PT_Buy            Profit Test - Buy


          Usage:         PT_BUY(  )
          Returns:  Number
          Description : 
          Buy the stock under test at the current closing price if not
          already held. If testing Short positions, buy to 'cover' the
          short sale.
          If a long position is opened, this function returns the number of
          shares purchased.



          19.1.3 PT_Init      Profit Test Initialization


          Usage:         PT_INIT( cash,type,detail )
          Returns:  None
          Description : 
          This function will commence a profit test using the options
          chosen.
          cash  is a number containing the initial cash position when the
          test starts on a security.
          type is either `L' (Long), `S' (Short) or `B' (Both Long and
          Short) for the type of positions to be opened.
          detail is the level of detail output to be produced. A 0 means
          full detail of all trades, a 1 means summary by security only,
          and a 2 produces a summary for all securities and no other
          output.

          To further control profit testing options, see the PT_Options
          function.
          This function should only be used in the PROLOG statement.



                                        19-39





                                                      Profit Test Functions
          Example:
            Prolog Begin
              PT_Init(25000.00,'B',0);
              PT_Options(..... some options ....);
            End;
            This PT_Init function will start a profit test using 25,000
            units (US$ or your currency), switching from long to short
            positions, with a trading activity detail level.


          19.1.4 PT_Options        Profit Test Options


          Usage:         PT_OPTIONS(
          commType,purchaseRule,reinvestRule,slippageRule )
          Returns:  None
          Description : 
          Set functional options for a profit test. All arguments to this
          function are STRING variables containing the option choice(s).
          The commType is one of the following:
          "NoComm "       - No commissions
          "Schwab "      - Charles Schwab commissions
          "Schwab10 "    - Charles Schwab with 10% discount
          "Olde "        - Olde Discount Commissions
          "PCFN "   - PCFN Commissions
          number    - a fixed unit amount per trade
          number%   - a fixed percentage per trade

          purchaseRule is the rule to use when buying shares and must be
          one of the following values:
          "RoundLots "   - buy in units of 100 shares
          "OneShare "    - buy a single contract/share only
          "AllCash "     - buy as many shares as possible with available
          cash

          reinvestRule is `Y' to reinvest profits in the next transaction,
          and `N' to hold profits separate from trading capital.

          slippageRule is
          `0'  Today's Close
          `1'  Next Day's Average
          `2'  Next Day's Open
          `3'  Next Day's Close
          `4'  Next Day's High
          `5'  Next Day's Low



          19.1.5 PT_Price               Profit Test - Get open position

          entry price

          Usage:         PT_PRICE( t )


                                        19-40





                                                      Profit Test Functions
          Returns:  Number
          Description : 
          Returns the share price at which the last OPEN transaction was
          executed. If there is currently no position held, then the value
          returned depends on the value of the parameter t.
           If t' is 'L', the value returned is 0. If t is 'S', the value
          returned is 9999999.0.
          The function is useful if you want to set a STOP based on the
          change in price. The parameter t is either 'L' for a Long Posi-
          tion, or 'S' for a Short Position.



          19.1.6 PT_Sell           Profit Test - Sell


          Usage:         PT_SELL(  )
          Returns:  Number
          Description : 
          Buy the stock under test at the current closing price if not
          already held. If testing Short positions, buy to 'cover' the
          short sale.
          If a short position is opened, this function returns the number
          of shares sold.



          19.1.7 PT_SetPrice            Profit Test - Set transaction

          closing price

          Usage:         PT_SETPRICE( p )
          Returns:  None
          Description : 
          Sets the price at which the next transaction will take place,
          where p is the price.

          Example:
            In a profit test, suppose you wanted to buy and sell the
            security under test at the price of the DJ-30 (rather than the
            prices for the security being tested).
            OtherArray : ARRAY;
            Plot Begin
               OtherArray = LOAD(`DJ-30','C');
            End;
            PT_SetPrice(OtherArray[Quote_Count]);
            .... rest of profit test .....

          19.1.8 PT_Stop           Profit Test - Stop Long/Short


          Usage:         PT_STOP( t )
          Returns:  None


                                        19-41





                                                      Profit Test Functions
          Description : 
          Issue either a Long Stop or a Short Stop. The parameter 't' is
          either 'L' for a Long Stop, or 'S' for a Short Stop.



          19.1.9 Redo         Rerun profit test


          Usage:         REDO(  )
          Returns:  None
          Description : 
          The redo() function causes a profit test to be rerun again. The
          redo_count() function (below) returns a value one greater than
          the last time it was called.

          Example:
            The following is a segment that uses REDO to perform a profit
            test of the CCI function on for periods from Speriod to
            Eperiod:

            If Speriod = 0 then
                Speriod = 1;        { Start at 1 day period}
            if Eperiod = 0 then
                Eperiod = 500;      { go to 500 day period }
            F1 : ARRAY;
            PLOT BEGIN
                    Period = REDO_COUNT()+Speriod;
                    writeln('CCI Period IS ',INT(Period));
                    F1 = CCI(Period);
                    IF Period < Eperiod THEN
                            REDO();
            END; { of PLOT BEGIN}

          19.1.10 Redo_Count       Profit Test Reruns


          Usage:         REDO_COUNT(  )
          Returns:  Number
          Description : 
          The redo_count() function returns the number of times a redo()
          function has been called for the same security file. It can be
          used to rerun a profit test with different variable values (i.e.,
          optimize).

          Example:
            See REDO function example.

          19.1.11 Stop_Maximumloss           Profit Test - Set maximum loss

          amount

          Usage:         STOP_MAXIMUMLOSS( v,t )


                                        19-42





                                                      Profit Test Functions
          Returns:  None
          Description : 
          This function directs the profit tester to stop out a position
          when the current position has lost the specified amount or
          percentage. The profit test report shows this stop as StopL.
          Parameters:
          v    - percentage or maximum dollar amount to lose
          t    - type : either `%' for percentage or `$' for dollar amount

          Example:
            Stop_MaximumLoss(4000,'$');

            would institute a 4000 unit (dollars or whatever) maximum stop
            loss.

          19.1.12 Stop_ProfitTarget          Profit Test - Set profit

          target

          Usage:         STOP_PROFITTARGET( v,t )
          Returns:  None
          Description : 
          This function directs the profit tester to stop out a position
          when the current position has gained the specified amount or
          percentage of profit. The profit test report shows this stop as
          StopT.
          Parameters:
          v    - percentage or maximum dollar amount to lose
          t    - type : either `%' for percentage or `$' for dollar amount



          19.1.13 Stop_Trailing         Profit Test - Set trailing stop

          loss

          Usage:         STOP_TRAILING( v,t )
          Returns:  None
          Description : 
          This function directs the profit tester to stop out a position
          when the current position has lost the specified amount or
          percentage of profit. The profit test report shows this stop as
          StopP.
          Parameters:
          v    - percentage or maximum dollar amount to lose
          t    - type : either `%' for percentage or `$' for dollar amount

          Example:
            Stop_Trailing(10,'%');

            would institute a 10% trailing stop loss.




                                        19-43





                                                            Setup Functions

          20. Setup Functions


          20.1.1 Compress          Date Compression


          Usage:         COMPRESS( cfactor )
          Returns:  None
          Description : 
          Compress will compress a security file's data by amount specified
          by cfactor.
          cfactor can have the following values:
               W    weekly compression
               M    monthly compression
               Y    yearly compression
               n    any number of bars to be summed for compression
          The cfactor parameter, if it is a letter, must be enclosed in
          single quotes. For example, to compress daily to weekly data, you
          would use
               Compress('W');
          Compression points for the different periods are:
          Weekly : the Friday of the week
          Monthly : the end of the month
          Yearly : the end of the year
          This function is only valid within a Prolog statement. After the
          Prolog statement runs, the data compression value cannot be
          changed.

          Example:
            Prolog Begin
               Compress(20);
            End;
            would compress every 20 bars into one bar.

            Prolog Begin
               Compress(`M');
            End;

            would compress according to the monthly calendar.


          20.1.2 DateRange         Set Date Range


          Usage:         DATERANGE( start,end )
          Returns:  None
          Description : 
          Sets the date range used for loading data records for each
          security data file.
          This function is only valid within a Prolog statement. After the
          Prolog statement runs, the date range cannot be changed.



                                        20-44





                                                            Setup Functions
          The start and end arguments should be in the form of dates
          (YYMMDD number format).
          Data points prior to start and subsequent to end are not loaded.

          Example:
            Prolog Begin
               DateRange(940101,950101);
            End;
            would load only data points between Jan 1, 1994 and Jan 1,
            1995.


          20.1.3 MaxQuotes         Set Maximum Data Points


          Usage:         MAXQUOTES( n )
          Returns:  Number
          Description : 
          Sets the maximum data points (quotes) that will be read in for
          each security.
          This function is only valid within a Prolog statement. After the
          Prolog statement runs, the maximum data points cannot be changed.

          Example:
            Prolog Begin
               MaxQuotes(260);
            End;
            would load only 260 data points in the script section.



























                                        20-45





                                                             Sort Functions

          21. Sort Functions


          21.1.1 SortAlloc         Allocate a new sort buffer


          Usage:         SORTALLOC( None )
          Returns:  Integer
          Description : 
          This function allocates a new sort buffer which can be used for
          additional sorting beyond that provided by the default sort
          buffer.
          The function returns a number which represents the sort buffer
          number. The default sort buffer is buffer number 0.


          21.1.2 SortFree          Free a sort buffer


          Usage:         SORTFREE( bufferNumber )
          Returns:  None
          Description : 
          This function will free a sort buffer allocated by the SortAlloc
          function. The bufferNumber parameter is the number returned from
          the SortAlloc function.


          21.1.3 SortGet      Retrieve one record from Sort Buffer


          Usage:         SORTGET( v1[,v2,..,vn] )
          Returns:  Truth value
          Description : 
          After a SORTON function is called, the data in the sort array is
          in some particular sorting order. If you want to retrieve each
          "line" from the sort array, one at a time, you can use the
          SORTGET function.  When you use the SORTGET function, you are
          asking TAS to "retrieve" the columns of data in the next line
          from the sort buffer and to place those data values in the
          variables you specify as parameters to the SORTGET function.
          After the SORTGET function returns, the variables you named in
          the SORTGET function call will be "filled in" with the values
          from the next line (in sequence) of the sort buffer.
          SORTGET(v1,v2,v3,....,vN)
          where
          v1   is the first variable to be filled in by SORTGET
          v2   is the second variable to be filled in by SORTGET,
          and
          vN    is the last variable to be filled in by SORTGET. The number
          "N" must be exactly equal to the number of parameters used in the
          SORTOUT command that filled in the sort buffer.



                                        21-46





                                                             Sort Functions
          The SORTGET function returns as its value a 1 (one) if the
          variables were "filled in" by a record from the sort buffer and 0
          (zero) if not.  This returned value can be used in a WHILE loop
          to determine when the last sort record has been obtained.

          Example:
            This example will first read all tickers in the ticker list,
            storing their symbol  and the percentage difference between
            their price and their 21 day EMA. At the end of the list, it
            will then sort the list and graph all securities in descending
            order of this difference:

            SortOut(Ticker,(CLOSE-EMA(CLOSE,21))/EMA(CLOSE,21)*100);
            Epilog Begin
               SortOut(2,'D');   // Sort descending by difference from EMA
               Symbol : STRING;
               Diff      : NUMBER;
               While SORTGET(Symbol,Diff)  Begin
                   Load(Symbol,'A');
                   OpenGraph(1);
                   Graph(HLC,'Price',EMA(CLOSE,21),'21 DAY EMA');
                End;

          21.1.4 SortOn       Sort data in buffer on field


          Usage:         SORTON( c1,d1[,c2,d2..,cn,dn] )
          Returns:  None
          Description : 
          Once all tickers have been processed, and their lines of data
          have been placed in the sort buffer using the SORTOUT function,
          you can sort the lines of data with the SORTON function. The
          SORTON function requires pairs of two parameters as follows:
          SORTON(column_number_1, direction_1,column_number_2,
          direction_2,....,column_number_N,direction_N)
          where:
          column_number_*      is the parameter position of the data field
          (column) in the SORTOUT command that placed the data in the sort
          buffer.
          direction_*     is either 'a' for ASCENDING or 'd' for DESCENDING
          sort.
          The SORTON function will sort first on column_number_1 in di-
          rection_1, then on the next column/direction pair, etc.
          Using the example given in the SORTOUT description above, since
          the report was to be sorted by VOLUME, that is the 5th parameter
          position ("column") in the SORTOUT function shown.
          The SORTON function returns as its value the number of records in
          the sort buffer.







                                        21-47





                                                             Sort Functions
          21.1.5 SortOut      Put data in Sort Buffer


          Usage:         SORTOUT( v1[,v2,..,vn] )
          Returns:  None
          Description : 
          The SORTOUT function takes up to 40 parameters which are fields
          to be placed in the 'sort buffer'. As each ticker is processed,
          you can place the computed results in the 'sort buffer'.

          Example:
            Suppose you wanted to create a report of tickers in order by
            their volume. You wanted the report to contain the Ticker, the
            High, Low and Closing prices as well. For each ticker you would
            say
            SortOut(Ticker,H,L,C,V);


          21.1.6 SortPrint         Print contents of Sort Buffer


          Usage:         SORTPRINT( FormatString )
          Returns:  None
          Description : 
          The trickiest part of using the SORT feature is the specification
          of the 'format string' used by the SORTPRINT function. If you
          have access to a C Programming book, you will find the format
          specifications under the PRINTF() function description. Short of
          that, a summary of the types of format specifiers follows:
          A format specifier is formed as follows:
               % [width] [.prec] [type]
          The [width] is the minimum number of characters to print.
          The [.prec] is the maximum number of characters to print or the
          minimum number of digits to print.
          [type] is one of three values:
          'ld' for INTEGER values (result of INT() function)
          'f'  for REAL numbers (most results)
          's'  for a STRING CONSTANT (like TICKER or DATE)
          So, to print the results of the SORTOUT request given above,
          there must be five format specifiers (since there are five
          parameters to SORTOUT). The first parameter is the TICKER (which
          is a 'string') so its format specifier would simply be '%s'.
          The next three fields are all 'real' numbers (that is, they have
          decimal points), so their format could be '%7.3f' which would
          say, make the field 7 characters wide, and include three decimal
          places, like this '999.999', so this will work fine unless the
          price is greater than 1000. If it were, you could make the field
          '%8.3f' to add more room at the left.
          Finally, the last field, V (VOLUME) does not contain any portion
          beyond the decimal point. That is, shares are reported in whole
          numbers. But, because Volume is typically larger than the maximum
          value of an "integer" field (32,767) , it is also a 'REAL'
          number. To make the volume field report in whole units, without a


                                        21-48





                                                             Sort Functions
          decimal point, you would say '%8.0f' which would place volume in
          an eight character field with no decimal.
          So, the format string for the SORTPRINT would be:
          SORTPRINT('%s %7.2f %7.2f %7.2f %8.0f\n');
          The '\n' at the end of the SORTPRINT format string is to start a
          NEW LINE after printing this line.


          21.1.7 SortSetBuf        Set the current sort buffer


          Usage:         SORTSETBUF( bufferNumber )
          Returns:  None
          Description : 
          This function sets the buffer to be used by the next SortOut,
          SortPrint, SortGet, and SortOn operation.
          Example:
            This example shows the SortSetBuf used to swap back and forth
            between two different sort buffers. The first buffer will be
            ticker symbol and price, the second will be ticker symbol and
            21 day EMA. At the end of the ticker list, both lists will be
            printed in descending order of price then EMA value.

            S1 = SortAlloc();    // buffer 1 for prices
            S2 = SortAlloc();    // buffer 2 for moving averages
            SortSetBuf(S1);
            SortOut(Ticker,C);
            SortSetBuf(S2);
            SortOut(Ticker,EMA(C,20));
            Epilog Begin
               SortSetBuf(S1);
               SortOn(2,'D');   // sort descending by price
               SortPrint(`%-16s %7.3f\n');
               SortSetBuf(S2);
               SortOn(2,'D');   // sort descending by 20 day EMA
               SortPrint(`%-16s %7.3f\n');
            End;


















                                        21-49





                                                           String Functions

          22. String Functions


          22.1.1 Expand       Expand formatted string


          Usage:         EXPAND( format_string,v1,v2,....,vN )
          Returns:  String
          Description : 
          The expand function will "expand" the variables v1,v2,...vN
          according to the format specification given by the format_string.
          The function returns a string variable which can be printed, or
          displayed, just as the format function does.

          Example:
            Suppose the current close for IBM is 48.75, the high is 52.375.
            To print the close, the high and the 21 day Moving Average
            (without decimal point), you could say
            WriteLn(Expand('%s %7.2f %7.2f %5.0f',
            Ticker,
            Close,
            High,
            Mov(Close,21,'S')));
            which will print
            IBM    48.75   52.38  49
            See the description of Format Specifiers for a description of
            the format_strings you can use.


          22.1.2 FindStr      Find substring


          Usage:         FINDSTR( s1,s2 )
          Returns:  Number
          Description : 
          The findstr function will return the location of string s2 in
          string s1. If the string s2 is not found in s1, the result is 0.

          Example:
            I = FINDSTR(`abcdef','def');
            will place the number4 in the variable "I ", since the string
            "def " occurs in the 4th character position of the first
            string.


          22.1.3 Format       Format a number


          Usage:         FORMAT( Number,Format )
          Returns:  String
          Description : 



                                        22-50





                                                           String Functions
          The FORMAT function can be used to precisely control the way
          numbers print. This function takes two arguments. The first
          argument is the number to be formatted. The second argument is a
          "format specifier" string.

          Example:
            X = FORMAT(CLOSE OF TODAY,'%8.4f');
            will assign the string containing the current bar's close (
            formatted in an 8 character field with 4 decimal points) to the
            variable "X ".


          22.1.4 ParseString       Parse a comma separated string


          Usage:         PARSESTRING( s,v1,...,vN )
          Returns:  Integer
          Description : 
          ParseString will tokenize (break into pieces) the contents of the
          string s and place values found in the string into variables
          v1,...vN, matching them by the types of the variables.
          The function returns the number of fields successfully parsed.
          The types of each of the variables v1 to vN must match the type
          of the comma separated value found in the string s. You must
          predeclare the variables prior to using them in this function.
          Note: The AGet function is equivalent to doing an AGetLn function
          followed by a ParseString function.
          .
          Example:
            Given a string that contains the following contents:
            `11/20/94   84.33  "Price Value "'
            suppose this string is in the STRING variable MySTR.  The
            following example shows how you could "parse " the values from
            this string into individual variables.

            MyDate is a DATE;
            MyPrice is a NUMBER;
            MyComment is a STRING;
            NUM = ParseString(MyStr,MyDate,MyPrice,MyComment);
            If NUM = 3 THEN // All fields parsed
                 WriteLn(MyDate,MyPrice,' `,MyComments);
            should print
            942011.0  84.33  Price Value
            indicating that the variables were processed correctly.

          22.1.5 StrLen       String Length


          Usage:         STRLEN( s )
          Returns:  Integer
          Description : 
          The strlen function will return the length of the string variable
          "s" as an integer.


                                        22-51





                                                           String Functions

          Example:
            X = strlen('IBM');
            will set X to 3.

          22.1.6 StrRep       String Replace


          Usage:         STRREP( s1,s2,n )
          Returns:  String
          Description : 
          will return a string whose n'th position is replaced in s1 by s2
          for a length equal to the length of s2.

          Example:
            a = 'abcdef';
            x = strrep(a,'gh',2);
            writeln(x);
            would print  'aghdef'


          22.1.7 Substr       Substring function


          Usage:         SUBSTR( s,b,l )
          Returns:  String
          Description : 
          The substr function takes a string "s" as the first argument and
          extracts the substring starting at character position 'b" for the
          length "l".

          Example:
            X = substr('ABCDEF', 2,4)
            will create set the variable X to the string 'BCDE'.


          22.1.8 Trim         Trim blanks from a string


          Usage:         TRIM(  )
          Returns:  String
          Description : 
          This function takes a string variable as input and returns a
          string variable as the return value. The returned string variable
          has all spaces removed from the right hand portion.

          Example:
            X = 'C          `;  // X is `C' followed by 9 spaces
            Writeln(X,TRIM(X));
            results in
            `C         C' being written.




                                        22-52





                                               Technical Analysis Functions

          23. Technical Analysis Functions


          23.1.1 AD      Accumulation/Distribution


          Usage:         AD(  )
          Returns:  Array
          Description : 
          The Accumulation/Distribution indicator, developed by Marc
          Chaikin, calculates the percent range a stock moves in a given
          day and multiplies this times the volume.  The relationship of
          the close is
           (Close - Low) - (High - Close).
          This is then divided by the range (High - Low) and multiplied by
          the volume.  The result is added to the running total.  The
          buying pressure is compared to selling pressure for each day and
          like the OBV the indicator is cumulative.
          The A/D line is analyzed much like the OBV.  If a stock is going
          to rise then there should be volume behind it. This volume is
          measured by the degree the close is closer to the high of the
          day.  If there is buying pressure then the percent of the close
          times the volume will be greater.  This adds more to the A/D line
          and divergences may be detected before the price has actually
          risen to a great extent.

          Example:
            {A/D Volume Line for one year of data}
             #Max_Quotes 265
             OpenGraph(3,-264,0);
             SizeGraph(3,1,3);
             Graph(1,'PRICE');
             Graph(v,'VOLUME');
             Graph(ad(),
            'ACCUMULATION DISTRIBUTION LINE',
            mov(ad(),30,'s'),'30 DMA');
             CloseGraph();

            References:  Chaikin, Marc. 177 E. 77th Street, New York, NY
            10021


          23.1.2 ADX          Average Directional Movement


          Usage:         ADX( Period )
          Returns:  Array
          Description : 
          The Average Directional Movement (ADX) indicator is the
          exponentially-smoothed Directional Movement Index (DMI) over p
          periods.



                                        23-53





                                               Technical Analysis Functions


          23.1.3 ADXR         Average Directional Movement Rating


          Usage:         ADXR( Period )
          Returns:  Array
          Description : 
          Each element [i] of the array returned by the ADXR function is
          the exponential moving average of ADX over p periods relative to
          ADX[i], and ranges between 0 and 100.  ADXR provides a measure of
          directionality of a security.



          23.1.4 Alpha        Alpha function


          Usage:         ALPHA(  )
          Returns:  Number
          Description : 
          The alpha function is a "sister" function of the beta function.
          This function describes how much the stock's price would have
          moved on average on a yearly basis assuming the INDEX did not
          change. An alpha  of .20 means that the stock would have
          increased  20% more than the INDEX during the year.
          In terms of a two way linear regression (performed by the beta
          function), the alpha is  related to the y-intercept of the linear
          regression line.
          It is important to note that the alpha function must be called
          immediately after the beta function. At any other time, the re-
          sults of the alpha  function are undefined.

          Example:
            #INDEX `SP-500' using 2 years of data:
            #MAX_QUOTES 520 520
            Bvalue : ARRAY;
            Avalue : ARRAY;
            FOR EACH POINT STARTING at 260
            BEGIN
               Bvalue = BETA(`W');
               Avalue = ALPHA();
            END;
            OpenGraph(3);
            Graph(HLC,'Price action');
            Graph(Bvalue,'Weekly Beta');
            Graph(Avalue,'Weekly Alpha value');
            CloseGraph();

            This FOR EACH POINT loop starts at entry 260, since the beta
            function should have 52 prior weeks to be accurate on a yearly
            basis.



                                        23-54





                                               Technical Analysis Functions
          23.1.5 Angle        Angle of a line


          Usage:         ANGLE( a )
          Returns:  Number
          Description : 
          returns the angle in degrees of the line described by the array
          'a'. This function is only usable on an array that has been
          created by either linreg or linreg2.
          Do not confuse the angle returned by this function with the angle
          as viewed on a chart of a security. When you view a chart, your
          charting program most likely has scaled your view so that the
          zero y-axis is not visible. In addition, the angle on a screen
          monitor is distorted by the aspect ratio of your monitor
          (typically 4 wide by 3 high). The angle returned by this function
          is a true mathematical angle which is calculated using the (0,0)
          origin.

          Example:
            X = ANGLE(LINREG(C,-20,0));
            WriteLn(`Angle over last 20 close bars is `,X,' degrees');

            This computes the angle in degrees of the simple linear
            regression line of the closing price over the last 20 days.

          23.1.6 AvgPrc       Average Price


          Usage:         AVGPRC(  )
          Returns:  Array
          Description : 
          Creates an array where each entry is that day's
          (HIGH+LOW+CLOSE)/3



          23.1.7 BBandB       Bottom Bollinger Band


          Usage:         BBANDB( p,s )
          Returns:  Array
          Description : 
          Bollinger Band lower (bottom) indicator for "p" periods with "s"
          standard deviations subtracted from the p-day simple moving
          average.

          Example:








                                        23-55





                                               Technical Analysis Functions
            Opengraph(1);
            Graph(HLC,'Price',BBandT(21,2),BBandB(21,2));
            CloseGraph();
            would graph the closing price with two 21 day Bollinger Bands
            separated by 2 standard deviations from the closing price
            (above and below).

          23.1.8 BBandT       Top Bollinger Band


          Usage:         BBANDT( p,s )
          Returns:  Array
          Description : 
          Bollinger Band upper (top) indicator for "p" periods with "s"
          standard deviations added to the p-day simple moving average.

          Example:
            See BBandB example.

          23.1.9 Beta         "Beta" function


          Usage:         BETA( r )
          Returns:  Number
          Description : 
          The beta function calculates the linear regression of the
          percentage rate of change of the closing price (of the current
          ticker being processed) to the percentage rate of change of the
          INDEX.
          Values of r, the rate of change period, are
               'D'  Daily rate of change
               'W'  Weekly rate of change
               'M'  Monthly rate of change
          The weekly rate of change calculates the rate of change from
          Friday to Friday and the monthly rate of change calculates the
          rate of change from the first of each month.
          The actual value returned by the beta function is the slope of
          the line created by this two way linear regression.
          The purpose of the beta function is to measure the stock's sen-
          sitivity to movement in the general market over the period of
          time chosen. A beta value of 2.00 means that the stock tends to
          move with the market, but 2 times as far (percentage change is
          twice as much). A beta of -.5 means that the stock moves in the
          opposite direction of the market, but only one half as far.

          Example:









                                        23-56





                                               Technical Analysis Functions
            #INDEX `SP-500'
            Bvalue = BETA(`W');
            computes the beta value for a weekly rate of change.

            To compute a beta over time so it can be graphed, you could do
            the following:
            #INDEX `SP-500' using 2 years of data:
            #MAX_QUOTES 520 520
            Bvalue : ARRAY;
            FOR EACH POINT STARTING at 260
               Bvalue = BETA(`W');
            OpenGraph(2);
            Graph(HLC,'Price action');
            Graph(Bvalue,'Weekly Beta');
            CloseGraph();

            This FOR EACH POINT loop starts at entry 260, since the beta
            function should have 52 prior weeks to be accurate on a yearly
            basis.

          23.1.10 CCI         Commodity Channel Index Array


          Usage:         CCI( Period1 )
          Returns:  Array
          Description : 
          Period1 = number of periods in the CCI calculation as shown
          below.
          The CCI is a price momentum indicator that works well for
          commodities, stocks, and mutual funds.
          Mathematically,
          CCI[i] = (M - A)/(X * D) percent
          where:
          M  =Mean price of current-day sample period.
          A  =p-period simple moving average of M.
          D  =Mean deviation of absolute values of the numerator over p
          periods.
          X  =An adjusting factor, 0.15, which normalizes the excursions to
          a trading range of +/- 100.
          The CCI is a sort of "noise" filter, for which the random
          fluctuations should fall inside the +/- 100 percent range.
          Excursions outside this range tend to be nonrandom and indicate
          trading opportunities.  Suggested trading rules are:
          1.   Buy long when CCI goes above +100%.
          2.   Sell long when CCI subsequently returns below 100%.
          3.   Sell short when CCI goes below -100%.
          4.   Cover shorts when CCI subsequently returns above -100%.
          Selection of a large number of periods (p) will filter out much
          of the noise, but can mask trading opportunities and trends.  A
          smaller number of periods can create false signals.  90 and 53
          weeks as tentative starting periods for your analysis are sug-
          gested.



                                        23-57





                                               Technical Analysis Functions
          Another way of using the CCI is to note when the security being
          analyzed rises dramatically, but the rise is not reflected by the
          overall momentum represented by the CCI.  Such a divergence is
          usually followed by a price correction for the security.


          23.1.11 CO          Chaikin's Oscillator


          Usage:         CO(  )
          Returns:  Array
          Description : 
          Chaikin's Oscillator can be used to detect trend changes by
          watching short-term movement.  An oscillator establishes a
          baseline using relatively longer-term data, and then measures
          fluctuations of the shorter-term data about this baseline.
          Chaikin's Oscillator uses volume accumulation data and is ob-
          tained by subtracting the 10-day exponential moving average of
          the Accumulation/ Distribution (AD) function line from the 3-day
          exponential moving average of the same function line.
          f you want to try different long-term and short-term periods, you
          can construct your own equivalent function using the MOV and AD
          functions.

          Because short-term movements tend to be erratic, use of such
          indicators should be only part of the your overall trading strat-
          egy.


          23.1.12 CorrCoef         Correlation Coefficient


          Usage:         CORRCOEF(  )
          Returns:  Number
          Description : 
          returns the "correlation coefficient" of the last linear regres-
          sion performed. This value ranges from -100 to +100. If the data
          points match the points in the linear regression approximation,
          the correlation coefficient will be 100. If the points show no
          correlation with the approximation, the correlation coefficient
          will be zero.



          23.1.13 DMI         Directional Movement Index


          Usage:         DMI( Period1 )
          Returns:  Array
          Description : 
          The DMI and its derivative indicators can reveal when the market
          trends are significant enough to warrant entry into trades.



                                        23-58





                                               Technical Analysis Functions
          Two other DMI-related indicators typically used in making trading
          decisions are the plus and minus directional indicators (PDI and
          MDI, respectively).

               DMI = (PDI - MDI) / (PDI + MDI)

          Please refer to the PDI and MDI descriptions for definitions of
          these functions.

          A typical trading-rule set is:
          1.   Enter trade only when ADX is rising.
          2.   Buy when PDI crosses above MDI.
          3.   Sell when PDI crosses below MDI, or when ADX turns  lower.
          4.   Enter a short sale trade when ADX is rising and PDI crosses 
               below MDI.
          5.   Cover (or close out) a short sale trade when PDI crosses
          above MDI or ADX turns lower.



          23.1.14 DPO         Detrended Price Oscillator


          Usage:         DPO( Period1 )
          Returns:  Array
          Description : 
          The Detrended Price Oscillator is the difference between the
          Closing price and a Period1 length simple moving average shifted
          back one half the period length (specifically Period1/2+1 data
          points). The last Period1/2+1 data points are undefined, as are
          the first data points ((Period1-1)/2 length).


          23.1.15 EMA         Exponential Moving Average


          Usage:         EMA( a,p )
          Returns:  Array
          Description : 
          Calculates an exponential moving average of the contents of the
          array a with the period p.
          Note that this is simply a shorthand version of the mov()
          function.



          23.1.16 EMV         Arm's Ease of Movement


          Usage:         EMV( Period1, MaType )
          Returns:  Array
          Description : 
          The Arm's Ease of Movement is calculated as follows:


                                        23-59





                                               Technical Analysis Functions
          EMV = (((H+L)/2)-(ref(H+L,-1)/2))/((V/10000)/(H-L))
          Because the EMV fluctuates so rapidly, a moving average is built-
          in to the function. The moving average length is the first
          parameter, Period1, and the moving average type is the second
          parameter, MaType, surrounded by single quotes.
          Example:
            OpenGraph(1);
            Graph(EMV(14,'S'),'EMV with 14 day SMA smoothing');
            CloseGraph();

          23.1.17 FFT         Fast Fourier Transform


          Usage:         FFT( Array1 )
          Returns:  Array
          Description : 
          FFT(Array1) "Fast Fourier Transform" function to calculate the
          detrended power spectrum of the array Array1. The detrended power
          spectrum is an array [1..n] where the value of each entry is the
          amplitude of the power at the i/n'th frequency. This is
          essentially equivalent to the 'raw' power spectrum shown by
          MetaStock 3.5 and later FFT indicator.
          Example:
            Array X = FFT(CLOSE);
            would place the detrended power spectrum in array X.

          23.1.18 FFTCycle         Cycle via Fast Fourier Transform


          Usage:         FFTCYCLE( Array1 )
          Returns:  Array
          Description : 
          FFTCycle performs a detrended FFT on array Array1 and then
          creates an array containing cycles found in order from most
          dominant to least dominant.
          The 0th entry of the result array contains the dominant cycle. If
          the dominent cycle length is longer than the number of data
          points in the array, no cycle was found.
          Example:
            Array X = FFTCycle(CLOSE);
            IF X[0] < QUOTE_COUNT THEN
                Writeln(`Dominant cycle is `,X[0]);
            ELSE
                WriteLn(`No dominant cycle found');

          23.1.19 HHV         Highest High Value


          Usage:         HHV( Array1,Period1 )
          Returns:  Array
          Description : 
          Returns Highest High Value in Array1 over the  period Period1.
          The first Period1 values of the result are zero.


                                        23-60





                                               Technical Analysis Functions



          23.1.20 IfDn        One if Down


          Usage:         IFDN( a,p )
          Returns:  Array
          Description : 
          This function returns an array containing a one in every position
          in which the array "a" is down from its value "p" periods in the
          past, and a zero in every other position.

          Example:
            The statements
            x : array;
            x = ifdn(c,1);
            is equivalent to the following:
            x : array;
            For Each Point starting at p+1
            if c[0] < c[-p] then
               x[0] = 1;
            else x[0] = 0;

            Additionally,
            Array X = IFDN(C,2);
            would place 1's in each element of the array X where the CLOSE
            was down from its value two bars prior, and a zero elsewhere.

          23.1.21 IFF         If Function


          Usage:         IFF( Condition, TrueValue,FalseValue )
          Returns:  Number
          Description : 
          The IFF function evaluates Condition and returns the result
          TrueValue if the Condition is TRUE, and FalseValue if the
          Condition is FALSE.
          Example:
            X : ARRAY;
            FOR EACH POINT STARTING AT 10
               X = IFF(OVER(CLOSE,SMA(C,10)) = 0,1,0);
            would fill in the array X with a 1 on each day that the CLOSE
            price crossed over the 10 bar Simple Moving Average of the
            CLOSE.

          23.1.22 IFFA        If Function for Arrays


          Usage:         IFFA( Array1,Relation,Array2, TrueValue,FalseValue
          )
          Returns:  Array
          Description : 


                                        23-61





                                               Technical Analysis Functions
          The IFFA function evaluates Array1 Relation Array2  and sets the
          result array entry to TrueValue if the Condition is TRUE, and
          FalseValue if the Condition is FALSE.
          Example:
            Array X = IFFA(C,'>`,REF(C,-1),1,0);
            would create an array X containing a 1 in each position where
            the CLOSE was greater than the prior bar's CLOSE and 0
            elsewhere.


          23.1.23 IfUp        One if Up


          Usage:         IFUP( Array1, Period1 )
          Returns:  Array
          Description : 
          This function returns an array containing a one in every position
          in which the array Array1 is up from its value Period1 periods in
          the past, and a zero in every other position.


          Example:
            The statements
            x : array;
            x = ifup(c,1);
            is equivalent to the following:
            x : array;
            For Each Point starting at p+1
            if c[0] > c[-p] then
               x[0] = 1;
            else x[0] = 0;

            Additionally,
            Array X = IFDN(C,2);
            would place 1's in each element of the array X where the CLOSE
            was down from its value two bars prior, and a zero elsewhere.

          23.1.24 Isect       Find array intersection


          Usage:         ISECT( Array1, Array2 )
          Returns:  Integer
          Description : 
          Find the latest intersecting point of the two arrays Array1 and
          Array2. Returns the number of days since the two arrays
          intersected (as a negative number) or 1 (positive one) if they
          have never intersected.
          NOTE:
          Since the graph of the two arrays actually crosses BETWEEN two
          days, the value returned will be the later day AFTER the
          crossing. For example, if the arrays crossed between yesterday
          and today, the value returned will be zero. If they crossed



                                        23-62





                                               Technical Analysis Functions
          between two days ago and yesterday, the value returned will be -
          1, and so forth.

          Example:
            IF ISECT(C,SMA(C,21)) = 0 THEN
              WRITELN(`Close and 21 DAY SMA Crossed today');

            Note that you don't know if the CLOSE crossed above or below
            the 21 day SMA, since this function only indicates that they
            crossed. To check whether one crossed above or below the other,
            use either the OVER function or the CROSSED [Above/Below]
            operator.

          23.1.25 LinReg      Linear Regression


          Usage:         LINREG( a,s,e   )
          Returns:  Array
          Description : 
          Create a linear regression line using "least-squares" method to
          find the mathematical average of the values in the array "a"
          starting at entry "s" and ending at entry "e". If "s" is zero, it
          refers to the first value in the array. If "e" is zero, it refers
          to the last value in the array. Positive values for "s" or "e"
          refer to the appropriate array entries (counting from 0).
          A negative number in the "s" or "e" index is subtracted from the
          total number of entries in the array to get the appropriate posi-
          tive array index.

          Example:
            Array X = linreg(c,-50,-10);
            will find the line passing most closely through the closing
            prices from 50 days before the last day in the file to 10 days
            before the last day in the file.


          23.1.26 LinReg2          Two Way Linear Regression


          Usage:         LINREG2( y,x,s,e )
          Returns:  Array
          Description : 
          Create a linear regression line using "least-squares" method to
          find the mathematical  average of the values in the array y over
          the array x starting at entry "s" and ending at entry "e". If "s"
          is zero, it refers to the first value in the array. If "e" is
          zero, it refers to the last value in the array. Positive values
          for "s" or "e" refer to the appropriate array entries (counting
          from 0).
               A negative number in the "s" or "e" index is subtracted from
          the total number of entries in the array to get the appropriate
          positive array index.



                                        23-63





                                               Technical Analysis Functions
          Example:
            Array X = linreg2(c,Load(`SP-500','C'),-50,-10);
            will find the line passing most closely through the closing
            prices and the SP-500 closing prices from 50 days before the
            last day in the file to 10 days before the last day in the
            file.


          23.1.27 LLV         Lowest Low Value


          Usage:         LLV( Array1,Period1 )
          Returns:  Array
          Description : 
          Returns Lowest Low Value in the array Array1 over the period
          Period1
          The first Period1 values of the result are zero.

          Example:
            To find the lowest value of the CLOSE prior to the current
            day's value, you can do the following:
            PriorLow = LLV(C,QUOTE_COUNT-1)[-1];



          23.1.28 MACD        Moving Average Convergence/Divergence


          Usage:         MACD(  )
          Returns:  Array
          Description : 
          The MACD (Moving Average Convergence Divergence) indicator was
          developed by Gerald Appel.  It is a price momentum oscillator
          representing the point spread difference between fast and slow
          exponential moving averages of the closing price, approximately
          equal to:
          macd() = mov(C,12,E) - mov(C,26,E)
          If MACD is displayed graphically, a trigger line,
          mov(macd(),9,E), will also be displayed.
          A simple application is to buy or sell when the MACD passes
          through the trigger line.  However, for this function to be
          effective, more complex decision rules generally will be
          required.
          macd() approximately equals macdx(12,26,9).



          23.1.29 MacdX       MACD Extended


          Usage:         MACDX( s,l,t )
          Returns:  Array
          Description : 


                                        23-64





                                               Technical Analysis Functions
          The MACDX function allows you to specify the short, long and
          trigger periods, rather than using the canned values in the MACD
          function.
          It computes an MACD indicator using a short term EMA of "s"
          periods, a long term EMA of "l" periods, and a trigger line of
          "t" periods.



          23.1.30 MASS        "Mass " Index


          Usage:         MASS( Period1 )
          Returns:  Array
          Description : 
          MASS(Period1)  "Mass Index" function for  Period1 periods.
          Computed as follows:
          MASS(Period1) = sum(mov(h-l),9,'e')/mov(mov(((h-
          l),9,'e'),9,'e'),Period1)



          23.1.31 MDI         Minus Directional Movement (-DI)


          Usage:         MDI( Period1 )
          Returns:  Array
          Description : 
          This function is part of the "DMI family" of functions.  It
          enters into the DMI and ADX function calculations, and is used
          with the trading decision rules presented above in the DMI
          function description.
          MDI = SMDM/STR
          where:
          SMDM = Smoothed Minus Directional Movement
          STR = Smoothed Wilder's True Range.

          Minus Directional Movement (MDM) is the largest part of the
          current period's price range that is outside the previous
          period's price range.



          23.1.32 MFI         Money Flow Index


          Usage:         MFI( Period1 )
          Returns:  Array
          Description : 
          The Money Flow Index is an indicator similar to the RSI, but it
          includes volume. The MFI was described in the March 1989,
          Technical Analysis of Stocks and Commodities magazine in an
          article "Money Flow Index " by Quong and Soudack.


                                        23-65





                                               Technical Analysis Functions
          It is computed as follows:
          VU = Period1 bar average of up average price * volume
          VD = Period1 bar average of down average price * volume
          MFI = 100 - (100/(1+VU/VD))




          23.1.33 MO          Price Momentum


          Usage:         MO( Period1 )
          Returns:  Array
          Description : 
          This function provides the price momentum expressed as a ratio.
          Each element of the returned array represents the ratio of the
          closing price for that day to the closing price Period1 days
          before.:
               mo[i] = C[i]/C[i-Period1]
          Thus, MO indicates the velocity or rate of change of a security's
          price. ROC is a similar function except that ROC expresses the
          momentum as percentage or dollars (selectable).


          23.1.34 MOV         Moving Average


          Usage:         MOV( Array1,Period1,Type )
          Returns:  Array
          Description : 
          Compute a "moving average" of the elements in Array1, over the
          period in "Period1", of the type specified by "Type"
          Array1 = Moving Average Array
          Type = Moving Average Type
                    'E' - Exponential
                    'S' - Simple
                    'W' - Weighted
                    'TRI' - Triangular
          Each element [i] of the returned array represents a computation
          that uses data from "Period1" elements of Array1  relative to
          element [i].  Thus, if Period1 represents days, the average moves
          along with each day represented by the returned array.  For
          example, the 10-day moving average for 5 days ago uses data from
          14 days ago to 5 days ago, inclusive.  The specific value for
          each element in the returned array (using the same data) depends
          on the moving average type selected using the "t" parameter:
          S - for Simple Moving Average.  Each element in the simple moving
          average is the sum of the elements for Period1 periods, divided
          by Period1.

          Although the simple moving agerage has its uses, most analysts
          prefer to "smooth" the input data.  This is based on the premise
          that older data entering into the calculation for days remote


                                        23-66





                                               Technical Analysis Functions
          from a particular day (the "current day") should have less impact
          than newer data for days nearer the current day.  Smoothing is
          performed by multiplying the data elements by a variable scaling
          factor.  The two scaling factors commonly in use are the simple
          weight and the exponential:
          W - for Weighted Moving Average.  The scaling factor is equal to
          the number of days from the beginning of the period.  The
          multiplication products are summed, and the weighted average is
          determined by dividing this sum by the sum of the scale factors
          (the multipliers).
          E - for Exponential Moving Average.  The scaling factor is
          obtained by converting the period "p" to a percentage, applying
          this percentage to the argument array's current day value,
          applying the remaining percentage to the previous day's
          exponential moving average value, and summing the two products.
          The cumulative effect of repeatedly applying a scaling factor to
          older data is to "exponentially" reduce the older data while
          never actually losing it entirely.
          Current Day Factor (CDF) = 2 / (p + 1)
          Previous Day Factor (PDF) = 1 - CDF
          and
          Return Array[i] = (Argument Array[i] * CDF) +
                              (Return Array[i-1] * PDF)
          TRI  - for Triangular Moving Average. This moving average is
          weighted to the middle of the moving average period  as shown by
          the equations below:

          mid = Int((Period1+1)/2)
          mov1 = SMA(Array1,mid)
          If Period1 is even, add one to mid
          TMA = SMA(mov1,mid)

          Because these moving average functions are used so frequently,
          there are shorthand forms for the exponential, simple and
          triangular moving averages, EMA, SMA, and TMA respectively.
          Example:
            ShortMovingAverage : Array
            ShortMovingAverage = MOV(Close,12,'E');


          23.1.35 NVI         Negative Volume Index


          Usage:         NVI(  )
          Returns:  Array
          Description : 
          The Negative Volume Index (NVI) is used in an attempt to detect
          days when "smart" investors are active.  Some analysts believe
          that the smart investors avoid trading in high-volume periods,
          and do their buying and selling during quiet periods of declining
          volume.
          The NVI is a cumulative indicator that can change only when the
          volume decreases.  The amount accumulated for each (declining)


                                        23-67





                                               Technical Analysis Functions
          period is equal to the percent change of a security's price
          multiplied by the previous period's NVI:

          if V[i] < V[i-1] then
               NVI[i] = NVI[i-1] + ( ((C[i] -C[i-1])/C[i-1]) * NVI[i-1])

          if V[i] >= V[i-1] then
               NVI[i] = NVI[i-



          23.1.36 OBV         On Balance Volume


          Usage:         OBV(  )
          Returns:  Array
          Description : 
          On balance volume uses the change of the close plus volume to
          determine how much buying or selling pressure there is in a
          stock.  If the close is higher than yesterday then the volume is
          added to yesterdays OBV.  If the stock closes lower than yester-
          day the volume is subtracted from the OBV indicator.  Because
          this indicator keeps a running total it can reveal the accumula-
          tion or distribution of a stock.  This can show early interest in
          a stock or an eventual sell off.
          OBV can be analyzed several ways.  A simple moving average of the
          OBV can be used to watch for breakouts.  For more intense study,
          the patterns the indicator makes can be compared to the stock for
          divergences, higher highs, or lower lows.  These patterns may
          suggest activity not seen in just in the price chart.
          References:  Granville, Joseph E.  New Strategy of Daily Stock
          Market Timing for Maximum Profit.  Englewood Cliffs NJ:
          Prentice_Hall, 1976.

          Example:
            An example of computing and graphing On Balance Volume for one
            year of data
             #max_quotes 265
             opengraph(3,-264,0);
             sizegraph(3,1,3);
             graph(1,'PRICE');
             graph(v,'VOLUME');
             graph(obv(),'ON BALANCE VOLUME',
               mov(obv(),30,'s'),'30 DMA');
             closegraph();


          23.1.37 OSCP        Price Oscillator


          Usage:         OSCP( Period1,Period2,MaType,RoCType )
          Returns:  Array
          Description : 


                                        23-68





                                               Technical Analysis Functions
          Price Oscillator formed by subtracting a  Type Period2 bar moving
          average of the Closing Price from a Type Period1 bar moving
          average of the Closing Price.
          Period1 = shorter moving average period
          Period2 = longer moving average period
          MaType = Moving Average Type
               'E' - Exponential
               'S' - Simple
               'W' - Weighted
               'TRI' - Triangular
          RoCType= ROC Type
               '%' - percentage ROC
               '$' - Unit ROC

          Example:
            Array X = OSCP(5,21,'S','%');
            is equivalent to
            Array X = ((SMA(C,5)-SMA(C,21))/(SMA(C,21))) * 100;
            while
            Array X = OSCP(5,21,'S','$');
            is equivalent to
            Array X = SMA(C,5) - SMA(C,21);

          23.1.38 OSCV        Volume Oscillator


          Usage:         OSCV( Period1,Period2,MAType,RoCType )
          Returns:  Array
          Description : 
          Volume Oscillator formed by subtracting a  Type Period2 bar
          moving average of the Volume from a Type Period1 bar moving
          average of the Volume.  This function creates an oscillator from
          two moving averages.
          Period1 = shorter moving average period
          Period2 = longer moving average period
          MAType = Moving Average Type
               'E' - Exponential
               'S' - Simple
               'W' - Weighted
               'TRI' - Triangular
          RoCType= ROC Type
               '%' - percentage ROC
               '$' - Unit ROC

          Example:
            Array X = OSCV(5,21,'S','%');
            is equivalent to
            Array X = ((SMA(V,5)-SMA(V,21))/(SMA(V,21))) * 100;
            while
            Array X = OSCV(5,21,'S','$');
            is equivalent to
            Array X = SMA(V,5) - SMA(V,21);



                                        23-69





                                               Technical Analysis Functions
          23.1.39 Over        Over function


          Usage:         OVER( Array1,Array2 )
          Returns:  Integer
          Description : 
          If Array1  is "over" Array2, this function returns the number of
          days since Array1  crossed above(or over) Array2.  See the
          description of the ISECT function page Error! Bookmark not
          defined. for the values returned when the arrays cross.

          Example:
            This function is especially useful to test for a crossover
            situation. If you want to know if the close just crossed
            "over" the 21 day moving average of the close, you can say
            IF OVER(Close,Mov(Close,21,'E')) = 0 Then
            writeln('Close crossed EMA today');


          23.1.40 PDI         Positive Directional Movement (+DI)


          Usage:         PDI( Period1 )
          Returns:  Array
          Description : 
          This function is part of the "DMI family" of functions.  It
          enters into the DMI and ADX function calculations, and is used
          with the trading decision rules presented above in the DMI
          function description.
          PDI = SPDM/STR

               where:

               SPDM = Smoothed Plus Directional Movement
               STR = Smoothed Wilder's True Range.

          Plus Directional Movement (PDM) is the largest part of the
          current period's price range that is outside the previous
          period's price range.



          23.1.41 PER         Performance Indicator


          Usage:         PER(  )
          Returns:  Array
          Description : 
          The performance indicator is the change in percentage from the
          first closing  price  value loaded.
          Performance Indicator is computed as follows:




                                        23-70





                                               Technical Analysis Functions
                        a          o
                        c          /
               per[i] = cCLOSE[i]-1/ * 100
                        c          /
                        cCLOSE[1]  /
                        e          0



          23.1.42 PER1        Performance using Array


          Usage:         PER1( Array1 )
          Returns:  Array
          Description : 
          Computes the "performance indicator" for an array Array1. This
          indicator is different that the PER indicator, because it allows
          you to specify the array on which the indicator is calculated.
          The performance indicator is computed as
                    a      /
                    c      /
          per1(a) = ca[1]-1/ * 100
                    c      /
                    ca[0]  /
                    e      0
                           



          23.1.43 PVI         Positive Volume Indicator


          Usage:         PVI(  )
          Returns:  Array
          Description : 
          The Positive Volume Index (PVI) is the opposite of the Negative
          Volume Index (NVI).  It is used in an attempt to detect days when
          unsophisticated investors are active.

          The PVI is a cumulative indicator that can change only when the
          volume increases.  The amount accumulated for each (increasing)
          period is equal to the percent change of a security's price
          multiplied by the previous period's PVI:

          if V[i] > V[i-1] then
               PVI[i] = PVI[i-1] + (((C[i] -C[i-1])/C[i-1]) * PVI[i-1])


          if V[i] <= if V[i] <= V[i-1] then
               PVI[i] = PVI[i-1]





                                        23-71





                                               Technical Analysis Functions
          23.1.44 REF         Reference function


          Usage:         REF( Array1,Period1 )
          Returns:  Array
          Description : 
          This function is used to "shift" data array Array1  forward by
          Period1 data bars.
          This function is computed as follows:
          Array1[i] = Array1[i-Period1] for i = Period1 to N
          N = number of data points

          Example:
            If you wanted to compute the compute a unit rate of change over
            a ten day period, you could use the formula
            Array X  = CLOSE - REF(CLOSE,-10)

            to place this value into the array named X.

          23.1.45 ROC         Rate of Change


          Usage:         ROC( Array1,Period1,Type )
          Returns:  Array
          Description : 
          Computes the rate of change of the data array "Array1" over
          "Period1" periods, using either a percentage basis or a dollar
          unit basis.
               Array1 = Data Array
               Period1 = number of periods
               Type = ROC Type
                    '%' - percentage ROC
                    '$' - Unit ROC
          Each element [i] of the returned array equals the the rate of
          change of data array "d" over "p" periods relative to d[i], using
          either a percentage basis or a dollar unit basis.



          23.1.46 RSI         Wilder's Relative Strength


          Usage:         RSI( Period1 )
          Returns:  Array
          Description : 
          This indicator is credited to J. Welles Wilder.  The RSI function
          performs the following calculation:

               RSI = 100 - (100/(1+X))
          where X is the ratio of the exponentially-smoothed moving average
          of gains to the absolute value of the expentially smoothed moving
          average of losses, taken over "p" periods.



                                        23-72





                                               Technical Analysis Functions
          Thus, RSI is a price momentum indicator that is a function of
          changes in closing prices.

          Note This function is unrelated to relative strength indicators
          that compare price to the various market indicators.



          23.1.47 SAR         Parabolic Stop and Reverse


          Usage:         SAR( Incr,AF )
          Returns:  Array
          Description : 
          The Parabolic (or Stop and Reverse) indicator creates a parabolic
          stop line either over or under the price graph.
          where
                "Incr " = increment value and initial
                "AF " = maximum acceleration factor
          Wilder's explanation uses the values of  Incr = .02 and AF= 0.20



          23.1.48 SignMove         Find up/down moves


          Usage:         SIGNMOVE( array,period )
          Returns:  Array
          Description : 
          The SignMove function will place a 1 in the result array for each
          bar that is higher than it was period days ago, and a -1 for each
          bar that is lower than it was period days ago.A zero is placed in
          the result array for unchanged bars over the period.


          23.1.49 Slope       Slope of Line


          Usage:         SLOPE( a )
          Returns:  Number
          Description : 
          will return the mathematical "slope" of the line whose points are
          contained in array "a". This array must have been created with
          the linreg function.
          The slope m of a line is defined according to the following
          formula
               y = mx + b
               m = (y-b)/x
          The slope of a linear regression line is simply the average
          change in the y-value of the data array (e.g., price) divided by
          the number of price bars (e.g. "days") over which the change is
          calculated. A 5 point rise over 10 days would be a slope of 5/10
          or 0.50.


                                        23-73





                                               Technical Analysis Functions



          23.1.50 SMA         Simple Moving Average


          Usage:         SMA( Array1,Period1 )
          Returns:  Array
          Description : 
          Calculates a simple moving average of the contents of the array
          Array1  with the period Period1.
          Note that this is simply a shorthand version of the mov()
          function.



          23.1.51 STD         Standard Deviation


          Usage:         STD( Array1,Period1 )
          Returns:  Array
          Description : 
          Computes the standard deviation of the array Array1 using
          'Period1' data points. Defined as the square root of the variance
          (see VAR below).



          23.1.52 STOCH       Stochastic Oscillator


          Usage:         STOCH( Period1,Period2 )
          Returns:  Array
          Description : 
               Period1 = number of periods
               Period2 = k slowing periods
          STOCH is a moving price velocity or momentum indicator.  Each
          element of the returned array is defined as follows:

          Return_Array[i] = ( (Close[i] - LV[i])/(HV[i] - LV[i]) ) * 100
          where:

               LV[i] is the "Period2" period low at p[i]; i.e., LV =
          llv(p,s)
               HV[i] is the "Period2" period high at p[i]; i.e., HV =
          hhv(p,s)

          Since there is no built-in smoothing, this function tends to
          exhibit erratic behaviour as it drops-off old data and picks-up
          new data.  This can be reduced by application of the moving
          average function (MOV).  Also, sell and buy signals can be
          defined for first moving-average levels above and below a second
          moving-average line of the same function.


                                        23-74





                                               Technical Analysis Functions


          23.1.53 TMA         Triangular Moving Average


          Usage:         TMA( a,p )
          Returns:  Array
          Description : 
          Calculates a triangular moving average of the contents of the
          array a with the period p.
          Note that this is simply a shorthand version of the mov()
          function.



          23.1.54 TR          Wilder's True Range


          Usage:         TR(  )
          Returns:  Array
          Description : 
          This function creates an array containing for each day, the
          higher of the following differences :
          Between today's high and today's low.
          Between today's high and yesterday's close.
          Between today's low and yesterday's close.

          The value of tr() for any day is always positive or zero.



          23.1.55 TrendLine        Create a Trendline


          Usage:         TRENDLINE( a,s,e )
          Returns:  Array
          Description : 
          Generate a line going through the points in array a from the day
          index s to the day index e.

          Example:














                                        23-75





                                               Technical Analysis Functions
            Array X = TrendLine(C,-10,-2);
            creates a "line" that begins at and passes through the CLOSE 10
            days in the past and ends at the point two days in the past.

            If you wanted to create a trendline that rested on the two
            latest major price peaks , you could  use the ZIG function as
            follows:
            Array TL = Const(0);   // for the trendline
            Array Z = ZIG(C,5,'%');   // 5% moves only
            recentPeak = Peak(Z,1);   // Get recent peak
            penulPeak = Peak(Z,2);    // Get penultimate peak
            IF recentPeak < 0 AND penulPeak < 0 THEN
               // we have two peaks
               TL = TrendLine(C,penulPeak,recentPeak);


          23.1.56 TrendPar         Parallel Trendline


          Usage:         TRENDPAR( a,t,s )
          Returns:  Array
          Description : 
          TrendLine's sister function  TrendPar will draw a parallel line
          to trendline t, running through day s in array a.



          23.1.57 TRIX        Triple Exponential


          Usage:         TRIX( Period1 )
          Returns:  Array
          Description : 
          Calculate a 1 day percent Rate of Change of a Period 1 bar triple
          exponential moving average of the closing price.
          TRIX calculates a 1-bar percent rate of change of a Period1 bar
          triple exponential moving average of the closing price.

          Triple exponential smoothing essentially eliminates the influence
          of cycles shorter than Period1 periods.

          If a 9-bar (typical) moving average of the TRIX function were
          plotted along with the the TRIX function, buy would be indicated
          when TRIX moves above the moving average line, and sell would be
          indicated when TRIX moves below the line.
          Example:
            Array X = TRIX(14);
            is equivalent to
            Array X = ROC(EMA(EMA(EMA(C,14),14),14),1,'%');






                                        23-76





                                               Technical Analysis Functions
          23.1.58 TSF         Time-Series Forecast


          Usage:         TSF( Array1,Period1 )
          Returns:  Array
          Description : 
          This function computes a Period1 bar linear regression of the
          array Array1 for each bar.

          The TSF function uses a linear regression over the Period1 range
          to compute the next TSF value. By doing that,, it is performing
          (n-Period1) linear regressions (where n = number of data points
          in Array1). This process determines a "best fit " data point for
          the next value of the result.


          23.1.59 VAR         Statistical Variance


          Usage:         VAR( Array1,Period1 )
          Returns:  Array
          Description : 
          Computes Statistical Variance of the array Array1 over the time
          period Period1.
          Each element [i] of the returned array is the stastical variance
          of Period1 data points taken from Array1 starting at element [i].
          Variance indicates how widespread the values  of a data series
          are likely to be.
          Variance is derived as follows:
          1. Calculate the simple moving average of  data array Array1 for
          Period1 periods
               W = mov(Array1,Period1,'S').

          2. Determine the difference between Array1 and the simple moving
          average
               X = Array1-W

          3. Sum the squares of the preceeding, and divide by Array1
          Y = X*X
          Z = Sum(Y,Array1),
          Variance = Z/Array1.
          Note The square-root of the variance is the standard deviation
          (see STD function).


          23.1.60 VHF         Vertical/Horizontal Filter


          Usage:         VHF( Array1,Period1 )
          Returns:  Array
          Description : 
          The VHF function computes a ratio of the difference between the
          highest and lowest values of the Array1 over the Period1 bar


                                        23-77





                                               Technical Analysis Functions
          period to the sum of the absolute values of the one bar point
          rate of change for the period.

          Example:
            Array X = VHF(CLOSE,14);
            is equivalent to
            X = (HHV(CLOSE,14)-LLV(CLOSE,14))/SUM(ABS(ROC(CLOSE,1,'$')),14)

          23.1.61 VMA         Variable Moving Average


          Usage:         VMA( a,p )
          Returns:  Array
          Description : 
          VMA(a,p) "Variable Moving Average" of array "a" for period "p".
          The VMA is calculated by using a 28 day VHF as the volatility
          measure. The "volatility ratio" VR = VHF(28)/REF(VHF(28),-12).
          The VMA is  calculated as VMA[i+1] = "array a"[i+1] * VR * alpha
          + (1-alpha) VMA[i] where alpha is the period smoothing factor =
          2/(p+1).


          23.1.62 VOL         Chaikin's Volatility


          Usage:         VOL( PeriodM,PeriodR )
          Returns:  Array
          Description : 
          This is the PeriodR bar Rate Of Change Oscillator of a PeriodM
          bar exponential Moving Average of the difference between each
          bar's high and low price.
          Example:
            Array X = VOL(5,14);
            is equivalent to
            Array X = ROC(EMA(HIGH-LOW,5),14,'%');

          23.1.63 WC          Weighted Close


          Usage:         WC(  )
          Returns:  Array
          Description : 
          defined as (2 * CLOSE + HIGH + LOW)/4
          Example:
            Array X = WC();
            is equivalent to
            Array X = (2 * CLOSE + HIGH + LOW)/4;


          23.1.64 WILLA       William's A/D


          Usage:         WILLA(  )


                                        23-78





                                               Technical Analysis Functions
          Returns:  Array
          Description : 
          WILLA is a cumulative price indicator, for which a value for each
          day is added to the previous day's cumulative sum as follows:



















































                                        23-79





                                               Technical Analysis Functions
          If C[i] > C[i - 1], return array element [i] = value at [i - 1]
          plus the following accumulation amount:
            C[i] minus the smaller of C[i - 1] or L[i]
          If C[i] < C[i - 1], return array element [i] = value at [i - 1]
          plus the following accumulation amount:
            C[i] minus the larger of C[i - 1] or H[i]

          Divergence-based trading rules are:
          Sell if security goes to new high but WILLA does not go to new
          high.
          Buy if security goes to new low but WILLA noes not go to new low.

          Note The AD function is a similar indicator, except that it is
          based on volume instead of price.
          Example:
            Array X = WillA();


          23.1.65 WILLR       William's %R


          Usage:         WILLR( Period1 )
          Returns:  Array
          Description : 
          for Period1 periods. This is equivalent to a Period1 period
          stochastic with 1 day smoothing. The result is then reduced by
          100.
          Example:
            Array X = WillR(14);


          23.1.66 ZIG         Zig Zag


          Usage:         ZIG( Array1,Run1,Type )
          Returns:  Array
          Description : 
          Compute a ZIG ZAG function for array Array1. Run1 is the minimum
          percentage or unit (dollar) change which must be made in order to
          reflect a change in the Zig Zag line. The third parameter Type is
          either '%' or '$'. If it is '%', then the Run1 value is expressed
          as a percentage change, otherwise it is a unit (or dollar)
          change.
          If you want to see what kind of profits you could make, run the
          ZIG.PTS Profit Test file.  According the Equis Metastock User's
          Manual, "The Zig Zag indicator has 20/20 hindsight. Unfortu-
          nately, the Zig Zag's foresight is not as profitable. This is
          because the last "leg" of the Zig Zag indicator isn't fixed until
          future prices are known. If you use the Zig Zag  indicator to
          predict future prices, you are probably fooling yourself." Sorry,
          but that's the way it works. It is provided in TAS as a sort  of
          "benchmark" to judge how much the IDEAL strategy could  SQUEEZE



                                        23-80





                                               Technical Analysis Functions
          out of a portfolio. It is nearly ideal, because it knows the
          future.
          Example:
            Array X = Zig(Close,5,'%');
            would create (in variable "X ") a " zigzag " line of the
            closing price that runs from a trough to a peak whenever a move
            greater than or equal to 5% exists. Moves smaller than 5% are
            ignored.















































                                        23-81





                                                     Profit Test Statements

          24. Profit Test Statements

          Profit Test Statements are used to:

          . Define which Technical Indicators are to be computed.

          . Define BUY conditions

          . Define SELL conditions

          . Define STOP conditions

          The statements used to describe the situations above are de-
          scribed in the next 4 sections.


          24.1 PLOT statement: Define Technical Indicators

          The PLOT statement is used to create the formulas or indicators
          which will be used in the subsequent profit test. The PLOT
          statement is executed once per ticker symbol, and must be placed
          prior to any of the BUY/SELL/STOP WHEN conditions.

          The format of the PLOT statement is:

               PLOT stmt;
          where 'stmt' can be a single statement or a BEGIN..END block. For
          example, if your profit test is to test the Commodity Channel
          Index (CCI) for 14 days, you could say:

            CCI_ARRAY : ARRAY;    { Define the cci array}
            PLOT CCI_ARRAY = CCI(14);
          In the example, only one indicator is computed, so there was no
          need to use the BEGIN..END block. Suppose, however, that we want
          to incorporate Wilder's RSI in the profit test as well. Then we
          would say:

            CCI_ARRAY : ARRAY;    { Define the cci array}
            RSI_ARRAY : ARRAY;    { Define the rsi array}
            PLOT BEGIN
            CCI_ARRAY = CCI(14);
            RSI_ARRAY = RSI(14);
            END;   { of PLOT statement}

          24.2 BUY WHEN - Define BUY Conditions

          The BUY WHEN condition causes the profit tester to 'buy' the
          stock if the condition is true.

               BUY WHEN expression;
          where 'expression' can be any combination of logical or rela-
          tional operators.


                                        24-1





                                                     Profit Test Statements
          For example, using the last PLOT statement in the previous ex-
          ample, we will issue a BUY signal when the CCI rises above -100
          and the RSI is less than 40:

            BUY WHEN cci_array OF YESTERDAY IS LESS THAN < -100
            AND cci_array OF TODAY  IS GREATER THAN -100
            AND rsi_array IS LESS THAN 40;

          24.3 SELL WHEN - Define SELL Conditions

          The SELL WHEN condition causes the profit tester to 'sell' the
          stock if the condition is true.

            SELL WHEN expression;
          where 'expression' can be any combination of logical or rela-
          tional operators.

          For example, using the last PLOT statement in the previous ex-
          ample, we will issue a SELL signal when the CCI drops below 100
          and the RSI is greater than 60:

            SELL WHEN cci_array OF YESTERDAY > 100
               AND cci_array OF TODAY < 100
               AND rsi_array OF TODAY IS GREATER THAN 60;

          24.4 STOP (LONG or SHORT) Condition

          The STOP LONG and STOP SHORT statements close a "long" position
          or a "short" position, respectively, by either selling or buying
          to cover an open position.

          To close out a long position (by selling), the statement is:

            STOP LONG WHEN expression;
          where 'expression' can be any combination of logical or rela-
          tional operators.

          To close out a short position (by buying), the statement is:

            STOP SHORT WHEN expression;
          where 'expression' can be any combination of logical or rela-
          tional operators.

          Adding a long stop to the example built in the prior sections, we
          could say that we want to issue a stop if, after having gone
          long, the CCI drops below -100 again. In that case, we could say:

            STOP LONG WHEN cci_array < -100;

          24.5 TAS Profit Tester Functions

          The Profit Tester feature of TAS uses the following functions to
          indicate the buy/sell transactions controlled by a Profit Testing


                                        24-2





                                                     Profit Test Statements
          script. These functions are named PT_xxxx and are defined in the
          Chapter Profit Testing Functions.

          24.5.1 Profit Test Phases - Advanced Use Only

          TAS runs the profit test in two phases. The first phase, called
          the PLOT PHASE is when the script should compute the arrays to be
          tested in next phase. This next phase is the TEST PHASE. This
          phase is entered once for each the data points of the security
          under test. After all data points have been processed, the END
          PHASE indicator is set. Each 'phase' of the Profit Test process
          is indicated by a variable being equal to 1.

          The two phases are analogous to the steps you might run in Me-
          tastock to do the Profitability Test. First, you would plot an
          indicator, moving average, or custom formula. This is similar to
          the 'PLOT PHASE' in TAS. Next, you would run the Profit Tester
          specifying your Buy/Sell conditions. Metastock then applies your
          Buy/Sell signals to each plotted point on the graph, proceeding
          left to right until it reaches the last day loaded. This is the
          'TEST PHASE' in TAS.

          When the TEST PHASE is entered with the last day of the ticker
          file, a variable, called 'END_PHASE' is set to 1. Testing this
          variable will allow you to print out the results for the Profit
          Test.

          For each ticker, the script is entered once for the PLOT Phase,
          and then as many times as there are data points in the security
          for the TEST Phase.



          If you use the PT_BUY, PT_SELL, PT_STOP, PT_PRICE functions,
          you will need to understand the different phases for the Profit
          Tester. However, if you use the BUY WHEN, SELL WHEN, STOP ...
          WHEN and PLOT forms of the Profit Test, you do not need to be
          concerned about the different Profit Tester phases, since the
          script generates the appropriate phase testing automatically.
          You should   use the BUY, SELL and STOP WHEN statements to do
          your PROFIT TESTING. See RSIPT.TAS for an example.














                                        24-3





                                                       "POUND" (#) Commands

          25. "POUND" (#) Commands

          TAS "POUND" commands are used to control special script
          processing. They must begin with a "pound sign" ('#') in the
          first column of the line, and they must be completed on the same
          line.

          DO NOT USE A SEMI-COLON to terminate a POUND command, since they
          are not Script Language statements, but are TAS run settings. You
          should not put comments at the end of a POUND command either.

          "POUND" commands are executed by TAS only_one_time_during the

          life of the script, as contrasted with other TAS script
          statements which are executed once_for_every_ticker.



          25.1 OUTPUT_FILE Command

          You can direct the output of a script to a file by placing an
          #OUTPUT_FILE command in the script file. The #OUTPUT_FILE command
          must start in the first column of the line. It should be followed
          by the output file name surrounded by single quotes and any
          optional parameters.

          The format for the #OUTPUT_FILE command is

          #OUTPUT_FILE filename [+] [N]

          the parameters surrounded by "[] " are optional and need not be
          specified unless the feature is desired. The "+ " sign indicates
          you want to append  ( add to) the end of the file if it exists.
          The "N " says you want to suppress the standard TAS report
          heading.

          If you want to direct your output to a PRINTER, for example,
          LPT1, you can use the #OUTPUT_FILE command, #OUTPUT_FILE 'LPT1'

          For example,

            #OUTPUT_FILE 'select.lst'

          would place the output text of the script into the file
          'select.lst'.

          25.1.1 Appending to Output File

          If you want to APPEND, or add to, the end of the output file, you
          can do so by placing a plus (+) character at the end of the
          output file name. From the example above,



                                        25-1





                                                       "POUND" (#) Commands
            #OUTPUT_FILE 'select.lst+'

          would place the output of the script at the end of file
          "select.lst". This feature will be most useful if you are running
          several scripts in succession and want to place the output from
          different scripts into one output file.

          25.1.2 Suppressing TAS Report Heading

          In addition, if you want to suppress the headings that TAS
          normally puts out on its reports, you can do this with the
          OUTPUT_FILE command by placing the letter "N" after the file name
          (preceded by a space).


          25.2 MAX_QUOTES Command

          You can use the #MAX_QUOTES command to limit the number of quotes
          read into a script. This value must be less than the MAXIMUM
          QUOTES you specified in the TAS Configuration Menu. If it is less
          than the TAS Configuration Menu MAXIMUM QUOTES, it will override
          the quote count to read for the script in which it is contained
          only.

          The format of the #MAX_QUOTES command is:

               #MAX_QUOTES min max


          where

          min is the minimum number of quotes that the security file must
          have.

          max is the maximum number of quotes to read into TAS when this
          script is processed.


          25.3 SCAN_DATE Command

          You can use the #SCAN_DATE command to define the time frame you
          want to process. You can specify a beginning date, an ending date
          or both.

           The SCAN_DATE command enables you to start loading quotes from a
          specific date (the start date)  and to stop loading quotes after
          a specific date (the end date).

          The format of the #SCAN_DATE command is:






                                        25-2





                                                       "POUND" (#) Commands
            #SCAN_DATE start_date end_date
               or
            #SCAN_DATE end_date

          Both start_date and end_date can be in the following format

          where yy is the year, mm is the month, and dd is the day :

            yymmdd  ,e.g. 910302 for March 2, 1991
            'mm/dd/yy'
            mm/dd/yy


          Some examples of the use of #SCAN_DATE are:

            #SCAN_DATE 910102 0
          will start loading data on Jan 2, 1991 and load up to the last
          day in the file.

            #SCAN_DATE 910102 910915
          will start on Jan 2, 1991 and load up to Sept 15, 1991.

          If there is no quote in the file for the start_date, the first
          date prior to the start_date will be loaded.

          If there is no quote in the file for the end_date,the first date
          prior to the end_date will be used.

          Either the start_date or the end_date may be zero, in which case,
          it means to load from the beginning or the end of the file with-
          out regard to date, but taking into account the MAX_QUOTES range.


          25.4 PROFIT_TEST Command

          The #PROFIT_TEST command informs TAS of the type of profit test
          you want to run, whether you want to test "LONG", "SHORT" or
          "BOTH" long and short positions, and the amount of "money" you
          want your position to start with. This command must be placed in
          the front of the TAS script, prior to any statements which do not
          begin with a # sign.

          The format of the #PROFIT_TEST command is:

            #PROFIT_TEST type money


          where 'type' is either LONG, SHORT or BOTH (for a "long" position
          test or a "short" position test, or a test of both Long and Short
          positions) and "money" is the amount of money with which to start
          the test for each symbol.




                                        25-3





                                                       "POUND" (#) Commands
          25.5 INDEX Command

          The #INDEX command can be used to load an "index" data array,
          such as the SP500, DJIA or another stock. It tells TAS to access
          the ticker symbol contained in the command and place its CLOSING
          PRICES into a Pre-defined Data Array named "INDEX".

          The format of the INDEX Command is:

               #INDEX 'ticker'
          where 'ticker' is the TICKER SYMBOL of the Index quote file. For
          example, if you had the SP 500 quotes in a file with a ticker
          name of "SP500", and you wanted to load it as the INDEX array,
          you would say

            #INDEX 'SP500'

          Later in the script, you could reference the array by the name of
          INDEX.



          This command must be placed in the front of the TAS script,
          prior to any statements which do not begin with a # sign. It
          also should follow any #MAX_QUOTES statement that is in the
          script.





          25.6 INCLUDE Command

          The #INCLUDE command will "include" another file  into the
          current script as if that file were part of the script . Once the
          included file is read into TAS,
           the original script is continued. You can include up to 8 levels
          of includes, that is, the included file can contain a #include
          and that file can contain one, etc., up to 8 levels.

          The format of the #include command is

               #INCLUDE filename
          where filename is the name of a file in the current directory.


          25.7 TITLE Command

          The #TITLE command is used to provide a "title" to a file. This
          title is shown when the File/List extended list display is
          created.




                                        25-4





                                                       "POUND" (#) Commands
          The #TITLE line should be no longer than 72 characters, and it
          must be the first line in the file.


          25.8 COMPRESS Command

          The #COMPRESS command can be placed in a script to cause
          compression of the data by weekly, monthly, yearly or some number
          of data points.

          The format is

          #COMPRESS  cfactor

          where cfactor is W, M,  Y or some number.








































                                        25-5





                          ASCII Format Historical Data Files

            26. ASCII Format Historical Data Files

            ASCII format data directories must contain readable ASCII text
            files with historical data for each ticker symbol in each file.
            The file names must be symbol.PRN where symbol is the ticker
            symbol. All files in the directory must have the same field
            order within the ASCII data files.

            The order of data fields on each line of the ASCII *.PRN files
            must be specified in a file located in the data directory. This
            file is named ASCII.FMT. It should contain a single line with a
            Format Description String describing the ASCII field format.

            The Format Description String defines the format of a comma
            separated quote by using single letters to describe each field
            in the quote. The code letters for each field are:


                           Format   Data
                           Code     Field

                           S        Ticker
                                    Symbol

                           D        Date

                           H        High

                           L        Low

                           C        Close

                           V        Volume

                           O        Open

                           I        Open
                                    Interest

                           X        Skip this
                                    field



            For example, if your quote file contains quotes with the
            following format:

            date,symbol,high,low,close,open,open int,other,volume
            where "other" is some other data value, then your format
            specification string would be:

                                       DSHLCOIXV


                                         26-1





                          ASCII Format Historical Data Files























































                                         26-2





                                        Index

                                      27. Index


                                             AGet
          ------
          "batch mode", 3-1                    Get_comma_separated_values,
          "periods", 4-7
                                                    15-14
          ------
          Accumulation/Distribution          AGetLn

            AD, 23-53                          Get_a_line_from_a_CSV_file,

          AClose                                    15-15

            Close_an_ASCII_File, 15-14       Allocate_a_new_sort_buffer

          AD                                   SortAlloc, 21-46

            Accumulation/Distribution,       Alpha

                 23-53                         Alpha_function, 23-54

          Add                                Alpha_function

            Add_two_arrays, 16-22              Alpha, 23-54

          Add_number_to_array                Angle

            AddTo, 16-22                       Angle_of_a_line, 23-55

          Add_two_arrays                     Angle_of_a_line

            Add, 16-22                         Angle, 23-55

          addition, 9-11                     Annotate
          AddTo
                                               Annotate_a_graph, 14-8
            Add_number_to_array, 16-22
                                             Annotate_a_graph
          ADX, 23-59
                                               Annotate, 14-8
            Average_Directional
                                             AOpen
                 Movement, 23-53
                                               Open_an_ASCII_file, 15-15
          ADXR
                                             APut
            Average_Directional

                 Movement_Rating, 23-54



                                     Index-27-1





                                        Index
            Put_fields_to_an_ASCII           AvgPrc

                 file, 15-16                   Average_Price, 23-55

          APutLn
                                             --B---
            Put_a_new_record_to_an           BBandB

                 ASCII_file, 15-16             Bottom_Bollinger_Band, 23-

          Arm's_Ease_of_Movement                    55

            EMV, 23-59                       BBandT

          array, 9-4, 9-7, 9-8, 9-10, 9-       Top_Bollinger_Band, 23-56
               11, 9-15
          Array_Contents                     Begin_Database_Definition

            Dump_Array, 15-18                  DBDefine, 12-2

          ASCII format, 26-1                 BEGIN..END, 9-14, 9-15
          ASCII.FMT, 26-1                    Beta:, 23-56
          ASeek
                                             BGColors
            Locate_a_record_in_an_ASCII
                                               Set_background_color, 14-8
                 file, 15-17
                                             Bottom_Bollinger_Band
          Ask
                                               BBandB, 23-55
            Ask_user_for_input_values,

                 15-18                       ------
                                             CASH, 7-9
          Ask_user_for_input_values          CCI

            Ask, 15-18                         Commodity_Channel_Index

          Assignment Statement, 9-2                 Array, 23-57
          Average_Directional_Movement
                                             Chaikin's_Oscillator
            ADX, 23-53
                                               CO, 23-58
          Average_Directional_Movement
                                             Chaikin's_Volatility
               Rating
                                               VOL, 23-78
            ADXR, 23-54
                                             ChartPro, 8-2
          Average_Price                      Check_if_variable_exists

            AvgPrc, 23-55                      Defined, 17-32



                                     Index-27-2





                                        Index
          Close_an_ASCII_File                  Correlation_Coefficient,

            AClose, 15-14                           23-58

          Close_Database_File                Correlation_Coefficient

            DBClose, 12-2                      CorrCoef, 23-58

          Close_Graph_screen                 COS

            CloseGraph, 14-8                   Trigonometric_CoSine, 16-23

          CloseGraph                         Create_a_Database

            Close_Graph_screen, 14-8           DBCreate, 12-2

          CO                                 Create_a_date_variable

            Chaikin's_Oscillator, 23-58        MakeDate, 13-6

          color, 3-1, 14-9                   Create_a_formatted_date

          Color Names, 10-2                    DateStr, 13-6
          Command Line Options, 3-1
          Commodity_Channel_Index_Array      Create_a_Trendline

            CCI, 23-57                         TrendLine, 23-75

          companion products, 1-4            Create_Integer
          Compress
                                               Int, 16-24
            Date_Compression, 20-44
                                             CUM
          Compression, 7-7
          Compuserve, 1-5                      Cumulative_Sum_of_Array,
          Compute_Z-Score_for_array
                                                    16-23
            zScore, 16-31
                                             Cumulative_Sum_of_Array
          Computrac, 1-2
          Const                                CUM, 16-23

            Constant_Array, 16-22            Current_date

          Constant_Array                       Now, 13-7

            Const, 16-22                     Custom Reports, 1-2
                                             Cycle_via_Fast_Fourier
          CorrCoef
                                                  Transform

                                               FFTCycle, 23-60



                                     Index-27-3





                                        Index
          --D---                             DBField
          DAILY data, 4-7
          Data Directories, 8-2                Define_a_Database_field,
          DATA DIRECTORY(S), 4-7
          DataPath, 10-1                            12-2
          Date, 10-2, 13-6, 13-7, 21-48,
                                             DBFirst
               25-2
          Date_Compression                     First_Database_Record, 12-3

            Compress, 20-44                  DBLast

          DateRange                            Last_Database_Record, 12-3

            Set_Date_Range, 20-44            DBLoad

          DateStr                              Load_Database_with

            Create_a_formatted_date,                Delimited_Data, 12-4

                 13-6                        DBNext

          Day_of_Month                         Next_Database_Record, 12-4

            DayMon, 13-6                     DBOpen

          Day_of_Week_function                 Open_Database_File, 12-4

            DayWk, 13-6                      DBPrev

          DayMon                               Previous_Database_Record,

            Day_of_Month, 13-6                      12-5

          DaysInPosition, 10-2               DBRead
          DayWk
                                               Read_Database_Record, 12-5
            Day_of_Week_function, 13-6
                                             DBTickList
          DBClose
                                               Set_Processing_order_to
            Close_Database_File, 12-2
                                                    Database, 12-5
          DBCreate
                                             DBWrite
            Create_a_Database, 12-2
                                               Write_Database_record, 12-5
          DBDefine
                                             decimal point, 9-7, 15-21, 16-
            Begin_Database_Definition,
                                                  24, 21-49
                 12-2



                                     Index-27-4





                                        Index
          Define_a_Database_field              Draw_a_small_down_arrow,

            DBField, 12-2                           14-8

          Defined                            DPO

            Check_if_variable_exists,          Detrended_Price_Oscillator,

                 17-32                              23-59

          Detrended_Price_Oscillator         Draw_a_horizontal_line

            DPO, 23-59                         HLine, 14-10

          Directional_Movement_Index         Draw_a_line_on_a_graph

            DMI, 23-58                         DrawLine, 14-9

          DIV                                Draw_a_log/linear_graph

            Divide_two_arrays, 16-23           SemiLogGraph, 14-11

          DivBy                              Draw_a_single_graph

            Divide_array_by_number, 16-        Graph, 14-9

                 23                          Draw_a_small_down_arrow

          Divide_array_by_number               DownArrow, 14-8

            DivBy, 16-23                     Draw_a_small_up_arrow

          Divide_two_arrays                    UpArrow, 14-13

            DIV, 16-23                       Draw_a_vertical_line

          DMI, 23-59                           VLine, 14-13

            Directional_Movement_Index,      DrawLine

                 23-58                         Draw_a_line_on_a_graph, 14-

          DOS                                       9

            Execute_a_DOS_command, 17-       Dump_Array

                 32                            Array_Contents, 15-18

          DOS Shell, 4-4
          DowJones, 1-5                      ------
          DownArrow                          EMA




                                     Index-27-5





                                        Index
            Exponential_Moving_Average,      Extract_file_name

                 23-59                         GetFileName, 17-32

          EMV
                                             --F---
            Arm's_Ease_of_Movement, 23-      Fast_Fourier_Transform

                 59                            FFT, 23-60

          END PHASE, 24-3                    FFT
          End_Phase, 10-4
          errors in syntax, 6-5                Fast_Fourier_Transform, 23-
          Execute_a_DOS_command
                                                    60
            DOS, 17-32
                                             FFTCycle
          EXP
                                               Cycle_via_Fast_Fourier
            Exponential_Function, 16-24
                                                    Transform, 23-60
          Expand, 22-50
                                             Find_array_intersection
            Expand_formatted_string,
                                               Isect, 23-62
                 22-50
                                             Find_first_value
          Expand_formatted_string
                                               FindFst, 18-35
            Expand, 22-50
                                             Find_last_value
          explicit  typing. See
               Declaring Variables             FindLst, 18-35
          explicit reference, 9-8
          Exponential_Function               Find_pattern_in_array

            EXP, 16-24                         FindPattern, 18-35

          Exponential_Moving_Average         Find_Peak_in_Array

            EMA, 23-59                         Peak, 18-35

          exponentiation, 9-11               Find_substring
          expression, 9-9, 9-11, 9-19
          Extract_directory_path               FindStr, 22-50

            GetPathName, 17-33               Find_Trough_in_Array

          Extract_file_extention               Trough, 18-38

            GetFileType, 17-33               Find_up/down_moves




                                     Index-27-6





                                        Index
            SignMove, 23-73                  --G---
                                             Generate_random_number
          FindFst
                                               RandomNumber, 16-28
            Find_first_value, 18-35
                                             GEnie, 1-5
          FindLst                            Get_a_line_from_a_CSV_file

            Find_last_value, 18-35             AGetLn, 15-15

          FindPattern                        Get_comma_separated_values

            Find_pattern_in_array, 18-         AGet, 15-14

                 35                          GetFileName

          FindStr                              Extract_file_name, 17-32

            Find_substring, 22-50            GetFileType

          First_Database_Record                Extract_file_extention, 17-

            DBFirst, 12-3                           33

          First_Ticker, 10-3                 GetPathName
          FlexSoft BBS, 1-4
          FOR statement, 9-12, 9-13            Extract_directory_path, 17-
          Format
                                                    33
            Format_a_number, 22-50
                                             GOSUB, 9-16
          Format_a_number                    GOTO, 9-15
                                             Graph, 23-62, 24-3
            Format, 22-50
                                               Draw_a_single_graph, 14-9
          format specifier, 22-51
          format string, 21-49
          format_string, 22-50               --H---
          formfeed, 15-20                    Hardware required, 1-2
          Free_a_sort_buffer                 HELP Key, 6-5
                                             HHV
            SortFree, 21-46
                                               Highest_High_Value, 23-60
          FullName, 10-1, 15-20
          function, 9-2                      Highest_High_Value
          Future
                                               HHV, 23-60
            Future_array_element, 19-39
                                             HLine
          Future_array_element

            Future, 19-39



                                     Index-27-7





                                        Index
            Draw_a_horizontal_line, 14-      internet, 1-4, 1-5
                                             intersecting point, 23-62
                 10                          Investograph Plus, 1-2
                                             Isect

          --I---                               Find_array_intersection,
          IF, 9-2
          If_Function                               23-62

            IFF, 23-61                       iterate
                                               see loop, 9-13
          If_Function_for_Arrays
                                             --L---
            IFFA, 23-61                      Last_Database_Record

          IfDn                                 DBLast, 12-3

            One_if_Down, 23-61               Last_Ticker, 10-3
                                             linear regression, 23-56, 23-
          IFF
                                                  58, 23-63, 23-77
            If_Function, 23-61
                                               LinReg, 23-63
          IFFA
                                             LineColors
            If_Function_for_Arrays, 23-
                                               Set_Line_Colors, 14-10
                 61
                                             linreg, 23-55
          IfUp                                 Linear_Regression, 23-63

            One_if_Up, 23-62                 linreg2, 23-55
                                               Two_Way_Linear_Regression,
          implicit typing. See Declaring
               Variables                            23-63
          Include Ticker Period, 4-7
          Index, 7-7, 10-3                   LLV
          INDEX Command, 25-4
          indices                              Lowest_Low_Value, 23-64
            See Array Indices, 9-8
          Initialize_Random_Number           Load

               Generator                       Load_a_Data_Array, 17-33

            RandomSeed, 16-28                Load_a_Data_Array

          Int                                  Load, 17-33

            Create_Integer, 16-24            Load_Database_with_Delimited

          INT function, 9-7                       Data
          integer, 9-7, 15-21, 21-48
          integer maximum value, 16-24


                                     Index-27-8





                                        Index
            DBLoad, 12-4                       Maximum_value_of_a_pair,

          load function, 17-33                      16-24
          Locate_a_record_in_an_ASCII
                                             MAX_QUOTES, 9-8, 25-2, 25-4
               file                          maximum data points, 20-45
                                             Maximum_value_in_array
            ASeek, 15-17
                                               MaxVal, 16-25
          LOG
                                             Maximum_value_of_a_pair
            Natural_Logarithm, 16-24
                                               Max, 16-24
          LONG, 24-2
          loop, 9-12, 9-13, 21-47            maximum value of an "integer"
          Lowest_Low_Value                        field, 21-48
                                             Maximum_value_of_two_arrays
            LLV, 23-64
                                               MaxPair, 16-25

          ------                             MaxLoss, 10-2
          MACD                               MaxPair

            Moving_Average                     Maximum_value_of_two

                 Convergence/Divergence             arrays, 16-25

                 , 23-64                     MaxProfit, 10-2
                                             MaxQuotes
          MACD_Extended
                                               Set_Maximum_Data_Points,
            MacdX, 23-64
                                                    20-45
          MacdX
                                             MaxVal
            MACD_Extended, 23-64
                                               Maximum_value_in_array, 16-
          Make_Random_Number_truly
                                                    25
               random
                                             MDI, 23-59
            Randomize, 16-27                   Minus_Directional_Movement

          MakeDate                                  (-DI), 23-65

            Create_a_date_variable, 13-      MemLeft

                 6                             Show_remaining_memory, 16-

          MASS:, 23-65                              25

          Max                                memory, 16-25
                                             memory - minimum, 1-2


                                     Index-27-9





                                        Index
          MetaStock data files, 1-5          Month
          MetaStock Professional, 1-5
          MFI                                  Month_function, 13-7

            Money_Flow_Index, 23-65          Month_function

          Min                                  Month, 13-7

            Minimum_value_of_a_pair,         monthly compression, 20-44
                                             mouse, 1-2, 2-4
                 16-26                       MOV

          Minimum_value_in_array               Moving_Average, 23-66

            MinVal, 16-26                    Moving_Average

          Minimum_value_of_a_pair              MOV, 23-66

            Min, 16-26                       Moving_Average

          Minimum_value_of_two_arrays             Convergence/Divergence

            MinPair, 16-26                     MACD, 23-64

          MinPair                            MUL

            Minimum_value_of_two               Multiply_two_arrays, 16-27

                 arrays, 16-26               MulBy

          Minus_Directional_Movement           Multiply_by_number, 16-27

               (-DI)                         multiplication, 9-11
                                             Multiply_by_number
            MDI, 23-65
                                               MulBy, 16-27
          MinVal
                                             Multiply_two_arrays
            Minimum_value_in_array, 16-
                                               MUL, 16-27
                 26

          MO                                 --N---
                                             Natural_Logarithm
            Price_Momentum, 23-66
                                               LOG, 16-24
          modulus, 9-11
          MONEY, 7-9                         NEG
          Money_Flow_Index
                                               Negate_an_array, 16-27
            MFI, 23-65
                                             Negate_an_array
          Monochrome, 3-1


                                     Index-27-10





                                        Index
            NEG, 16-27                         DBOpen, 12-4

          Negative_Volume_Index              OpenGraph

            NVI, 23-67                         Open_a_Graph_Screen, 14-10

          New Line, 15-20, 21-49             OSCP
          new page, 15-20
          Next_Database_Record                 Price_Oscillator, 23-68

            DBNext, 12-4                     OSCV

          NOT, 9-18                            Volume_Oscillator, 23-69
          Now
                                             OUTPUT_FILE, 25-1, 25-2
            Current_date, 13-7               OutputFile

          number, 9-7, 9-18                    Specify_listing_file, 15-19
          NVI
                                             Over
            Negative_Volume_Index, 23-
                                               Over_function, 23-70
                 67
                                             Over_function

          ------                               Over, 23-70
          OBV

            On_Balance_Volume, 23-68         ------
                                             Parabolic_Stop_and_Reverse
          On_Balance_Volume
                                               SAR, 23-73
            OBV, 23-68
                                             Parallel_Trendline
          One_if_Down
                                               TrendPar, 23-76
            IfDn, 23-61
                                             parameter, 11-1
          One_if_Up                          parentheses, 9-11
                                             Parse_a_comma_separated_string
            IfUp, 23-62
                                               ParseString, 22-51
          online order system, 1-4
          Open_a_Graph_Screen                ParseString

            OpenGraph, 14-10                   Parse_a_comma_separated

          Open_an_ASCII_file                        string, 22-51

            AOpen, 15-15                     Pause

          Open_Database_File



                                     Index-27-11





                                        Index
            Wait_for_keyboard_input,           DBPrev, 12-5

                 15-19                       Price_Momentum

          PDI, 23-59                           MO, 23-66
            Positive_Directional
                                             Price_Oscillator
                 Movement_(+DI), 23-70
                                               OSCP, 23-68
          PDL, 1-4
          Peak                               Print_contents_of_Sort_Buffer

            Find_Peak_in_Array, 18-35          SortPrint, 21-48

          PER                                Print_the_current_graph_screen

            Performance_Indicator, 23-         PrintGraph, 14-10

                 70                          PRINTER
                                               See OUTPUT_FILE, 25-1
          PER1                               PrintGraph

            Performance_using_Array,           Print_the_current_graph

                 23-71                              screen, 14-10

          Performance_Indicator              Prodigy, 1-5
                                             Profit, 10-2
            PER, 23-70                       profit test, 24-1, 24-3
                                             Profit_Test_-_Buy
          Performance_using_Array
                                               PT_Buy, 19-39
            PER1, 23-71
                                             Profit_Test_-_Get_open
          Personal Ticker Tape, 1-4
          PLOT, 24-1                              position_entry_price
          PLOT PHASE, 24-3
          Plot_Phase, 10-3                     PT_Price, 19-40
          Positive_Directional_Movement
                                             Profit_Test_-_Sell
               (+DI)
                                               PT_Sell, 19-41
            PDI, 23-70
                                             Profit_Test_-_Set_maximum_loss
          Positive_Volume_Indicator
                                                  amount
            PVI, 23-71
                                               Stop_Maximumloss, 19-42
          POUND, 25-1
          POUND commands, 25-1               Profit_Test_-_Set_profit
          Pre-Defined Variables, 10-1
          Previous_Database_Record                target



                                     Index-27-12





                                        Index
            Stop_ProfitTarget, 19-43         PT_Sell

          Profit_Test_-_Set_trailing           Profit_Test_-_Sell, 19-41

               stop_loss                     PT_SetPrice

            Stop_Trailing, 19-43               Profit_Test_-_Set

          Profit_Test_-_Set_transaction             transaction_closing

               closing_price                        price, 19-41

            PT_SetPrice, 19-41               PT_Stop

          Profit_Test_-_Stop_Long/Short        Profit_Test_-_Stop

            PT_Stop, 19-41                          Long/Short, 19-41

          Profit_Test_Initialization         PTT, 1-4
                                             Put_a_new_record_to_an_ASCII
            PT_Init, 19-39
                                                  file
          Profit_Test_Options
                                               APutLn, 15-16
            PT_Options, 19-40
                                             Put_data_in_Sort_Buffer
          Profit_Test_Reruns
                                               SortOut, 21-48
            Redo_Count, 19-42
                                             Put_fields_to_an_ASCII_file
          Profit Testing, 1-2
          PT_Buy                               APut, 15-16

            Profit_Test_-_Buy, 19-39         PVI

          PT_Init                              Positive_Volume_Indicator,

            Profit_Test_Initialization,             23-71

                 19-39
                                             ------
          PT_Options                         QUOTE_COUNT, 9-8, 10-1
                                             Quote_Range, 10-3
            Profit_Test_Options, 19-40
                                             ------
          PT_Price                           Randomize

            Profit_Test_-_Get_open             Make_Random_Number_truly

                 position_entry_price,              random, 16-27

                 19-40                       RandomNumber



                                     Index-27-13





                                        Index
            Generate_random_number, 16-        Rate_of_Change, 23-72

                 28                          RSI

          RandomSeed                           Wilder's_Relative_Strength,

            Initialize_Random_Number                23-72

                 Generator, 16-28
                                             ------
          Rank, 7-14                         SAR
          Rate_of_Change
                                               Parabolic_Stop_and_Reverse,
            ROC, 23-72
                                                    23-73
          Read_Database_Record
                                             semi-colon, 9-12
            DBRead, 12-5                     SemiLogGraph

          Redistribution of TAS, 1-4           Draw_a_log/linear_graph,
          Redo
                                                    14-11
            Rerun_profit_test, 19-42
                                             Set
          Redo_Count
                                               Set_Array_to_Value, 16-28
            Profit_Test_Reruns, 19-42
                                             Set_Array_to_Value
          REF
                                               Set, 16-28
            Reference_function, 23-72
                                             Set_background_color
          Reference_function
                                               BGColors, 14-8
            REF, 23-72
                                             Set_Date_Range
          REGISTER.DOC, 4-8
          Registration Code, 1-4               DateRange, 20-44
            encrypted code, 4-8
          Registration Code Secrecy, 1-4     Set_Graph_Sizes
          Rerun_profit_test
                                               SizeGraph, 14-11
            Redo, 19-42
                                             Set_Line_Colors
          Retrieve_one_record_from_Sort
                                               LineColors, 14-10
               Buffer
                                             Set_Maximum_Data_Points
            SortGet, 21-46
                                               MaxQuotes, 20-45
          RETURN statement, 9-17
          ROC



                                     Index-27-14





                                        Index
          Set_Processing_order_to              SMA, 23-74

               Database                      SIN

            DBTickList, 12-5                   Trigonometric_sine, 16-29

          Set_text_alignment                 SizeGraph

            TextAlign, 14-11                   Set_Graph_Sizes, 14-11

          Set_text_color                     Slope

            TextColor, 14-12                   Slope_of_Line, 23-73

          Set_text_font                      Slope_of_Line

            TextFont, 14-12                    Slope, 23-73

          Set_text_size                      SMA

            TextSize, 14-13                    Simple_Moving_Average, 23-

          Set_text_writing_direction                74

            TextDir, 14-12                   software requirements, 1-2
                                             sort buffer, 21-46, 21-47
          Set_the_current_sort_buffer
                                             Sort_data_in_buffer_on_field
            SortSetBuf, 21-49
                                               SortOn, 21-47
          Setup/Data Directories, 2-4
          SharesHeld, 10-3                   SortAlloc
          SHORT, 24-2
          Show_remaining_memory                Allocate_a_new_sort_buffer,

            MemLeft, 16-25                          21-46

          Sign                               SortFree

            Sign_of_array_entries, 16-         Free_a_sort_buffer, 21-46

                 29                          SortGet

          Sign_of_array_entries                Retrieve_one_record_from

            Sign, 16-29                             Sort_Buffer, 21-46

          SignMove                           SortOn

            Find_up/down_moves, 23-73          Sort_data_in_buffer_on

          Simple_Moving_Average                     field, 21-47



                                     Index-27-15





                                        Index
          SortOut                              STOCH, 23-74

            Put_data_in_Sort_Buffer,         Stop_Maximumloss

                 21-48                         Profit_Test_-_Set_maximum

          SortPrint                                 loss_amount, 19-42

            Print_contents_of_Sort           Stop_ProfitTarget

                 Buffer, 21-48                 Profit_Test_-_Set_profit

          SortSetBuf                                target, 19-43

            Set_the_current_sort             Stop_Trailing

                 buffer, 21-49                 Profit_Test_-_Set_trailing

          Specify_listing_file                      stop_loss, 19-43

            OutputFile, 15-19                string constant, 21-48
                                             String_Length
          SQRT
                                               StrLen, 22-51
            Square_Root, 16-29
                                             String_Replace
          Square_Root
                                               StrRep, 22-52
            SQRT, 16-29
                                             StrLen
          Standard_Deviation
                                               String_Length, 22-51
            STD, 23-74
                                             StrRep
          Statement, 9-1, 9-9, 9-11, 9-
               14                              String_Replace, 22-52
          Statistical_Variance
                                             SUB
            VAR, 23-77
                                               Subtract_one_array_from
          STD
                                                    another, 16-30
            Standard_Deviation, 23-74
                                             SubFrom
          STOCH
                                               Subtract_number_from_array,
            Stochastic_Oscillator, 23-
                                                    16-30
                 74
                                             subroutine, 9-16
          Stochastic_Oscillator              Substr




                                     Index-27-16





                                        Index
            Substring_function, 22-52        TextAt

          Substring_function                   Write_text_on_graph, 14-12

            Substr, 22-52                    TextColor

          Subtract_number_from_array           Set_text_color, 14-12

            SubFrom, 16-30                   TextDir

          Subtract_one_array_from              Set_text_writing_direction,

               another                              14-12

            SUB, 16-30                       TextFont

          subtraction, 9-11                    Set_text_font, 14-12
          SUM
                                             TextSize
            Sum_over_a_period, 16-30
                                               Set_text_size, 14-13
          Sum_over_a_period
                                             Ticker, 10-1
            SUM, 16-30                       TICKER LISTS, 4-7
                                             Ticker_Period, 10-1
          support, 1-3                       Time-Series_Forecast
          suppress result. See Hiding a
               Column of Output                TSF, 23-77
          Suppressing TAS Report
               Heading, 25-2                 TMA
          switches
            See Command Line Options,          Triangular_Moving_Average,
                 3-1
          syntax, 9-1                               23-75

          ------                             Top_Bollinger_Band
          Tab, 15-20
          tab stops, 15-20                     BBandT, 23-56
          TAN
                                             TR
            Trigonometric_Tangent, 16-
                                               Wilder's_True_Range, 23-75
                 30
                                             TrendLine
          TAS Main Menu, 4-1
          Technical Analysis References,       Create_a_Trendline, 23-75
               1-6
          TEST PHASE, 24-3                   TrendPar
          Test_Phase, 10-4
          TextAlign                            Parallel_Trendline, 23-76

            Set_text_alignment, 14-11        Trial Version, 2-2



                                     Index-27-17





                                        Index
          Triangular_Moving_Average            Draw_a_small_up_arrow, 14-

            TMA, 23-75                              13

          Trigonometric_CoSine               Updates to TAS, 1-3
                                             Upgrade Registration Fee, 1-4
            COS, 16-23                       Upgrades to TAS, 1-4

          Trigonometric_sine                 --V---
                                             VAR
            SIN, 16-29
                                               Statistical_Variance, 23-77
          Trigonometric_Tangent
                                             variable, 9-10
            TAN, 16-30                       Variable_Moving_Average

          Trim                                 VMA, 23-78

            Trim_blanks_from_a_string,       variable names, 9-4
                                             Variables, 9-2
                 22-52                       version and release
                                                  identification
          Trim_blanks_from_a_string            Updates to TAS, 1-3
                                             vertical menu, 15-20
            Trim, 22-52                      Vertical_Menu_for_user_input

          TRIM function, 9-7                   VMenu, 15-19
          Triple_Exponential
                                             Vertical/Horizontal_Filter
            TRIX, 23-76
                                               VHF, 23-77
          TRIX
                                             VHF
            Triple_Exponential, 23-76
                                               Vertical/Horizontal_Filter,
          Trough
                                                    23-77
            Find_Trough_in_Array, 18-38
                                             VLine
          TSF
                                               Draw_a_vertical_line, 14-13
            Time-Series_Forecast, 23-77
                                             VMA
          Two_Way_Linear_Regression
                                               Variable_Moving_Average,
            LinReg2, 23-63
                                                    23-78

          --U---                             VMenu
          UpArrow





                                     Index-27-18





                                        Index
            Vertical_Menu_for_user           WILLR

                 input, 15-19                  William's_%R, 23-80

          VOL                                window number, 4-10
                                             Write
            Chaikin's_Volatility, 23-78
                                               Write_to_output_screen, 15-
          Volume_Oscillator
                                                    20
            OSCV, 23-69
                                             Write_Database_record

          ------                               DBWrite, 12-5
          Wait_for_keyboard_input
                                             Write_text_on_graph
            Pause, 15-19
                                               TextAt, 14-12
          warranty, 1-5
          WC                                 Write_to_output_screen

            Weighted_Close, 23-78              Write, 15-20

          weekly compression, 20-44          Write_to_output_screen_with
          WEEKLY data, 4-7
          Weighted_Close                          new_line

            WC, 23-78                          WriteLn, 15-20

          WHILE, 9-2, 21-47                  WriteLn
          WHILE statement, 9-12
          Wilder, 1-6                          Write_to_output_screen_with
          Wilder's_Relative_Strength
                                                    new_line, 15-20
            RSI, 23-72

          Wilder's_True_Range                --Y---
                                             Year
            TR, 23-75
                                               Year_function, 13-7
          WILLA
                                             Year_function
            William's_A/D, 23-78
                                               Year, 13-7
          William's_%R
                                             yearly compression, 20-44
            WILLR, 23-80                     yesterday, 23-62

          William's_A/D                      ------
                                             Zero
            WILLA, 23-78
                                               Zero_Array, 16-30



                                     Index-27-19





                                        Index
          Zero_Array                           ZIG, 23-80

            Zero, 16-30                      zScore

          ZIG                                  Compute_Z-Score_for_array,

            Zig_Zag, 23-80                          16-31

          Zig_Zag














































                                     Index-27-20