MetaStock Professional Functions

Article by www.meta-formula.com


Introduction

In addition to the mathematical operators there are over 200 MetaStock Professional pre-programmed functions to allow coding versatility. The bulk of these fall into three categories: analysis tools, indicators and candlesticks. In this chapter we'll look at each of these categories in detail, highlighting some of the more commonly used functions. Moreover, we'll provide specific explanations, applications, and questions about these functions.

Before we begin though, we must explain what function parameters are, and where they're used. A function is a set of predefined mathematical operations that MetaStock follows; and a parameter provides a function with the necessary information it needs to calculate these predefined mathematical operations. Some functions need no parameters; whereas others need numerous.

Let's look at a couple of examples; the actual parameters are in bold, to make them identifiable.

(These examples are only used to highlight what parameters are and where they are used).

ATR(14)

This formula calculates a 14-period Average True Range. The only parameter required is the number of periods (14). The ATR syntax is `ATR(Periods)', and this is further explained on page 84.

Mov(C,7,S)

This MetaStock formula plots a 7-period simple moving average. The parameters include the data array (c), periods (7) and moving average type constant (s). Notice that when a function has multiple parameters each parameter is separated by commas. The moving average syntax is `Mov(Data Array, Periods, Constant)', and this is further explained on page 92.

In this last example, we have introduced the idea that there are different types of parameters. Some of these may be specific to a particular function, while others are more universal. The price data array parameter, which we are already familiar with (refer to page 18, table 2.1), and the periods parameter which we just introduced in the moving average example, are the most universal parameters.

Periods refer to a single value, or a numeric constant, that determines the time period of a function. For example, a `periods parameter' is the `7' in the formula `Mov(C,7,S)'. This indicates that the moving average is a seven period average. This MetaStock data can then be used in its computations.

The other not so common parameters will be discussed as they arise in their respective functions. Please note, these parameters can also be tested using MetaStock and TradeSim.

Pasting Functions

As you could imagine with over MetaStock 200 pre-programmed functions it would be next to impossible to memorise every parameter and its correct syntax. As such Metastock has included a `Paste Functions' dialog box. This allows you to paste the correct syntax straight into any formula you may be working on. Simply by clicking the functions button while editing any formula, you will display this dialog. (Note: your cursor must be within the `formula:' dialog for the `Functions…' button to become active).

The `Paste Functions' dialog groups all of the functions into 11 categories; these are listed on the left-hand side. On the right-hand side, the function names are listed. Also, at the bottom left of this dialog are two check boxes, `Paste Arguments' and `Show English Names'. `Paste Arguments' instructs MetaStock Pro to include all the parameters required for the function. `Show English Names' instructs MetaStock to list the English names, rather than the function names. For ease of use, it's best if both these boxes are checked.

Once we begin programming you will become quite familiar with this dialog box. When you require any formula's syntax, simply scroll the `Paste Function' list and the syntax of the highlighted function is displayed near the bottom of the dialog (shown under `Format'). Then, by clicking the `OK' button (or double-clicking the function name), the selected function is pasted into the formula at the cursor location. If for some reason you do make a mistake and forget to insert the correct parameter, even though you have used the `Paste Functions' dialog; don't worry as MetaStock will display a dialog reminding you of the expected parameter.

Would you like to learn more about MetaStock and read our Metastock Review? Visit www.meta-formula.com


COPYRIGHT (C) 2005 www.freetradingsystems.org