Having some difficulty here- I've been trying to get around usage of the HighestAll function to determine the last bar on a given chart frame, however, this is quite baffling. Here's the simple call with HighestAll():
def lastBar = HighestAll(BarNumber());
Little baffled by the need to use the call to HighestAll(); if I manually enter an integer into lastBar (that is, in fact, the last bar on the chart), function works as expected. Any other attempts I have tried to get around usage of HighestAll() without manually updating do not work. Just using BarNumber() (which should give just the last bar in the chart anyway???) also does not work. Feel like there is a class mismatch here that isn't really present in the description of each of these functions.
For example, the alternative:
def bar = !IsNaN(close[-1]);
rec bars = if bar then bars[1]+1 else bars[1];
def lastBar = bars;
When plotted against HighestAll(BarNumber()) is functionally equivalent... Yet when used with, say, Robert Payne's Quadratic Polynomial script, does not yield the same result (?).
As above, I feel like this is a noob mistake, or that I'm missing something. Anything here is appreciated!
def lastBar = HighestAll(BarNumber());
Little baffled by the need to use the call to HighestAll(); if I manually enter an integer into lastBar (that is, in fact, the last bar on the chart), function works as expected. Any other attempts I have tried to get around usage of HighestAll() without manually updating do not work. Just using BarNumber() (which should give just the last bar in the chart anyway???) also does not work. Feel like there is a class mismatch here that isn't really present in the description of each of these functions.
For example, the alternative:
def bar = !IsNaN(close[-1]);
rec bars = if bar then bars[1]+1 else bars[1];
def lastBar = bars;
When plotted against HighestAll(BarNumber()) is functionally equivalent... Yet when used with, say, Robert Payne's Quadratic Polynomial script, does not yield the same result (?).
As above, I feel like this is a noob mistake, or that I'm missing something. Anything here is appreciated!