First Hour Opening Range
Forums › ProRealTime English forum › ProBuilder support › First Hour Opening Range
- This topic has 8 replies, 2 voices, and was last updated 1 year ago by Alex72.
Viewing 9 posts - 1 through 9 (of 9 total)
-
-
03/26/2023 at 11:32 AM #21212703/26/2023 at 11:51 AM #212130
There you go:
1234567891011121314151617//DEFPARAM DrawOnLastBarOnly = trueStartTime = 000000EndTime = 010000IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THENmyBar = BarIndexHH = highLL = lowENDIFIF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THENHH = max(HH,high)LL = min(LL,low)ENDIFIF OpenTime >= EndTime THENDrawSegment(myBar,HH,BarIndex,HH) coloured("Blue",255)DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255)ENDIFRETURN03/26/2023 at 12:54 PM #21213303/26/2023 at 1:13 PM #21213403/26/2023 at 3:36 PM #212140That will show exactly, for any timeframe equal or less than 1 hour, the HIGH and LOW of the first hour (or whatever time you choose), from 0 to 23.
03/26/2023 at 4:12 PM #21214403/26/2023 at 4:30 PM #212145I just copied and changed your code to apply it for the 15 minutes openning range, i got a scaling scaling down like in the picture here attached, can you tell me where is my error?
Thank you
123456789101112131415161718//DEFPARAM DrawOnLastBarOnly = truetimeframe(15mn)StartTime = 143000// this is my zone start timeEndTime = 000000IF OpenTime = StartTime OR ((OpenTime > StartTime) AND (OpenTime < OpenTime[1])) THENmyBar = BarIndexHH = highLL = lowENDIFIF (OpenTime >= StartTime) AND (OpenTime <= EndTime) THENHH = max(HH,high)LL = min(LL,low)ENDIFIF OpenTime >= EndTime THENDrawSegment(myBar,HH,BarIndex,HH) coloured("Green",255)DrawSegment(myBar,LL,BarIndex,LL) coloured("Red",255)ENDIFRETURN HH AS "OPR 15min High",LL AS "OPR 15min Low"03/26/2023 at 5:22 PM #212153There is no error, I used DRAWSEGMENT and DEFPARAM DrawOnLastBarOnly = true to prevent this.
With RETURN you can’t change what has been printed in the prior candles, so you will always see steps when there’a new high or low. It can’t be gotten rid of.
03/26/2023 at 5:48 PM #212157 -
AuthorPosts
Viewing 9 posts - 1 through 9 (of 9 total)
Find exclusive trading pro-tools on
Similar topics: