This script attempts to find consolidations or retracements within the context of a previous uptrend - basically looking for flag type patterns. It first measures an initial move (referred to as the flag pole in this script) and then looks for consolidation after that move within a certain range. If the consolidation is within the rage, it plots a dot under the candle to show you the consolidation areas. It's not fool proof, but seems to do a decent job of identifying pullbacks and sideways consolidations reasonably well.