With the lookback period set to 20 (editable), the script loops over the last 20 bars starting from the current bar and counts the up days (Close > Open) and down days (Close < Open). Then it divides the up/down days by the total number of days to give the %. Color themed fib levels are also implemented in this indicator.