Consider the edge cases on what the last 5 candles might look like in extreme situations. You may be better off using an ATR value with a modifier coefficient, something like 1.5X the ATR for the last 5 or 10 candles.