Minor update. Explanation of flag colors: Band Squeeze Candle Count determines minimum pressure happened for candle count. If the back-to-back count reaches to 1 times of candle count, the flags will be yellow for 1 more cycle of candle count. If back-to-back count reaches to 2 times of candle count, the flags will be red in order attract attention for continuous pressure.
ps. Its a v4 script. You can use plot values with alerts. Built-in alert has been defined in the script.