How do I draw opening range lines?
Forums › ProRealTime English forum › ProBuilder support › How do I draw opening range lines?
- This topic has 6 replies, 4 voices, and was last updated 3 years ago by RubberToe.
-
-
04/03/2021 at 5:40 PM #166109
I just want to draw two lines, the high and low of the live trading day from a timestamp. Essentially ORB at 45 minutes from market open. I’ve been modifying this indicator many ways, but I just can’t get anywhere with it, and I’m losing my mind. This should be simple…
https://www.prorealcode.com/prorealtime-indicators/open-range-breakout-indicator-orb/
04/04/2021 at 8:10 AM #166149RubberToe – ‘Struggling with a simple task’ is not a meaningful title. Your title has been edited.
- Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.
04/04/2021 at 9:33 AM #166151There you go, just change the time as best fits you:
123456789101112131415161718192021222324once maxii=undefinedonce minii=undefinedonce maxi1=undefinedonce mini1=undefinedonce maxi2=undefinedonce mini2=undefinedonce maxi3=undefinedonce mini3=undefinedif time=090000 thenmaxi=highmini=lowEndifmaxi=max(high,maxi)mini=min(low,mini)lerange=(maxi-mini)/2maxii=maximinii=minimaxi1=maxi+lerangemini1=mini-lerangemaxi2=maxi+2*lerangemini2=mini-2*lerangemaxi3=maxi+3*lerangemini3=mini-3*lerangereturn maxii as "Maxi première heure de cotation", minii as "Mini première heure de cotation", maxi1 as "Maxi1" ,mini1 as "Mini1",maxi2 as "Maxi2" ,mini2 as "Mini2",maxi3 as "Maxi3" ,mini3 as "Mini3"04/04/2021 at 3:47 PM #166164Thank you for looking at this, but we are hitting the same problem.
The lines are still draw dynamically throughout the trend, but I only need two static lines set off the highest/lowest price in the first 30 minutes after the open. The lines would start at a time (for example 11:00 am EST and stop at the end of the trading day.
I’ve been trying the DRAWSEGMENT command, but I can’t find good examples and the documentation is pretty thin…
04/04/2021 at 4:33 PM #166169OK, some success. I modified the code and set to 30 minute timeframe, which seems to do the range nicely. Now I need a way to not draw the line for those first 30 minutes….
123456789101112131415161718192021222324252627once maxii=undefinedonce minii=undefined//once maxi1=undefined//once mini1=undefined//once maxi2=undefined// mini2=undefined//once maxi3=undefined//once mini3=undefinedtimeframe(30mn)if time=110000 thenmaxi=highmini=lowEndif//maxi=max(high,maxi)//mini=min(low,mini)//lerange=(maxi-mini)/2maxii=maximinii=mini//maxi1=maxi+lerange//mini1=mini-lerange//maxi2=maxi+2*lerange//mini2=mini-2*lerange//maxi3=maxi+3*lerange//mini3=mini-3*lerangereturn maxii as "Maxi première heure de cotation", minii as "Mini première heure de cotation"//, maxi1 as "Maxi1" ,mini1 as "Mini1",maxi2 as "Maxi2" ,mini2 as "Mini2",maxi3 as "Maxi3" ,mini3 as "Mini3"04/04/2021 at 8:32 PM #166174how about this little code (just change the ORB and end of session times that fits you) :
OpenRange Max-Min12345678910111213141516orbstart = 090000orbend = 110000endsession = 174500if opentime = orbstart thenORBH = highORBL = lowendifif opentime >= orbstart and opentime <= orbend thenORBH = max(high,ORBH)ORBL = min(low,ORBL)endifalpha = 255 * (opentime > orbend and opentime <= endsession)return ORBH coloured(0,0,0, alpha) as "ORB HIGH" , ORBL coloured(0,0,0, alpha) AS "ORB LOW"1 user thanked author for this post.
04/04/2021 at 11:50 PM #166184 -
AuthorPosts
Find exclusive trading pro-tools on