The Highest Since Bars Ago function is a variation on the Highest Since function. The difference being that instead of returning the highest value of the selected `data array’ since the `N’th most recent occurrence of a defined expression occurred, it will return the number of periods have passed since this last high was achieved. In other words, this function returns the number of periods that have passed since the highestsince() function returned its value.
SYNTAX HighestSinceBars(Nth, Expression, Data Array)
Nth _ Is the number of occurrences, of the `expression’, you wish to refer back to when obtaining the highest value of the selected data array.
Expression _ The technical condition that you are referring back to.
Data Array _ The highest value of this data array is returned from the period that the `expression’ was true `Nth’ number of times ago.
EXAMPLE
The following MetaStock Pro formula identifies when the closing price last crossed a 34 period weighted moving average, and from that period onwards, it has found the highest value that the close has reached. However, rather than returning this value, it has counted the number of periods that have passed since this high was achieved:
HighestSinceBars(1,Cross(C,Mov(C,34,W)),C)
In the formula above:
Nth = 1
Expression = Cross(C,Mov(C,34,W))
Data Array = C
APPLICATION
A more useful application of this example could be:
HighestSinceBars(1,Cross(C,Mov(C,34,W)),C)<8
This formula, after identifying when the closing price last crossed a 34 period weighted moving average, has found the highest value the close has reached since then. The formula then stipulates that the number of periods that have passed, must be less than 8 periods (denoted by `<8′).
Watch the following video for more MetaStock tips and tricks: