The Days function in ProBuilder language is used to calculate the number of days that have elapsed since January 1, 1900, up to the date represented at a specific bar on the chart. This function is particularly useful for analyzing time series data in financial markets, allowing traders and analysts to quantify the time span in days between significant market events and the reference date of January 1, 1900.
Days[N]
Where N represents the index of the bar for which the day count is calculated. N can be any integer, where 0 refers to the current bar, 1 refers to the previous bar, and so on.
myDays = Days[0]
RETURN myDays
This example calculates the number of days from January 1, 1900, to the date of the current bar on the chart and returns this information. This can be useful for tracking how long a particular stock or asset has been traded or for marking specific anniversaries or milestones related to the asset.
Understanding the Days function can enhance your ability to perform detailed time-based analysis on financial data, making it a valuable tool in the ProBuilder programming environment.