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).
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).
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.
Understanding the Day function is essential for date-specific analysis in financial markets, helping to align trading strategies with calendar days.