HIghest High since crossing an MA
Forums › ProRealTime English forum › ProBuilder support › HIghest High since crossing an MA
- This topic has 9 replies, 2 voices, and was last updated 4 years ago by robertogozzi.
-
-
05/20/2020 at 2:23 AM #13232705/20/2020 at 7:13 AM #132337
Not tested:
123456789101112Once MyHigh = 0Once MyLow = 0CrossOver = close crosses over average[200,0](close)CrossUnder = close crosses under average[200,0](close)If CrossOver or CrossUnder ThenMyHigh = highMyLow = lowdrawtext("●",barindex,high+15*pipsize,Dialog,Bold,10) coloured(255,0,0,255)EndifMyHigh = max(MyHigh,high)MyLow = min(MyLow,low)Return MyHigh as “HI”,MyLow as “LO”1 user thanked author for this post.
05/20/2020 at 9:00 AM #132343Many thanks for the code and it works somewhat. What I am trying to do is plot something above the highest high between two crossings. For example, we cross above an MA, stay above for a while, then cross below. I am trying to mark the highest high in that time interval.
05/20/2020 at 9:20 AM #132357Make an example, possibly attaching a screenshot of what you want to see.
05/20/2020 at 9:33 AM #13236405/20/2020 at 11:18 AM #132392(not tested):
1234567891011121314151617Once MyHigh = 0Once MyLow = 0CrossOver = close crosses over average[200,0](close)CrossUnder = close crosses under average[200,0](close)If CrossOver or CrossUnder ThenMyHigh = highMyLow = lowEndifMyHigh = max(MyHigh,high)MyLow = min(MyLow,low)IF MyHigh <> MyHigh[1] THENDrawArrowDown(BarIndex,high + 10 * pipsize) coloured(0,128,0,255)ENDIFIF MyLow <> MyLow[1] THENDrawArrowUP(BarIndex,high + 10 * pipsize) coloured(255,0,0,255)ENDIFReturn1 user thanked author for this post.
05/20/2020 at 12:32 PM #13240305/20/2020 at 1:10 PM #132408Do you need text on crossings, as well?
05/21/2020 at 1:57 AM #132495No that is ok. It seems ProRealTime just does the processing on the last bar so as the bars develop it leaves the arrows behind it. It would be good if the previous arrows could be erased. Currently I am writing over them with white.
05/21/2020 at 7:03 AM #132512There you go:
1234567891011121314151617181920Defparam DrawOnLastBarOnly = trueOnce MyHigh = 0Once MyLow = 0CrossOver = close crosses over average[200,0](close)CrossUnder = close crosses under average[200,0](close)If CrossOver or CrossUnder ThenMyHigh = highMyLow = lowEndifMyHigh = max(MyHigh,high)MyLow = min(MyLow,low)IF MyHigh <> MyHigh[1] THENHiBar = BarIndexENDIFIF MyLow <> MyLow[1] THENLoBar = BarIndexENDIFDrawArrowDown(HiBar,MyHigh + 10 * pipsize) coloured(0,128,0,255)DrawArrowUP(LoBar,MyLow - 10 * pipsize) coloured(255,0,0,255)Return -
AuthorPosts
Find exclusive trading pro-tools on