Find high or low between bars
Forums › ProRealTime English forum › ProScreener support › Find high or low between bars
- This topic has 6 replies, 4 voices, and was last updated 2 months ago by robertogozzi.
-
-
03/08/2022 at 12:34 PM #189597
Hi there,
I know there is a way to find the high or low of a number of bars BACK from the current bar, but is there a way to say “find me the highest close value between bar index 2 and 10”?
So between two arbitrary bars, find the highest or lowest value. I can probably script something up but thought there must be a function to do this!
Thanks again
k
03/08/2022 at 2:46 PM #189603This is the code to find “the highest close value between bar index 2 and 10”:
1HH = highest[9](close[2])it will scan bars 2 through 10 (9 bars).
1 user thanked author for this post.
03/08/2022 at 9:29 PM #18965810/07/2024 at 5:15 PM #238626Hello Roberto, this is an extremely helpful snippet of code. Thanks for sharing.
However I use it and don’t fully understand the results of the Highest function.
Can you please help me to understand why searching for a recent high using the “HIGH” function gets a different result from the “HIGHEST” function?
The image attached shows my result and you can find the code below.
As far as I understand, both should return the same result.
I am relatively new to PRT, so apologies if I’ve missed something obvious.
Thanks,
David.Indicator showing the difference between Highest & Max1234567HH1 = High[1]HH2 = High[2]HH = highest[2]HHH = MAX(HH1,HH2)Return HH AS "Recent Highest", HHH AS "Recent MAX"10/07/2024 at 6:04 PM #238628highest[2](close) : search for the number of times, the highest number in brackets of what is in brackets
2 users thanked author for this post.
10/07/2024 at 7:15 PM #23863010/08/2024 at 8:38 AM #238648Use
12HH1 = HighHH2 = High[1]to match
1highest[2]as bars are identified from 0 (the current one, i.e. the first, or rightmost, bar) up to BarIndex; HIGH[BarIndex] is the HIGH of the leftmost bar, the very first bar.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on