The IntradayBarIndex function in ProBuilder language is designed to count the number of bars that have been displayed within a single trading day, starting from the beginning of the day. This function is particularly useful for intraday analysis, allowing traders and analysts to determine the position of a specific bar within the day’s trading session.
IntradayBarIndex[N]
Where N is an optional parameter that specifies the number of days to shift back. If N is not provided, the function will consider the current trading day.
RETURN IntradayBarIndex
This example returns the index of the current bar within today’s trading session. For instance, if it’s the 50th bar of the day, the function will return 49 (as counting starts from 0).
IntradayBarIndex[1] would provide the index of bars by offset.Understanding the position of a bar within a day can help in analyzing the market’s intraday volatility and price patterns, making IntradayBarIndex a valuable tool for day traders.