OpenYear

Category: Date and time

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.

Syntax:

OpenYear

Example:

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.

Additional Information:

  • The OpenYear function does not require any parameters.
  • It returns an integer representing the year (e.g., 2023).
  • This function can be particularly useful in scripts that need to perform operations based on the year, such as generating annual reports or comparing performance across different years.

Understanding the use of OpenYear can help in creating more dynamic and time-sensitive trading strategies in ProBuilder.

Related Instructions:

  • CurrentYear date and time
  • Year date and time
  • Logo Logo
    Loading...