this pinescript v5 doesn't seem to work for me, do you see anything wrong, how to correct it?
//@version=5
indicator("Top 20 Candles with Highest Absolute Differences", overlay=true)
// calculate the absolute difference between open and close prices using math.abs() function
abs_diff = math.abs(open - close)
// get the top 20 candles with the highest absolute differences over the last 200 days
rank = rank(abs_diff, 200)
is_top_20 = rank <= 20
// color the top 20 candles black
bar.color(is_top_20 ? color.black : na)
My tradingview account doesn't recognise the 'Rank' and the 'Abs' functions in the way I wrote them.