Today

Category: Date and time

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.

Syntax:

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.

Example:

// 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.

Additional Information:

  • The Today function only considers trading days, excluding weekends and market holidays, which are not counted in the index N.
  • It is important to ensure that N does not exceed the available historical data range in your trading platform to avoid errors.
  • The function returns the date in a numeric format (YYYYMMDD), which can be used for date comparisons or transformations within your trading script.

Understanding the Today function is essential for creating time-sensitive trading strategies and performing historical data analysis in the ProBuilder programming environment.

Logo Logo
Loading...