Take a look at runquantile from caTools. 

http://svitsrv25.epfl.ch/R-doc/library/caTools/html/runquantile.html

Though I agree this would make sense in TTR as well...

Michael

On Jul 27, 2013, at 5:03, Andreas Voellenklee <wotuzu17@gmail.com> wrote:

> Hi,
> 
> first I would like to say thanks to the developer(s) of the TTR package, I
> am using it in almost all of my financial research. Currently I am working
> on a filter for volatility spikes, and therefore a new function for the
> analysis of moving windows would be useful.
> 
> The package already contains runSum, runMedian, runMean, ... functions. I
> need a function that calculates a given quantile of the past n
> observations.
> 
> Something like
> 
> runQuantile(x, n=50, prob)
> 
> The results of the function runQuantile(x, 50, .5) would be equivalent to
> runMedian(x, 50)
> 
> It would be great if such a function could be implemented into TTR. If
> somebody knows a workaround to achieve the same result, please let me know.
> 
> Best regards,
> 
> Andreas
> 
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.

	[[alternative HTML version deleted]]

