OpenYear is a function in ProBuilder language that returns the year in which the trading session opened for the current bar. This function is useful for analyzing data across different years or for identifying patterns and trends that occur annually.
OpenYear
yearOpened = OpenYear
RETURN yearOpened
This example defines a variable yearOpened that stores the year of the session’s opening for the current bar. It then returns this year to the indicator window, providing a simple way to track the opening year of the trading session.
Understanding the use of OpenYear can help in creating more dynamic and time-sensitive trading strategies in ProBuilder.