Script updated to give options for different smoothing -- simple moving average, exponential moving average and weighted moving average. Other code also tidied up.
This script only calculates the range from the high to the low for the period. See my other script, ATRP Arthur, for calculation of the average true range percent. The true range takes into account gaps between periods.