MetaStock Lowest Since Bars Ago Function

Provided By www.meta-formula.com

The Lowest Since Bars Ago function is a variation on the Lowest Since function. The difference being that instead of returning the lowest value of the selected `data array' since the `N'th most recent occurrence of a defined expression occurred; it will return how many periods have passed since this last low was achieved. In other words, this function returns the number of periods that have passed since the lowestsince() function returned its value.

SYNTAX LowestSinceBars(Nth, Expression, Data Array)

Nth _ Is the number of occurrences, of the `expression', you wish to refer back to when obtaining the lowest value of the selected data array.

Expression _ The technical condition that you are referring back to.

Data Array _ The lowest value of this data array is returned from the period that the `expression' was true `Nth' number of times ago.

EXAMPLE

The following formula identifies when the closing price last crossed down below a 30 period simple moving average, and from that period onwards, it has found the lowest value that the close has reached. However, rather than returning this value, it has counted the number of periods that have passed since this low was achieved:

LowestSinceBars(1,Cross(Mov(C,30,S),C),C)

In the formula above:

Nth = 1

Expression = Cross(C,Mov(C,30,S))

Data Array = C

APPLICATION

A more useful application of this example could be:

LowestSinceBars(1,Cross(Mov(C,30,S),C),C)<10

This formula, after identifying when the closing price last crossed down below a 30 period simple moving average, has found the lowest value the close has been since then. It has then counted how many periods have passed since that low was achieved and checked that this is less than 10 periods (denoted by `<10'). 

This article is a snippet from the
MetaStock Programming Study Guide...

"Discover The Simple Secret to Make Metastock Easy & Identify Profitable Trades"

Click Here To Find For More About
The MetaStock Programming Study Guide

copyright 2007 www.meta-formula.com