Marking highs and lows based on opening and closing prices.
Forums › ProRealTime English forum › ProBuilder support › Marking highs and lows based on opening and closing prices.
- This topic has 6 replies, 3 voices, and was last updated 29 minutes ago by
theunpredictable.
-
-
12/23/2025 at 9:53 AM #254719
Hi,
Do you have any ideas on how to mark the high and low of a time range, e.g., 8 a.m. to 12 p.m., on the chart?
It is important that the highs and lows are marked only on the basis of the candle bodies, i.e., without wicks and shadows. I wrote it once on a closing price basis. However, it is sometimes the case that the opening prices mark the lower or upper end, and then the line is not correct.
// Dailyreset
IF Day <> Day[1] THEN
hiClose = Close
loClose = Close
ENDIF// Collecting only between 08:00 and 14:30
IF Time >= 080000 AND Time <= 143000 THEN
hiClose = MAX(hiClose, Close)
loClose = MIN(loClose, Close)
ENDIF// Drawing Line from 14:30
IF Time >= 143000 THEN
DRAWSEGMENT(barindex, hiClose, barindex + 1, hiClose) COLOURED(165,42,42)style(dottedline, 3)
DRAWSEGMENT(barindex, loClose, barindex + 1, loClose) COLOURED(165,42,42)style(dottedline, 3)
ENDIF12/23/2025 at 10:33 AM #254720There you go:
12345678910111213141516171819202122// Dailyreset//IF Day <> Day[1] THEN//hiClose = Close//loClose = Close//ENDIF// Collecting only between 08:00 and 12:00IF OpenTime >= 080000 AND OpenTime <= 120000 THENif OpenTime = 080000 THENhiClose = CloseloClose = CloseendifhiClose = MAX(hiClose, Close)loClose = MIN(loClose, Close)ENDIF// Drawing Line from 12:00IF OpenTime >= 120000 THENDRAWSEGMENT(barindex, hiClose, barindex + 1, hiClose) COLOURED(165,42,42)style(dottedline, 3)DRAWSEGMENT(barindex, loClose, barindex + 1, loClose) COLOURED(165,42,42)style(dottedline, 3)ENDIFreturn1 user thanked author for this post.
12/23/2025 at 10:34 AM #254722Please select the correct language. I moved it from the German forum. Thanks 🙂
12/23/2025 at 12:10 PM #254723Hi Roberto,
I probably didn’t express myself clearly.
However, the formula you showed only depicts the range in the period shown on a close basis.
In the image, you can see that the range would be higher if you also wanted to use the open (high, low).
In other words, I want to see the lowest price and the highest price of all candlesticks in the period. I don’t know how to include the open price in the calculation.
12/23/2025 at 12:31 PM #254725i mean, highest and lowest price on basis of candelstick-bodies.
12/23/2025 at 1:14 PM #25472612345678910111213141516171819202122// Dailyreset//IF Day <> Day[1] THEN//hiClose = Close//loClose = Close//ENDIF// Collecting only between 08:00 and 12:00IF OpenTime >= 080000 AND OpenTime <= 120000 THENif OpenTime = 080000 THENhiClose = MAX(Close,Open)loClose = Min(Close,open)endifhiClose = MAX(hiClose, MAX(Close,Open))loClose = MIN(loClose, Min(Close,open))ENDIF// Drawing Line from 12:00IF OpenTime >= 120000 THENDRAWSEGMENT(barindex, hiClose, barindex + 1, hiClose) COLOURED(165,42,42)style(dottedline, 3)DRAWSEGMENT(barindex, loClose, barindex + 1, loClose) COLOURED(165,42,42)style(dottedline, 3)ENDIFreturn12/23/2025 at 2:05 PM #254727That’s it – many thanks Roberto 🙂
-
AuthorPosts
