[R-SIG-Finance] questions about adaptive indicator, intra-day trading and package 'parallel'
Brian G. Peterson
brian at braverock.com
Sat Sep 13 15:03:58 CEST 2014
On 09/13/2014 05:57 AM, domodo wrote:
> Thanks,Kipnis,and sorry for my delay reply.I'll learn how to use Rcpp.
>
> regarding parallel computation,I'v learned how to compute parallel on
> multi-cores computer when optimizing by professor Yollin's represetation
> document,is it possible to compute parallel on multi-cores computer when
> back-testing intra-day historical data ? and how to ?
It is trivial to use the foreach package to call applyStrategy in parallel.
It seems unlikely that you would need to if your strategy is well
specified. We routinely run strategy backtests in under one core-minute
per symbol per day on tick data.
parameter optimization and walk forward analysis clearly benefit from
multiple cores and even clusters of multiple machines, and quantstrat
supports this directly. For a single backtest, even on hundreds or
thousands of symbols with intra-day data, it is rarely needed on modern
hardware.
I recommend learning the tools first, then learning how to profile your
indicator or signal code to focus on where you need to speed it up. As
in almost anything in R, vectorization or filtering is almost always
possible, and will provide huge gains in performance, often of several
orders of magnitude. If that fails, you can always write C, Fortran, or
C++ code to tackle some particularly difficult computation.
Typically, the largest gains come from writing efficient vectorized
indicators and signal generators. After that, many strategies allow for
signal pre-filtering. We only rarely need to resort to compiled code,
even for 'adaptive indicators', and we only work with intra-day data.
Regards,
Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list