TradingView
RicardoSantos
Apr 14, 2016 9:39 AM

Function Highest/Lowest 

U.S. Dollar/Canadian DollarFXCM

Description

Function for highest() and lowest()

Release Notes

updated code for V4, code in cooperation with @LucF.
theres 2:
1. version that supports high length values.
2. error's with high length values, but maps initial range(bar_index=0 to length).
Comments
PineCoders
LeetIce
This is great.. as I've noticed in version 3.. highest() and lowest() do not like taking in variables for length.. often results in:

line 34: Cannot call `highest` with arguments (series, series); available overloads: highest(series, integer) => series; highest(integer) => series;
LucF
These two pieces of code are probably the most used functions in Pine outside the built-ins, so thanks for them, Ricardo.
Daveatt
@LucF, discovered it today.... but was looking for them all my life. True story
blackcat1402
is that possible to have similar improve cci() and dev() functions because
Cannot call 'cci' with arguments (series[float], series[integer]); available overloads: cci(series[float], integer) => series[float]

Cannot call 'dev' with arguments (series[float], series[integer]); available overloads: dev(series[float], integer) => series[float]

thanks in advance!
dh55
I am trying to find a piece of code that will return the high since another function was true.
I was using highest(high,barssince(xyz>0)) but that doesn’t work because it’s two series. Is there a way to use the above to do the same thing? I only need it for the last 100 bars. If xyz>0 more than 100 bars ago then I don’t care what the high was. I can’t use highest(high,100) because xyz>0 could occur 3 bars ago but the high in the last 100 was 90 bars ago. Anyway any help appreciated
kurtsmock
... thank you sir. I was pulling my hair out here. Not because I couldn't write it, but just because I knew it was already written
blackcat1402
thanks for sharing
SimpleCryptoLife
A lowest()/highest() function without the ability to input a series is like a 3-legged horse. Thank you, Ricardo, for supplying the fourth leg!
allanster
Thanks @RicardoSantos and @LucF, you guys are unstoppable!
More