OpenDayOfWeek

Category: Date and time

OpenDayOfWeek is a function in ProBuilder language that returns the day of the week on which the trading session opened for the current bar. This function is useful for strategies that require analysis based on specific days of the week, such as avoiding trades on Mondays or targeting specific market behaviors on Fridays.

Syntax:

OpenDayOfWeek

Example:

if OpenDayOfWeek = 1 then
    // Code to execute if the market opened on Monday
endif

In this example, the if statement checks if the current bar opened on a Monday (where Monday is represented by 1). If true, the code inside the if block will execute.

  • The days of the week are represented by numbers where 1 is Monday and 7 is Sunday.
  • This function can be particularly useful in markets where the opening day behavior significantly differs from other days, allowing traders to tailor their strategies accordingly.

No additional parameters are needed for this function, making it straightforward to use in any trading strategy that considers the day of the week as a factor.

Related Instructions:

  • CurrentDayOfWeek date and time
  • DayOfWeek date and time
  • Logo Logo
    Loading...