This ProBuilder code snippet is designed to track the highest high value of a stock or asset within a specific time range during the trading day. It is particularly useful for analyzing price movements within constrained time frames.
IF OpenTime = 140000 Then
MyHighest = high
Endif
If OpenTime > 140000 and OpenTime <= 160000 Then
MyHighest = max(MyHighest, high)
Endif
Explanation of the Code:
IF OpenTime = 140000.MyHighest is set to the high of the current candle with MyHighest = high.If OpenTime > 140000 and OpenTime <= 160000.MyHighest is updated to the maximum value between its current value and the high of the current candle. This is achieved with MyHighest = max(MyHighest, high).This code is useful for traders or analysts who need to track the highest price level during a specific part of the trading day, such as between 2:00 PM and 4:00 PM. It is important to note that the effectiveness of this code depends on the time frame of the candles being used. For instance, using a time frame that does not align with the specified times (like a 4-hour or 7-minute time frame) might not yield the expected results.
Check out this related content for more information:
https://www.prorealcode.com/topic/highest-lowest-price-after-defined-time/#post-114389
Visit Link