//check if we have pivot low in obv pivot_low_true = na(pivotlow(obv_value, pivot_left, pivot_right)) ? false : true //returns price of the pivot low point. It returns 'NaN', if there was no pivot low point.
//Create a function that returns true/false confirm_range(x) => bars = barssince(x == true) //Counts the number of bars since the last time the condition was true min_range <= bars and bars <= max_range // makes ure bars is less than 60 and less than 5 and returns true
bullCond = price_ll_check and OBV_HL_check and pivot_low_true
//Plot the areas, terneary conditional operator plot( pivot_low_true ? obv_value[pivot_right] : na, offset=-pivot_right, linewidth=3, color=(bullCond ? color.green : color.new(color.white, 100)))//colornew applies the specified transparency to the given color