The MetaStock formula language is a special programming language used to define and create custom indicators, system tests, explorations, and experts. It is patterned after popular spreadsheet languages.
In its simplest form, the MetaStock formula language is comprised of high-level functions (e.g., mov(), rsi(), abs() ), mathematical operators (e.g., +, -, /, *), and parameters (open, high, low, close, etc.). Each of these basic components can be combined to create your own indicators with the Indicator Builder, backtest your trading ideas with the Enhanced System Tester, rank and filter your securities with The Explorer, and generate chart-specific feedback with the Expert Advisor.
In order to effectively use the Indicator Builder, Enhanced System Tester, Explorer, or Expert Advisor, you need to be familiar with the MetaStock formula language. The MetaStock formula language is the foundation and common link for each of these four tools.
The Indicator Builder will be used in this chapter to teach the MetaStock formula language. For specific tutorials on each of the four formula-based tools, refer to their specific chapters.
For information on the Equis Solution Provider program and the MetaStock Developers Kit, go to http://www.equis.com.
Price Array Identifiers:
One of the most basic building blocks of a formula is called a price array identifier. A price array identifier "identifies" specific price fields that the formula should operate on. The valid price array identifiers are open, high, low, close, volume, open interest, and indicator.
Price array identifiers can be abbreviated as shown in the following table. Note that these are not case-specific.
Long Name Abbreviation © Open O High H Low L Close C Volume V
Open Interest OI Indicator P
Previous Value PREV
Examples of the use of price array