//@version=6
indicator("I_extremes")
cond = close > open
sma20 = ta.sma(close, 20)
plot(bar_index, "bar_index")
plot(ta.highest(20), "highest20")
plot(ta.lowest(20), "lowest20")
plot(ta.highest(close, 20), "highest20_close")
plot(ta.lowest(close, 20), "lowest20_close")
plot(ta.highest(close, 1), "highest1")
plot(ta.highestbars(20), "highestbars20")
plot(ta.lowestbars(20), "lowestbars20")
plot(ta.highestbars(close, 20), "highestbars20_close")
plot(ta.pivothigh(5, 5), "pivothigh55")
plot(ta.pivotlow(5, 5), "pivotlow55")
plot(ta.pivothigh(close, 3, 2), "pivothigh_close32")
plot(ta.valuewhen(cond, close, 0), "valuewhen0")
plot(ta.valuewhen(cond, close, 1), "valuewhen1")
plot(ta.valuewhen(cond, close, 5), "valuewhen5")
plot(ta.valuewhen(cond, bar_index, 0), "valuewhen_barindex")
plot(ta.barssince(cond), "barssince")
plot(ta.barssince(not cond), "barssince_not")
plot(ta.barssince(ta.crossover(close, sma20)), "barssince_cross")
plot(ta.crossover(close, sma20) ? 1 : 0, "crossover")
plot(ta.crossunder(close, sma20) ? 1 : 0, "crossunder")
plot(ta.cross(close, sma20) ? 1 : 0, "cross")
plot(ta.crossover(close, 200) ? 1 : 0, "crossover_const")
plot(ta.rising(close, 3) ? 1 : 0, "rising3")
plot(ta.falling(close, 3) ? 1 : 0, "falling3")
plot(ta.percentrank(close, 20), "percentrank20")
plot(ta.percentile_linear_interpolation(close, 20, 50), "pct_linear_50")
plot(ta.percentile_nearest_rank(close, 20, 50), "pct_nearest_50")
plot(ta.percentile_nearest_rank(close, 20, 90), "pct_nearest_90")
plot(ta.median(close, 20), "median20")
plot(ta.mode(math.round(close), 20), "mode20_rounded")
plot(ta.range(close, 20), "range20")
plot(ta.max(close), "max_alltime")
plot(ta.min(close), "min_alltime")
plot(ta.cum(volume), "cum_volume")
plot(ta.correlation(close, volume, 20), "correlation20")