Use previous day’s high/low
Forums › ProRealTime English forum › ProBuilder support › Use previous day’s high/low
- This topic has 5 replies, 2 voices, and was last updated 2 years ago by Razz.
-
-
07/25/2022 at 10:41 AM #197894
I often use boxing, but I don’t know how to reach how I can if the course eg. above the previous day’s low of the box can color the chart background. In advance thanks for your help
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//____________________________________Starttime1 = 090000if time = starttime1 thenstartbar1 = barindexendif//____________________________________// --- initalpha = max(alpha,0)alpha = min(alpha,255)// --- endstarttime = 090500endtime = 093000if time = starttime thenstartbar = barindexendifIf Time = 090500 thenOps=openendifif 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 date = today and time = endtime thenupper = highest[6](high) // Frame 12 = 5 min Chartlower = lowest[6](low)op = closedif = round(abs(upper-lower))OMitte = upper-(dif/4)Mitte = upper-(dif/2)UMitte = lower+(dif/4)elsif info = 1 and Time > endtime thenDrawText("#dif#Punkte",startbar+HL,upper+(delta+HLH+8),SansSerif,Standard,14) coloured(255,255,255)DrawText("#hh#",startbar+HL,upper+(delta+HLH),SansSerif,Standard,14) coloured(0,255,255)DrawText("#ll#",startbar+HL,lower-(delta+HLH),SansSerif,Standard,14) coloured(0,255,255)DrawRectangle(startbar,hh,endbar,ll) coloured(255,255,255,50)bordercolor(0,0,0,0)endifreturn07/25/2022 at 1:11 PM #19790707/26/2022 at 10:14 AM #197949The previous day range can be defined this way:
123Timeframe(Daily,UpdateOnClose)HH = highLL = lowor this way:
12HH = Dhigh(1)LL = Dlow(1)hen you can use HH as the upper limit and LL as the lower limit.
07/26/2022 at 1:04 PM #197952Hello Robertogozzi Unfortunately that is not the solution. I would like to see the high and low of the 09:00-10:00 candle from the previous day, for example. I can achieve this with upper[1] and lower[1] in the above code, but as soon as the box is drawn on today, the display snaps to today’s new value.
07/26/2022 at 3:52 PM #197961Then you have to use this code:
12345678910IF Time = 090000 THENPrevHH = HHPrevLL = LLHH = highLL = lowENDIFIF Time > 090000 AND Time <=100000 THENHH = max(HH,high)LL = min(LL,low)ENDIFuse PrevHH and PrevLL as the Upper and Lower values of the previous day.
1 user thanked author for this post.
07/27/2022 at 6:16 PM #197999 -
AuthorPosts
Find exclusive trading pro-tools on