Functions
year()
The year of a time you supply. Eight functions of this shape exist, each taking a time and a timezone, and both arguments are required. The variable of the same name reads the current bar instead.
Syntax
year(series int time, series string timezone) → series int
Arguments
time required series int timezone series string Return Type
series int Example
//@lipi=2
indicator("Year Function Example", overlay=true)
// Get current bar year
currentYear = year(time)
// Plot year in Data Window
plot(currentYear, title="Current Year")