Open range code for currencies
Forums › ProRealTime English forum › ProBuilder support › Open range code for currencies
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Razz.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
08/13/2020 at 1:16 PM #141512
Hello, what has to be changed in this code so that it shows low / high and differential values for currencies.
Many thanks for your help123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117// 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)// --- endDefParam CalculateOnLastBars = 1400 // enough for one day (23h) when using 1min timeframe// --- initalpha = max(alpha,0)alpha = min(alpha,255)// --- end//Automatic time detectiononce NbBar = 1if BarIndex < NbBar+2 thenMyDay=opendaydayminutes = 1440*(MyDay-MyDay[1])MyHour=openhourhourminutes = 60*(MyHour-MyHour[1])MyMin=openminutebarminutes = MyMin - MyMin[1] + hourminutes + dayminutesbarminutes=abs(barminutes)Mybarminutes = lowest[NbBar](barminutes)[1]endif// Select timeframe between 1 and max 30 minutes to define the parameters for drawingif Mybarminutes = 1 thenFrame = 60myStart = 080100elsif Mybarminutes = 5 then // 5 minutesFrame = 12 // 12 candelsmyStart = 080500 // opening plus 5 minelsif Mybarminutes = 10 thenFrame = 6myStart = 081000elsif Mybarminutes = 15 thenFrame = 4myStart = 081500elsif Mybarminutes = 30 thenFrame = 2myStart = 083000endifstarttime = myStart // 08h00 Depending on the timeframeendtime = 090000 // 09h00if time = starttime thenstartbar = barindexendifif time = endtime thenendbar = barindexendifif time >= starttime and time <= endtime thenif high > hh thenhh = highendifif low < ll or ll = 0 thenll = lowendifendifif intradaybarindex = 0 thenhh = 0ll = 0endifif time = 173000 then //Close Yesterday at time 17:30cl = closeendifif date = today and time > endtime then //draw Box OpenRange (OPR) only for todayDrawRectangle(startbar,hh,endbar,ll) coloured(0,255,255,alpha) // alpha (transparence)endifif date = today and time = endtime then // High/Low/Opening only for todayupper = highest[Frame](high)lower = lowest[Frame](low)op = closedif = round(abs(upper-lower))info = info // draw the info OPR, High, Low, Using Timeframe as textelsif info = 1 thenDrawText("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)endifif date = today and time >= endtime and time <= 220000 thenIf HighLow = 1 then// Draw Segment High,Low and Opening from OPR, as Support/Resist, to select timeDrawSegment(barindex-HighLow,upper,barindex,upper) coloured(0,255,255,alpha) // High OPRDrawSegment(barindex-HighLow,lower,barindex,lower) coloured(0,255,255,alpha) // Low OPRendifIf OpenClose = 1 then// Draw Segment High,Low and Opening from OPR, as Support/Resist, to select timeDrawSegment(barindex-OpenClose,op,barindex,op) coloured(255,0,204,alpha) // OpeningDrawSegment(barindex-OpenClose,cl,barindex,cl) coloured(255,0,0,alpha) //Close Yesterdayendifendifreturn08/14/2020 at 12:50 PM #14163108/14/2020 at 1:04 PM #14163408/25/2020 at 7:01 AM #142496 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: