OpenY (Function)

image\trumpet2.gif Disclaimer

The OpenYseries function allows you to reference the yearly open of a previous year in an intraday chart (minute, second, or tick-based) or a daily or yearly chart.  OpenY is one of a family of functions that allows historical references across various data intervals.

Syntax

OpenY(PeriodsAgo)

Returns (Double)

The yearly open price from a specified number of years ago.  If there is not enough data, the function will return –1.

Parameters

Name

Type

Description

PeriodsAgo

Numeric

Sets the number of years back to reference a previous year’s open price. (0 = This year's current open)

Remarks

You must have enough intraday data in the chart in order to look back and reference any previous yearly open. For example, if you want to look back at the open of 7 years ago on a daily chart, you must have at least 8 full years of daily bars in the chart.

The value for the PeriodsAgo input parameter should always be a whole number greater than or equal to 0. Setting PeriodsAgo to 0 returns this week’s current open.

Example

In order to place a buy limit order at the open of the previous year you would write:

Buy Next Bar at OpenY(1) Limit;

See Also

LowY, CloseY, HighY,  HighD,  HighW and HighM.