VolumeYear (Function)
The VolumeYear function allows you to reference the yearly Volume in an intraday, daily, weekly, or monthly chart (minute
VolumeYear is part of a family of functions that allows historical daily, weekly, monthly, and yearly references in intraday charts.
Syntax
VolumeYear(NumYearsAgo)
Returns (Double)
A numeric value for the requested year. The function returns -1 for a data error and -2 for an unsupported chart type.
Parameters
Name |
Type |
Description |
NumYearsAgo |
Numeric |
The number of years back to reference a previous year's volume. |
Remarks
You must have enough intraday data in the chart in order to look back and reference any previous volume. For example, if you want to look back at the volume of 5 years ago on a 1-day chart, you must have 5 years of 1-day bars in the chart.
The value for the NumYearsAgo input parameter should always be a whole number greater than or equal to 0. Setting NumYearsAgo to 0 equals the current year's volume.
Example
Assigns the Volume of the previous year on an intraday chart to Value1, then plots Value1:
Value1 = VolumeYear(1);
Plot1(Value1, "VolumeYear");
See Also
CloseSession, HighSession, LowSession, OpenSession, VolumeDay, VolumeMonth, VolumeWeek, and VolumeSession.