Day

Category: Date and time

The Day function in ProBuilder language is used to retrieve the day of the month from a specific bar on the chart. This function is particularly useful for analyzing data on a day-by-day basis within a given month. The output is formatted as a two-digit day number (DD).

Syntax:

Day[N]

Where N specifies the bar index relative to the current bar. N can be 0 (the current bar), a positive integer (N bars back), or a negative integer (N bars forward).

Example:

myDay = Day[1]  // Retrieves the day of the month from the previous bar
RETURN myDay

This example demonstrates how to use the Day function to get the day of the month from the previous bar and return it. This can be useful for creating date-based conditions in trading strategies or for data analysis purposes.

Additional Information:

  • The Day function only provides the day of the month and does not include any information about the month or year.
  • It is important to handle the edge cases around the beginning and end of months, especially when using indices that might reference a bar outside the current month.

Understanding the Day function is essential for date-specific analysis in financial markets, helping to align trading strategies with calendar days.

Related Instructions:

  • OpenDay date and time
  • Logo Logo
    Loading...