Reputation: 101
I want to find the best low/high range.
//@version=4
study("Daily Open High Range")
plot(((high-low)/low)*100)
This works mostly fine except it will return results for the low against the high even if the high precedes the low, I want to filter these out.
Example of what I want to be filtered out
This would be great to be able to find, but I cannot begin to imagine how to code this.
The challenge here is that the high following the lowest low does not account for the best range in the day.
Upvotes: 0
Views: 474
Reputation: 31
Even I am struggling with with the same problem. I get error
Pinescript is refusing to accept value returned by barssince(somecondition) as length parameter although there are few documents that seem to say that it is correct.
simply put
valueA = highest(high, 20) // point A
valueB = lowest (low , 20) // point B
valueC = lowest(low , max(1, barssince(valueA == high)))
Even after ensuring that the length variable can never be zero, pine script keeps giving run-time error (pink exclamation bar) stating that parameter of lowest cannot be zero..
Upvotes: 3