highest high in a specific time range and timeframe
Forums › ProRealTime English forum › ProBuilder support › highest high in a specific time range and timeframe
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by
joepetting.
Viewing 6 posts - 1 through 6 (of 6 total)
-
-
01/07/2021 at 9:31 PM #156809
hi to all,
i am new here and start to learn programming to make my own indicators.
I hope someone can help me with my actual problem.
- i search the highest high and the lowest low on the 15 minutes chart between 8 and 9 o’clock
- the problem is that i get all the highs and lows from every candle in this timerange
thanks for the help in advance
kind regards
highest high between 8 and 9 o'clock12345678910111213141516171819defparam calculateonlastbars = 100if time > 080000 and time < 090000 thenHighestH = high //max(high,high)LowestL = low //min(low,low)//UpperRange = HighestH < HighestH[1] and HighestH > HighestH[2]//BottomRange = LowestL > LowestL[1] and LowestL < LowestL[2]endif//if currentdayofweek = 1 or 2 or 3 or 4 or 5 thendrawray(barindex-1,HighestH,HighestH,HighestH) coloured(0,200,0) STYLE(line,2)drawray(barindex-1,LowestL,LowestL,LowestL) coloured(200,0,0) STYLE(line,2)//endifreturn01/07/2021 at 10:33 PM #156819At line 3 you should use >= and <=.
Lines 4-5 must be replaced by:
12HighestH = max(high,HighestH)LowestL = min(low,LowestL)but you also need to reset them each day, at the beginning of the code, at line 2:
1234If IntraDayBarIndex = 0 thenHighestH = 0LowestL = 999999endif01/08/2021 at 1:55 PM #1569071234567891011121314151617defparam calculateonlastbars = 100If IntraDayBarIndex = 0 thenHighestH = 0LowestL = 99999endifif time >= 080000 and time <= 090000 thenHighestH = max(high,HighestH)LowestL = min(low,LowestL)endifdrawray(barindex-1,HighestH,HighestH,HighestH) coloured(0,200,0) STYLE(line,2)drawray(barindex-1,LowestL,LowestL,LowestL) coloured(200,0,0) STYLE(line,2)returnhi thanks for your help, i changed the code but its not working. attached is pictures of the result (chart) there should be only to lines
one upper and one bottom line. kind regards
01/08/2021 at 2:39 PM #156915You need to use as first or second line:
1Defparam DrawOnLastBarOnly = true01/08/2021 at 3:06 PM #15692101/08/2021 at 3:15 PM #156922thanks it works, now i can go on with it
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
Find exclusive trading pro-tools on 
Similar topics: