[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TradeStation to MetaStock



PureBytes Links

Trading Reference Links

Herewith - lowest is equivalent to highest.

The IFF function is used for conditional statements, and is one of the most
important functions because indicators and functions are designed to
calculate values, and in the case of indicators also plot those valuesthey
are not designed to perform conditional checks. However, by using the IFF
function, you are able to check one or more conditions and if the COND
parameter is true, return one value, and if the COND parameter is false,
return another value.

Function

IFF(COND,TVALUE,FVALUE)

Parameters

COND expression to check (i.e., Close > Open)
TVALUE value if COND expression is true
FVALUE value if COND expression is false
Returns

TVALUE if COND is true; FVALUE if COND is false.

Usage

This function has three parameters. The first parameter is COND which stands
for condition. This refers to a True/False conditional statement.
An example of a conditional statement is: Is Todays bar an outside bar? If
it is an outside bar, then the statement is true. If it is not an outside
bar, then the statement is false.
The second parameter is TVALUE, which refers to the action you want to take
if the parameter COND is evaluated as being true. The third parameter is
FVALUE, which refers to the action you want to take if the parameter COND is
evaluated as being false.

Reference

The IFF function was developed by Omega Research, Inc.

{** ) 1987, 1999 Omega Research, Inc. **}


The Highest function is designed to return the highest value found when
applying the parameter PRICE over a period of time defined by the parameter
LENGTH.

Function

Highest(PRICE,LENGTH)

Parameters

PRICE specifies which price of the asset of interest is to be used
LENGTH the number of trailing bars to consider
Returns

A numeric value containing the highest PRICE found for the past N bars.

Usage

To understand the function we must understand its parameters. The parameter
PRICE is usually hard coded with some bar attribute such as Close, Open,
High, Low, and Volume or is replaced with a numeric series type input.
However, it can also be replaced with a valid EasyLanguage expression. For
example, Close + Open or Average(RSI(Close,14),14).
The parameter LENGTH, just like PRICE, can be hard coded or can be replaced
with a numeric simple type input. The value is usually a positive whole
number such as 5, 10, 14 etc. Once again you may choose to replace LENGTH
with a valid numeric expression. If you do decide to make it a numeric
expression, keep in mind that LENGTH should be a positive whole number and
cannot change on a bar-to-bar basis as can the value PRICE.

For the sake of simplicity, lets look at how the function works with Close
for the PRICE and 14 for LENGTH. For each bar, the function returns the
highest Close over the previous 14 trailing bars. There may be times when
two or more bars tie for the highest value. When this happens, the function
returns the PRICE for the most recent bar.
A common usage of the Highest function is to find a breakout. For example,
an important occurrence is when the value of the PRICE parameter for the
current bar is the highest value over the last x bars. Many people encounter
a problem when using the function to find a breakout because they forget to
remove the current bar from the function. The statement they usually enter
is Close>Highest(Close, 14). The problem with this statement is that it will
never be evaluated as true. Lets assume that the Close of the current bar
was also the highest Close over the last fourteen bars, this would only
equate the two sides of the expression. Therefore to overcome this problem
you must exclude the last bar from the calculation of the function. This is
done by offsetting the function by one bar. Thus, you will be comparing the
Close of the current bar with the value returned by the Highest function for
the previous bar. The corrected statement is Close>Highest(Close,14)[1].

{** ) 1987, 1999 Omega Research, Inc. **}


The function returns the difference between a fast and slow moving average
based on the same PRICE.

Function

MACD(PRICE,FASTMA,SLOWMA)

Parameters

PRICE specifies which price of the asset to be used
FASTMA number of trailing bars to consider for the fast average
SLOWMA number of trailing bars to consider for the slow average
Returns

A numeric value containing MACD for the current bar.

Usage

When the function is used in a study or strategy, PRICE, FASTMA, and SLOWMA
can either be hard coded or replaced with a variable. The parameter PRICE is
usually hard coded with some bar attribute such as Close, Open, High, Low,
and Volume, or is replaced with a numeric series type input. However, it can
be replaced with a valid EasyLanguage expression such as Close + Open or
Average(RSI(Close,14),14).
FASTMA and SLOWMA refer to the number of bars used in the moving averages.
Therefore, if hard coded, the value used to replace these two parameters
should be a whole number and cannot change on a bar-by-bar basis. FASTMA
should be less than SLOWMA. If the specified length of FASTMA is greater
than that of the SLOWMA, the oscillator will invert.

During rising markets, the fast period moving average will rise faster than
the slow period moving average resulting in a rising differential line or a
larger value. The idea is that with a smaller number of bars used in its
calculation, the fast period moving average will more quickly indicate the
trend of the most recent data.
When the fast period moving average crosses above or crosses below the slow
period moving average, a signal is generated. Once the lines cross, it
becomes important to look at the distance between them. The MACD function
returns that difference. When the fast period moving average is above the
slow period moving average, the MACD is positive and when it is below the
slow period moving average the MACD is negative.

Reference

Gerald Appel, Signalert Corporation, 150 Great Neck Road, Great Neck, NY
11021

{** ) 1987, 1999 Omega Research, Inc. **}






----- Original Message -----
From: "Ron" <ronber@xxxxxxxxxxxxx>
To: <metastock@xxxxxxxxxxxxx>
Sent: Monday, May 27, 2002 1:08 AM
Subject: Re: TradeStation to MetaStock


> David,
>
> I'm trying to translate some EasyLanguage code that appears in Price
> Headley 's Big trends in Trading. I don't know if there are any copy
> rught issues in posting the code here. It's fairly lengthy. I believe I
> can get it if I had the syntax of the terms I posted.
>
> TIA
> Ron
>
> David Jennings wrote:
>
> >Ron,
> >Can't remember yr. earlier posts, so forgive me. IFF, highest, lowest and
> >MACD are cetainly part of the Easy Laguage vocabulary. Pl. remind me what
> >you are trying to do and I'll help if I can.
> >----- Original Message -----
> >From: "Ron" <ronber@xxxxxxxxxxxxx>
> >To: <metastock@xxxxxxxxxxxxx>
> >Sent: Sunday, May 26, 2002 1:23 PM
> >Subject: TradeStation to MetaStock
> >
> >
> >>Hi all -
> >>
> >>The EasyLanguage pdf doesn't have the following terms' syntax
> >>
> >>IFF
> >>Highest
> >>Lowest
> >>MACD
> >>
> >>
> >>I think MACD is  the same as the "customized" MACD discussed here
> >>earleir.. If somebody  would provide the synatax and the equivaent
> >>MetaStock expressions, I'd appreciate it.
> >>
> >>TIA
> >>Ron
> >>
> >>>
> >>>
> >>>
> >>
> >
> >
> >
>
>