Help – Previous Hourly High/Low (Intraday)
Forums › ProRealTime English forum › ProBuilder support › Help – Previous Hourly High/Low (Intraday)
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by
vetrader.
Tagged: Low, Previous High
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
03/25/2019 at 9:05 AM #94579
Hallo,
I need help for previous hourly high/low. The code below doesn’t show the correct high/low for the second hour after opening – tried with Futures and Stocks. It is also strange that the plot has to be moved at return with hourlyhigh [1]. Everything else seems to work fine. Please have a look…
Best regards
123456789101112131415161718//Previous Hourly High/Lowonce hourhigh=undefinedonce hourlow=undefinedhhigh= high[0]hlow= low[0]if Hour <> Hour[1] thenhourhigh = Highest[BarIndex – lastHourBarIndex](hhigh)hourlow = Lowest[BarIndex – lastHourBarIndex](hlow)lastHourBarIndex = BarIndexif Day <> Day[1] thenhourhigh = hourhigh[1]hourlow = hourlow[1]endifendifreturn hourhigh[1] coloured(0,0,0) style(line,1) as “Prev Hour High”, hourlow[1] coloured(0,0,0) style(line,1) as “Prev Hour Low”03/25/2019 at 9:35 AM #94580To write code, please use the <> “insert PRT code” button, to make code more readable. Thank you.
03/25/2019 at 9:59 AM #94586Try this one:
1234567891011//Previous Hourly High/Lowdefparam calculateonlastbars=1000if OpenHour <> OpenHour[1] thenPreviousHigh = hourhighPreviousLow = hourlowhourhigh = 0hourlow = 999999endifhourhigh = max(hourhigh,high)hourlow = min(hourlow,low)return PreviousHigh coloured(0,0,0) style(line,1) as "Prev Hour High", PreviousLow coloured(0,0,0) style(line,1) as "Prev Hour Low"1 user thanked author for this post.
03/25/2019 at 10:51 AM #9461403/25/2019 at 11:00 AM #94620The solution is to remove that line, it only limits the calculation for that bars quantity, that’s all.
1 user thanked author for this post.
03/25/2019 at 6:16 PM #94681 -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)