Formula Language
Custom indicators, system tests, explorations, and expert advisors are written using the MetaStock Formula Language. Loosely patterned after the Microsoft Excel formula language, the MetaStock Formula Language is tailored to the mathematics of technical analysis. There are 267 functions. Formulas can contain up to 2,500 characters (1,024 in the System Tester). A formula that computes the difference between a 39-day and 200-day simple moving average is shown below:
mov(close, 39, simple) – mov(close, 200, simple)
Formulas can also contain conditional statements using IF/THEN/ELSE as shown below:
If(close > mov(close,200,exponential),1, -1)
This would read as “if the close is greater than a 200-day exponential moving average then plot a 1, else plot a -1. Formulas can use variables as shown below:
X:= 39; Y:=200; mov(close, X, simple) – mov(close, Y, simple)
Formulas can prompt the user for input when plotted as follows: X:= Input(“How many periods for the moving average?”, 10, 200, 40); Mov(close,X,simple)
The variable X can range from 10 to 200 with a default value of 40. The value represented by the variable X is substituted in the moving average formula.
Read more about this topic: Meta Stock
Famous quotes containing the words formula and/or language:
“I feel like a white granular mass of amorphous crystalsmy formula appears to be isomeric with Spasmotoxin. My aurochloride precipitates into beautiful prismatic needles. My Platinochloride develops octohedron crystals,with a fine blue florescence. My physiological action is not indifferent. One millionth of a grain injected under the skin of a frog produced instantaneous death accompanied by an orange blossom odor.”
—Lafcadio Hearn (18501904)
“This is of the loonI do not mean its laugh, but its looning,is a long-drawn call, as it were, sometimes singularly human to my ear,hoo-hoo-ooooo, like the hallooing of a man on a very high key, having thrown his voice into his head. I have heard a sound exactly like it when breathing heavily through my own nostrils, half awake at ten at night, suggesting my affinity to the loon; as if its language were but a dialect of my own, after all.”
—Henry David Thoreau (18171862)