HighY (Function)
The HighY series function allows you to reference the yearly high of a previous year in an intraday chart (minute or tick-based) or a daily or yearly chart. HighY is one of a family of functions that allows historical references across various data intervals.
Syntax
HighY(PeriodsAgo)
Returns (Double)
The yearly high 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 high price. (0 = This year's current high) |
Remarks
You must have enough intraday data in the chart in order to look back and reference any previous yearly high. For example, if you want to look back at the high 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 year’s current high.
Example
In order to place a sell short limit order at the High of the previous year you would write
SellShort Next Bar at HighY(1) Limit;