Search code examples
pine-scriptcandlesticks

How to check if the candle is the largest one in Pine-Script?


I wanna to make pine script code to check is that candle the largest one of the previous 50 candles and color it yellow i tried hard ,but i can't


Solution

  • You could use:

    r = high - low
    barcolor(rising(r,50) ? color.yellow : na)