Home  |  Get Started  |  Download  |  Donate  |  Contact Us
MetaStock Programming Language

Article by www.meta-formula.com

MetaStock Professional uses a patented programming language that, to the untrained eye, seems more like a foreign language. Some users have even affectionately named it `MetaSpeak'. At first glance it may look intimidating, but MetaStock formula is quite logical in its processes. Consequently, anyone with a bit of persistence can learn to program custom indicators, explorations, system tests and experts.

MetaStock's programming language breaks down into three simple components: parameters (e.g. open, high, low, close, etc.), mathematical operators (e.g. +, -, /, *) and functions (e.g. a moving average, the Stochastic Oscillator or the Relative Strength Index). When combined, they form the foundation of MetaStock's programming language. Essentially this is what drives MetaStock's four major tools: The Indicator Builder, The Explorer, The Expert Advisor and MetaStock TradeSim.

The programming language itself is actually patterned after popular spreadsheet languages. So for those of you who can already create a reasonable spreadsheet you're half way there to understanding `MetaSpeak'. If you can't, don't worry, we will begin with the basics first. You'll be a MetaStock Pro in no time at all.

Parameters - Price Array Identifiers

Let's begin by looking at some parameters called price array identifiers, or price plot MetaStock data. They form the basis of all technical analysis: the open, high, low, close, volume and open interest (shown graphically in Figure 2.1). When used they identify specific price fields that the formula should operate on. Here are some simple definitions:

Open - This is the price of the first trade for the period (e.g., the first trade of the day). When analyzing daily data, the Open is especially important as it is the consensus price after everybody has had a chance to "sleep on it."

High - This is the highest price that the security traded during the period. It is the point at which supply overcame demand. There are always sellers willing to sell at higher prices, but the High represents the highest price buyers were willing to pay.

Low - This is the lowest price that the security traded during the period. It is the point at which demand overcame supply. There are always buyers willing to buy at lower prices, but the Low represents the lowest price sellers were willing to accept.

Close - This is the last price that the security traded during the period. Due to its availability, the Close is the most often used price for analysis. The relationship between the Open (the first price), and the Close (the last price), are considered to be significant by most technical analysts. This relationship is emphasized in candlestick charts.

Volume - This is the number of shares (or contracts) that were traded during the period. The relationship between prices and volume (e.g., increasing prices accompanied by increasing volume) are considered important.

Open Interest - This is the total number of outstanding contracts (i.e., those that have not been exercised, closed, or expired) in relation to futures or options. Open interest is often used as an indicator.

Logical Operators - `And' and `Or'

Logical Operators are a little harder to understand than the other two mathematical operators. Nevertheless, they offer increased coding flexibility. The two logical operators are `and' and `or'. They allow a formula to involve multiple conditions.

Their use is best illustrated by way of example. Let's assume that we wanted a security to exhibit three attributes;: the close to be equal to the high, the open to be equal to the low and the close to be greater than the open (i.e. a bullish period).

Now before a bullish period can exist, we need all three statements to exist. Using the `and' operator we can combine these three conditions. This would effectively link the three statements, requiring that each condition exists. Written in `MetaSpeak' this would look like:

C=H AND O=L AND C>O

Get started today, download MetaStock or to learn more about MetaStock visit www.meta-formula.com

Add URL | Contact Us | Forex Articles | Privacy Policy | Sitemap
COPYRIGHT (C) 2005 WWW.FOREXTRADINGSTRATEGIES.ORG