MetaStock Highest High Value Bars Ago Function

Provided By

The Highest High Value Bars Ago function is a variation on the Highest Bars Ago function, in that it still returns the number of periods that have passed since the highest value in the selected `data array', however MetaStock will only check back to the number of `periods' specified. For example, assume we have two years of history loaded in our chart. If we were to ask MetaStock for the highest high value bars ago with reference to the close, only using 40 periods, it will only search these 40 periods for the highest closing value. It will then count the number of periods since that occurred and return this value.

SYNTAX HHVBars(Data Array, Periods)

Data Array _ The highest value of this data array will be found in the chart, within the specified number of periods.

Periods _ This is how many periods you wish MetaStock to reference when finding the chart's highest value of the data array.


The following formula identifies the highest value that the close has reached in the last 120 periods. The number of periods since this occurred is then returned:


In the formula above:

Data Array = C

Periods = 120


A more useful application of this example could be:


This formula identifies the number of bars that have passed since the highest closing price, within the last 120 periods, was recorded. Metastock then checks whether or not this value is less than 50. (denoted by `<50'). 

Looking at Figure 3.9, we can see this example applied to the chart as an indicator.


Figure 3.9 _ Highest High Value Bars Ago


Construct formulas for the following:

1. Return the number of periods that have passed since the security had its highest volume in the last 55 periods:


2. Ensure that the highest high of the last 20 periods occurred in the last 9 periods:


This article is a small snippet of MetaStock Programming Study Guide...

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

Find Out More About The MetaStock Programming Study Guide Click Here.

copyright 2007