Original basis was Pre-Market EUR/USA (Opening Range) | Graph Indicator Ver. 1.0 from Swapping, here and here .
Added some changes and features.
– segment for opening price;
– segment for yesterday’s closing price;
– Automatic detection of the timeframe;
– Automatic configuration for 1-5-10-15-30min charts.
Attached a version for EUR and USA.
Enjoy
Thomas
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
// Opening Range EUR with Close and Open. // Added some changes and features. // - segment for opening price; // - segment for yesterday's closing price; // - Automatic detection of the timeframe; // - Automatic configuration for 1-5-10-15-30min charts. // 17.06.2019 (Release 1.1) // Thomas Geisler // Sharing ProRealTime knowledge (alt+16) // Original basis was Pre-Market EUR (Opening Range) | Graph Indicator Ver. 1.0 // from Swapping // --- property settings //Info = 1 // (0=false; 1=true) //Delta = 10 // gap number/rectangle //Alpha = 255 // transparency letter //HighLow = 1 // (0=false; 1=true) //OpenClose = 1 // (0=false; 1=true) // --- end DefParam CalculateOnLastBars = 1400 // enough for one day (23h) when using 1min timeframe // --- init alpha = max(alpha,0) alpha = min(alpha,255) // --- end //Automatic time detection once NbBar = 1 if BarIndex < NbBar+2 then MyDay=openday dayminutes = 1440*(MyDay-MyDay[1]) MyHour=openhour hourminutes = 60*(MyHour-MyHour[1]) MyMin=openminute barminutes = MyMin - MyMin[1] + hourminutes + dayminutes barminutes=abs(barminutes) Mybarminutes = lowest[NbBar](barminutes)[1] endif // Select timeframe between 1 and max 30 minutes to define the parameters for drawing if Mybarminutes = 1 then Frame = 60 myStart = 080100 elsif Mybarminutes = 5 then // 5 minutes Frame = 12 // 12 candels myStart = 080500 // opening plus 5 min elsif Mybarminutes = 10 then Frame = 6 myStart = 081000 elsif Mybarminutes = 15 then Frame = 4 myStart = 081500 elsif Mybarminutes = 30 then Frame = 2 myStart = 083000 endif starttime = myStart // 08h00 Depending on the timeframe endtime = 090000 // 09h00 if time = starttime then startbar = barindex endif if time = endtime then endbar = barindex endif if time >= starttime and time <= endtime then if high > hh then hh = high endif if low < ll or ll = 0 then ll = low endif endif if intradaybarindex = 0 then hh = 0 ll = 0 endif if time = 173000 then //Close Yesterday at time 17:30 cl = close endif if date = today and time > endtime then //draw Box OpenRange (OPR) only for today DrawRectangle(startbar,hh,endbar,ll) coloured(0,255,255,alpha) // alpha (transparence) endif if date = today and time = endtime then // High/Low/Opening only for today upper = highest[Frame](high) lower = lowest[Frame](low) op = close dif = round(abs(upper-lower)) info = info // draw the info OPR, High, Low, Using Timeframe as text elsif info = 1 then DrawText("OPR #dif#pts",startbar+5,upper+(delta+5),SansSerif,Standard,12) coloured(255,0,255,alpha) DrawText("#hh#",startbar+5,upper+(delta),SansSerif,Standard,12) coloured(0,255,255,alpha) DrawText("#ll#",startbar+5,lower-(delta),SansSerif,Standard,12) coloured(0,255,255,alpha) //DrawText("Timeframe #Time1o5o10o15# min.",startbar+5,lower-(delta+5),SansSerif,Standard,12) coloured(255,0,255,alpha) endif if date = today and time >= endtime and time <= 220000 then If HighLow = 1 then// Draw Segment High,Low and Opening from OPR, as Support/Resist, to select time DrawSegment(barindex-HighLow,upper,barindex,upper) coloured(0,255,255,alpha) // High OPR DrawSegment(barindex-HighLow,lower,barindex,lower) coloured(0,255,255,alpha) // Low OPR endif If OpenClose = 1 then// Draw Segment High,Low and Opening from OPR, as Support/Resist, to select time DrawSegment(barindex-OpenClose,op,barindex,op) coloured(255,0,204,alpha) // Opening DrawSegment(barindex-OpenClose,cl,barindex,cl) coloured(255,0,0,alpha) //Close Yesterday endif endif return |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello Thomas, good modification that improves the initial program 😉
Thanks swapping. That´s Teamwork 😉
This looks very interesting. I’m getting an error though when trying to launch it – A positive integer field is expected with HIGHEST.
I’m thinking it would be the variable Frame you define prior. Not sure why it does that.
Any thoughts?
Hello Thomas the indicator is very good! Can you tell me how I can add 2 lines in the distance of the range to the high and low?
Have the currently solved so is not very nice.
STL=lower-Dif
STS=upper+Dif
return STL as “STL”,STS as “STS”
Thanks
Går det att få en för dax också?
hi great indicator how can i adjust time frame for opening rge ie to first 5 min , thanks in advance
The you must use the timeframe 1min and change the code from endtime = 090000 // 09h00 to endtime = 090500 // 09h05
Dont work anymore with the current version?