[R-SIG-Finance] Quantstrat runs quite slow on large data

Robert A'gata rhelpacc at gmail.com
Sat Dec 29 04:24:19 CET 2012


Hi,

I am investigating what the issue behind slowness of quantstrat is when
dealing with large data. I have BBO-like data set for 1.5mio rows. The
strategy is simply moving average crossing over. For data generation, I
simulated an ARMA(1,1) process with appropriate volatility (see attached
code). There are 478 occurrences of cross-over (both long and short). It
took ~40min to run on AMD A6-3400M APU (quad-core) machine with 6GB of RAM.
The rule is rather simple in this case. My expectation is that if
quantstrat only acts on these 478 occurrences, it should take much less
time than this. I have attached my code (please ignore the lower part that
summarizes performance). I am wondering if there is any room for
improvement. Any help or advice would be greatly appreciated. Thank you.

Happy new year.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121228/bd538cbd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CrossOverVwapSim.R
Type: application/octet-stream
Size: 6445 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20121228/bd538cbd/attachment.obj>


More information about the R-SIG-Finance mailing list