Help – Previous Hourly High/Low (Intraday)
- This topic has 5 replies, 3 voices, and was last updated 6 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Help – Previous Hourly High/Low (Intraday)
Tagged: Low, Previous High
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
//Previous Hourly High/Low once hourhigh=undefined once hourlow=undefined hhigh= high[0] hlow= low[0] if Hour <> Hour[1] then hourhigh = Highest[BarIndex – lastHourBarIndex](hhigh) hourlow = Lowest[BarIndex – lastHourBarIndex](hlow) lastHourBarIndex = BarIndex if Day <> Day[1] then hourhigh = hourhigh[1] hourlow = hourlow[1] endif endif return 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” |
To write code, please use the <> “insert PRT code” button, to make code more readable. Thank you.
Try this one:
1 2 3 4 5 6 7 8 9 10 11 |
//Previous Hourly High/Low defparam calculateonlastbars=1000 if OpenHour <> OpenHour[1] then PreviousHigh = hourhigh PreviousLow = hourlow hourhigh = 0 hourlow = 999999 endif hourhigh = 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" |
The solution is to remove that line, it only limits the calculation for that bars quantity, that’s all.
Find exclusive trading pro-tools on