Previous years Highest High and Lowest Lows
Forums › ProRealTime English forum › ProBuilder support › Previous years Highest High and Lowest Lows
- This topic has 6 replies, 3 voices, and was last updated 6 years ago by roos.
Tagged: drawtext, yearly, yearly high
-
-
04/06/2017 at 9:29 AM #31210
Hi All, Pls can somone help with how to get the highest highs and lowest lows of the previous years? i have this code but not sure why trying to check if the current weeks bar close is higher than the last year’s highest high doesn’t work all the time?. I’m new to ProRealTime and ProRealCode… 🙂 .
12345TIMEFRAME(WEEKLY)IF YEAR = YEAR[1] THENWk52High = Highest[52](High[1])con7 = Close >= Wk52HighENDIF04/06/2017 at 4:47 PM #31276The code you made is not compatible with ProBuilder, TIMEFRAME keyword is only available for ProScreener.
This is the code of an indicator that can give you the last year high:
123456If Year<>Year[1] thenyearlyHigh = Highest[BarIndex - lastYearBarIndex](High)[1]lastYearBarIndex = BarIndexendifreturn yearlyHigh04/06/2017 at 5:30 PM #31287@Nicolas, as always, THANK YOU!!!
09/19/2018 at 4:52 AM #8082709/19/2018 at 9:00 AM #80841This code should only plot the last year High on the chart. Make sure you have sufficient displayed units for the code to correctly compute.
12345678910111213myline=undefinedIf Year<>Year[1] thenyearlyHigh = Highest[BarIndex - lastYearBarIndex](High)[1]lastYearBarIndex = BarIndexyearTest = yearendifif yeartest = CurrentYear thenmyline = yearlyHIghendifreturn myline1 user thanked author for this post.
09/19/2018 at 9:04 AM #80843Sorry, I forgot the text, here is the modified code:
123456789101112131415defparam drawonlastbaronly=truemyline=undefinedIf Year<>Year[1] thenyearlyHigh = Highest[BarIndex - lastYearBarIndex](High)[1]lastYearBarIndex = BarIndexyearTest = yearendifif yeartest = CurrentYear thenmyline = yearlyHIghdrawtext(" PY High {#myline#}",barindex,myline,dialog,bold,14)endifreturn myline1 user thanked author for this post.
09/20/2018 at 6:48 AM #80943 -
AuthorPosts
Find exclusive trading pro-tools on