Bollinger % B Scanner

How to code Bollinger % B for zerodha scanner in pi?

For example: alert if Boll%b above 100 ?

%B Not a Direct supported function in Tradescript.

Indirectly , you can define the value using the below formula:

SET BBP = ((LAST - BBB(CLOSE, 20, 2, EXPONENTIAL)) / ((BBT(CLOSE, 20, 2, EXPONENTIAL)) - (BBB(CLOSE, 20, 2, EXPONENTIAL)))