This script measures candle length and average true range (ATR). A break out occurs when a candle is larger than the given ATR value. You can choose to calculate length from wicks or from the body (open & close).
You can use this as trend direction indicator by following the last break out candle or open a position after a break out with a stop just above or below the candle. Enjoy!