Daily Range boxes at three different time periods in one indicator Tradingview
Forums › ProRealTime English forum › ProBuilder support › Daily Range boxes at three different time periods in one indicator Tradingview
- This topic has 6 replies, 2 voices, and was last updated 1 year ago by TraderGlyn.
-
-
12/18/2022 at 10:04 PM #206002
Hi,
I would be most grateful if this indicator could be coded for PRT or if not feedback as to how to create something with a similar function.
It creates three range boxes at three different hourly periods within 24h ( 0930-1025,0300-0355, 1930-2025) highlighting the high and low of price and within each box the highest candle close is marked with a dotted line. Lines extend forward from the high and low into following time periods and includes options to adjust time range, colours, style labels and lines.
Thanks!
12/19/2022 at 9:41 AM #206018I also have the NT8 code for this, if that is better to look at.
12/20/2022 at 10:35 PM #206107Hi @TraderGlyn
I can draw the three “range boxes” at the different times but the lines are a problem (for me?) because the lines can be drawn but once drawn they can not be removed in PRT…
Maybe a start…
Regards Jaap
The Mas7er Scalp 5 min1234567891011121314151617181920212223242526272829303132333435363738394041424344454647If IntraDayBarIndex = 0 thenx0300=0x0930=0x1930=0EndIfIf OpenTime = 035500 and x0300=0 thenHH = Highest[12](High)LL = Lowest[12](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0300=1EndIfIf OpenTime = 102500 and x0930=0 thenHH = Highest[12](High)LL = Lowest[12](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0930=1EndIfIf OpenTime = 202500 and x1930=0 thenHH = Highest[12](High)LL = Lowest[12](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x1930=1EndIfReturn2 users thanked author for this post.
01/07/2023 at 2:16 PM #206999This has proven very useful and is a great “start” thank you very much indeed.
I enquired about getting the complete code created by PRT but unfortunately the cost is prohibitive for me at this time.
One issue I am totally baffled about…
I am trying to get the range box to appear on other time frames, particularly the 1 minute. I have studied the probuilder documents and cannot work out how to make this happen. It could be it is not possible but I thought that multi time frame adaptations was available now?
Would greatly appreciate any solution.
01/07/2023 at 3:44 PM #20700501/07/2023 at 10:02 PM #207014Hi @TraderGlyn
Here is the indicator for use in a time frame of 5 minutes and a time frame of 1 minute…
Officially they are not multiple time frames because drawn objects in multiple time frames cause problems (with me?) but I solved it in a different way with “GetTimeFrame”…
The Mas7er Scalp TF 5min-1min123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596If IntraDayBarIndex = 0 thenx0300=0x0930=0x1930=0EndIfxTF = GetTimeFrameIf xTF=300 thenIf OpenTime = 035500 and x0300=0 thenHH = Highest[11](High)LL = Lowest[11](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0300=1EndIfIf OpenTime = 102500 and x0930=0 thenHH = Highest[11](High)LL = Lowest[11](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0930=1EndIfIf OpenTime = 202500 and x1930=0 thenHH = Highest[11](High)LL = Lowest[11](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-11,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-12,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-12,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-12,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-12,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x1930=1EndIfEndIfIf xTF=60 thenIf OpenTime = 035500 and x0300=0 thenHH = Highest[55](High)LL = Lowest[55](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-55,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-60,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-60,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-60,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-60,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0300=1EndIfIf OpenTime = 102500 and x0930=0 thenHH = Highest[55](High)LL = Lowest[55](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-55,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-60,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-60,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-60,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-60,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x0930=1EndIfIf OpenTime = 202500 and x1930=0 thenHH = Highest[55](High)LL = Lowest[55](Low)xBarIndex = BarIndexDrawRectangle(xBarIndex-55,LL,xBarIndex,HH) Coloured(0,255,0)DrawSegment(xBarIndex-60,HH,xBarIndex,HH)Coloured(0,255,0)DrawSegment(xBarIndex-60,LL,xBarIndex,LL)Coloured(255,0,0)DrawText("High=#HH#",xBarIndex-60,HH+5*pipsize)Coloured(0,255,0)DrawText("Low=#LL#",xBarIndex-60,LL-5*pipsize)Coloured(255,0,0)//DrawRay(xBarIndex,HH,xBarIndex+1,HH)Coloured(0,255,0)Style(DottedLine)//DrawRay(xBarIndex,LL,xBarIndex+1,LL)Coloured(255,0,0)Style(DottedLine)x1930=1EndIfEndIfReturn2 users thanked author for this post.
01/08/2023 at 1:07 PM #207053Hi JS,
This is excellent and works perfectly!
Thanks for being so generous with your time and skills, really appreciate.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on