This indicator is designed to detect imbalanced volume compared to the open/close of the corresponding candle body. The idea is that institutions often trade in higher volume within a smaller price range. Identifying these can give an indication if there is a rally or selloff happening. The code looks at the median of all the prior candles from the point of the last trigger and compares them to the range in body of the candles in order to dynamically find a baseline, by which imbalances can be more accurately detected throughout changing market conditions.