The Today function in ProBuilder language is used to retrieve the date of a specific bar in the past relative to the current trading day. This function is particularly useful for back-testing strategies where the date of the bar needs to be known for analysis or decision-making processes.
Today[N]
Here, N represents the number of trading periods (days) before the current bar. The value of N must be a non-negative integer, where Today[0] refers to the current day.
// Retrieve the date 10 trading days ago
previousDate = Today[10]
RETURN previousDate
This example demonstrates how to use the Today function to find out the date 10 trading days prior to the current day. The result, previousDate, will be in the format YYYYMMDD.
Understanding the Today function is essential for creating time-sensitive trading strategies and performing historical data analysis in the ProBuilder programming environment.