could you convert this over plesea thannks
Forums › ProRealTime English forum › ProBuilder support › could you convert this over plesea thannks
- This topic has 4 replies, 2 voices, and was last updated 1 month ago by
Patrick K Templar.
-
-
06/14/2025 at 7:46 PM #248276
Session and Opening Range detection
Drawing the range box and center line
Plotting horizontal lines (ORB high, low, mid, targets)
here pine S with what is what1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889901️⃣ Session & ORB DetectionIn Pine Script:pinescriptCopyEditin_session = time(timeframe.period, session + ":23456", sTimeZone) != naif is_firstorbHigh := high; orbLow := lowelseorbHigh := orbHigh[1]; orbLow := orbLow[1]...ProRealTime equivalent (server time used):prorealcodeCopyEdit// InputsStartTime = 143000 // 09:30 ESTEndTime = 150000 // 10:00 EST// Variablesonce orbHigh = 0once orbLow = 0once started = 0if time >= StartTime and time < EndTime thenif started = 0 thenorbHigh = highorbLow = lowstarted = 1elseorbHigh = max(orbHigh, high)orbLow = min(orbLow, low)endifelsestarted = 0 // reset for next sessionendifstarted flags first bar of session.After setup, orbHigh and orbLow track max/min.2️⃣ Drawing the Range Box & Center LineIn Pine:pinescriptCopyEditdailyBox := box.new(...)box.set_*()// center line with line.new()ProRealTime uses drawrectangle:prorealcodeCopyEditif started = 1 thendrawrectangle("", barindex - bars_in_session + 1, orbLow, barindex, orbHigh) coloured boxColorif showCenterLine thenmid = (orbHigh + orbLow)/2drawline("", barindex - bars_in_session + 1, mid, barindex, mid) coloured rangeCenterColorendifendifUse only empty "" names.bars_in_session matches number of bars in defined session length.3️⃣ Plotting Horizontal ORB Levels & TargetsIn Pine, they use line.new() and arrays for many targets:pinescriptCopyEditorbHighLine := line.new(...)line.set_x2(...)ProRealTime is simpler — use multiple plot calls:prorealcodeCopyEditplot1( orbHigh, "ORB High", orbHighColor )plot2( orbLow, "ORB Low", orbLowColor )plot3( (orbHigh+orbLow)/2, "Mid", orbMidColor )range = orbHigh - orbLowtarget50 = orbHigh + range * 0.5plot4(target50, "Target 50%", orb50Color)target100 = orbHigh + range * 1.0plot5(target100, "Target 100%", orb100Color)06/15/2025 at 3:23 PM #248280Hi Patrick,
Try this one:
ORB12345678910111213141516171819202122232425262728293031323334353637383940414243444546DefParam DrawOnLastBarOnly=TrueStartTime=143000 //09:30 ESTEndTime=150000 //10:00 ESTOnce ORBHigh=0Once ORBLow=0Once Started=0If OpenTime=StartTime thenBarIndexStart=BarIndexElsIf OpenTime=EndTime thenBarIndexEnd=BarIndexEndIfIf OpenTime>=StartTime and OpenTime<=EndTime thenIf Started=0 thenORBHigh=HighORBLow=LowStarted=1elseORBHigh=max(ORBHigh,High)ORBLow=min(ORBLow,Low)EndIfelseStarted=0 //Reset for next sessionEndIfMidLine=ORBLow+(ORBHigh-ORBLow)/2xRange=(ORBHigh-ORBLow)Target50=ORBHigh+xRange*0.5Target100=ORBHigh+xRangeDrawRectangle(BarIndexStart,ORBLow,BarIndexEnd,ORBHigh)Coloured("Yellow")DrawSegment(BarIndexEnd,ORBHigh,BarIndex,ORBHigh)Coloured("Red")DrawText("ORBHigh=#ORBHigh#",BarIndex,ORBHigh+Range/4)Coloured("Red")DrawSegment(BarIndexEnd,ORBLow,BarIndex,ORBLow)Coloured("Green")DrawText("ORBLow=#ORBLow#",BarIndex,ORBLow-Range/4)Coloured("Green")DrawSegment(BarIndexEnd,MidLine,BarIndex,MidLine)DrawText("MidLine=#MidLine#",BarIndex,MidLine+Range/4)DrawSegment(BarIndexEnd,Target50,BarIndex,Target50)DrawText("Target50%=#Target50#",BarIndex,Target50+Range/4)DrawSegment(BarIndexEnd,Target100,BarIndex,Target100)DrawText("Target100%=#Target100#",BarIndex,Target100+Range/4)Return3 users thanked author for this post.
06/17/2025 at 7:56 AM #248311thannk you i got todo my needs but i would like it better if you would like to help thannk you so much
06/17/2025 at 9:25 AM #248319lnd orb12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273DefParam DrawOnLastBarOnly=TrueStartTime=080000 //09:30 ESTEndTime=081500 //10:00 ESTCutoffTime = 153000 // 13:30 EST (lines stop plotting)Once ORBHigh=0Once ORBLow=0Once Started=0If OpenTime=StartTime thenBarIndexStart=BarIndexElsIf OpenTime=EndTime thenBarIndexEnd=BarIndexEndIfIf OpenTime>=StartTime and OpenTime<=EndTime thenIf Started=0 thenORBHigh=HighORBLow=LowStarted=1elseORBHigh=max(ORBHigh,High)ORBLow=min(ORBLow,Low)EndIfelseStarted=0 //Reset for next sessionEndIfMidLine=ORBLow+(ORBHigh-ORBLow)/2MidLine2=MidLine+(ORBHigh-MidLine)/2MidLine3=MidLine+(ORBlow-MidLine)/2xRange=(ORBHigh-ORBLow)Target25=MidLine2+xRange*0.5Target50=ORBHigh+xRange*0.5Target75=MidLine2+xRange*1.0Target100=ORBHigh+xRangeTargetM100=ORBlow-xRangeTargetM75=MidLine3-xRange*1.0TargetM50=ORBlow-xRange*0.5TargetM25=MidLine3-xRange*0.5DrawRectangle(BarIndexStart,ORBLow,BarIndexEnd,ORBHigh)Coloured("Yellow")DrawSegment(BarIndexEnd,ORBHigh,BarIndex,ORBHigh)Coloured("Red")//DrawText("ORBHigh=#ORBHigh#",BarIndex,ORBHigh+Range/4)Coloured("Red")DrawSegment(BarIndexEnd,ORBLow,BarIndex,ORBLow)Coloured("Green")//DrawText("ORBLow=#ORBLow#",BarIndex,ORBLow-Range/4)Coloured("Green")DrawSegment(BarIndexEnd,MidLine,BarIndex,MidLine)//DrawText("MidLine=#MidLine#",BarIndex,MidLine+Range/4)DrawSegment(BarIndexEnd,Target50,BarIndex,Target50)Coloured("red")//DrawText("Target50%=#Target50#",BarIndex,Target50+Range/4)Coloured("red")DrawSegment(BarIndexEnd,Target100,BarIndex,Target100)Coloured("red")//DrawText("Target100%=#Target100#",BarIndex,Target100+Range/4)Coloured("red")DrawSegment(BarIndexEnd,MidLine2,BarIndex,MidLine2)Coloured(255,20,20,60)//DrawText("MidLine2=#MidLine2#",BarIndex,MidLine2+Range/4)Coloured(255,20,20,100)DrawSegment(BarIndexEnd,Target25,BarIndex,Target25)Coloured(255,20,20,60)//DrawText("Target25%=#Target25#",BarIndex,Target25+Range/4)Coloured(255,20,20,100)DrawSegment(BarIndexEnd,MidLine2,BarIndex,MidLine2)Coloured(255,20,20,60)//DrawText("MidLine2=#MidLine2#",BarIndex,MidLine2+Range/4)Coloured(255,20,20,100)DrawSegment(BarIndexEnd,Target75,BarIndex,Target75)Coloured(255,20,20,60)//DrawText("Target75%=#Target75#",BarIndex,Target75+Range/4)Coloured(255,20,20,100)DrawSegment(BarIndexEnd,TargetM100,BarIndex,TargetM100)Coloured("green")//DrawText("TargetM100%=#TargetM100#",BarIndex,TargetM100+Range/4)Coloured("green")DrawSegment(BarIndexEnd,Targetm75,BarIndex,Targetm75)Coloured(20,225,20,100)//DrawText("TargetM75%=#TargetM75#",BarIndex,TargetM75+Range/4)Coloured("green")DrawSegment(BarIndexEnd,Targetm50,BarIndex,Targetm50)Coloured("green")//DrawText("TargetM50%=#TargetM50#",BarIndex,TargetM75+Range/4)Coloured("green")DrawSegment(BarIndexEnd,Targetm25,BarIndex,Targetm25)Coloured(20,225,20,60)DrawSegment(BarIndexEnd,MidLine3,BarIndex,MidLine3)Coloured(20,225,20,60)//DrawText("Target25%=#Target25#",BarIndex,Target25+Range/4)Coloured(255,20,20,100)Return06/17/2025 at 9:27 AM #248320As you can see I just copied more lines of your code and played about with it to make sure they ended up in the right place the coloring and then faded it all within the coding bar what would be better if that was outside so it just settings so you can change the thickness the style of the Lions the colors of the lines and the amount of lines if there’s a way to increase the amount of lines so you got the the main measurement and the Half point measurement and the quarter point measurement so and having them set individually and then being able to add more of them if you need them so the full measurement is the width of the range and then that’s just deviated from that half is obviously half of the Range and a quarter is also a quarter and the way I would do it the half ones would be the most bright colored lines and they fade as they go down to half and quarter
-
AuthorPosts
Find exclusive trading pro-tools on