This ProBuilder code snippet is designed to find the bar with the highest high value over the last 20 bars and capture the corresponding date, time, and bar index. This can be useful for analyzing price movements in trading data.
Use a loop.
HighCheck = Highest[20](High)
for a = 0 to 19
if high[a] = highcheck then
mydate = date[a]
mytime = time[a]
mybarindex = barindex - a
break
endif
next
Explanation of the Code:
This snippet is a practical example of using loops and conditional statements to analyze data points within a specific window in financial data sets.
Check out this related content for more information:
https://www.prorealcode.com/topic/capture-variables-of-highest-high/#post-134542
Visit Link