Highest High from time_s to present
-
- Posts: 50
- Joined: 11 Nov 2005
- Contact:
Highest High from time_s to present
I'm trying to get the highest high from bar time_s to present bar. The only function I know of is Highest(high, {#of bars back}) Now if I can replace the # of bars back with a starting time_s that would be perfect. However, I know that doesn't work. Any ideas on how to generate the desired result?
- Bruce DeVault
- Posts: 438
- Joined: 19 Jan 2010
- Location: Washington DC
- Been thanked: 2 times
- Contact:
That could be coded, but would require an indeterminate number of bars of lookback, if you don't know the time_s cutoff in question from the outset. Thus, you would have to be careful not to exceed MaxBarsBack later. The path of least resistance would be to require that the answer be no more than X bars back, and then you could set max bars back to that.
Am I correct in assuming that the time_s you are referring to is some past bar's time? Time_s in 10 second bars would be the current bar because time_s is a reserve word. Even in 1 minute bars time_s is the same time as the current 1 minute bar but with 2 extra zeros representing the seconds.
If I am correct then submit the historic time to either findbar or my binary function (found in user contributed studies) to get the offset number of bars back then use the highest function using the offset you get from the find function(s). Make sure the find functions do not return -1.
Actually findno and my function both search back the maxbarsback distance and return -1 if not found. However you can change them to not do this check and MC will automatically recalculate and change your maxbarsback to a higher value. It does not tell you that it is doing this.
If I am correct then submit the historic time to either findbar or my binary function (found in user contributed studies) to get the offset number of bars back then use the highest function using the offset you get from the find function(s). Make sure the find functions do not return -1.
Actually findno and my function both search back the maxbarsback distance and return -1 if not found. However you can change them to not do this check and MC will automatically recalculate and change your maxbarsback to a higher value. It does not tell you that it is doing this.
-
- Posts: 50
- Joined: 11 Nov 2005
- Contact:
-
- Posts: 50
- Joined: 11 Nov 2005
- Contact: