Adding Date Conditions to Highest(n) & Lowest(n)
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Adding Date Conditions to Highest(n) & Lowest(n)
Hi
Is it possible to add a date function into the highest & lowest code? To add a highest or lowest indicator between two sets of dates without defining the dates.
For example:
Pulling the highest high from an hourly chart for a 7 day period. Something like, highest(t)-(t-7), to pull the highest high between 27th sept (t) and 20th sept (t-7).
The reason I am looking down this avenue is because I was using an hourly multiple to indicate daily levels, however this becomes a problem when the highest or lowest prices fall near the back end of the time frame, as the number of hours it would need to look at to capture “daily” levels would need to increase by 1 every hour. So if it used 115 hours of prices to capture 7 days of data, this would need to increase by 1 every hour in order to keep the full days pricing data.
Any advice or solution would be greatly received.
Many Thanks
Liam
Hi Nicolas,
To add levels derived from daily numbers to an hourly candle chart
Many Thanks
No prob at all!
looking more for the highest high & lowest low between 2 dates and show them on hourly timeframe
Ok! So you don’t need to spot them on an hourly chart specifically, you can use OHLC of daily timeframe for that!
Because the highest high of an hourly chart is exactly the same as the high of a day.
So, you can code it like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//store the highest high and lowest low during 7 days and then reset if day<>day[1] then count = count +1 endif if count=8 then count = 0 hh = close ll = close endif hh= max(hh,high) ll= min(ll,low) RETURN hh,ll |
Thanks very much Nicolas, will try this out
Find exclusive trading pro-tools on