volatility
computes the volatility from a time series of prices:
it will only work for positive quantities.
You can use runSD
directly.
# Standard deviation of the spread
sqrt(252) * runSD( spread, 30 )
# Standard deviation of the change in spread
sqrt(252) * runSD( diff(spread), 30 )