CloseY (Series Function)
The CloseY function allows you to reference the yearly Close of previous years in an intraday chart (minute
CloseY is a function in a family of functions that allows historical daily, weekly, monthly, and yearly references in intraday charts.
Syntax
CloseY(PeriodsAgo)
Returns (Double)
A numeric value for the current bar. If there is not enough data, the function will return –1.
Parameters
Name |
Type |
Description |
PeriodsAgo |
Numeric |
The number of years/periods back to reference a previous year’s closing price. (0 = This year’s current Close) |
Remarks
With intraday charts, you must have enough intraday data in the chart in order to look back and reference any previous close. For example, if you want to look back at the close of 1 year ago on a 5-minute chart, you must have 1 year of 5-minute 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 equals today’s current Close.
Example
Assigns the Close of the previous year on an intraday chart to Value1, then plots Value1:
Value1 = CloseY(1);
Plot1(Value1, "PrevYClose");