Skip to content
Prev 12746 / 15274 Next

questions about adaptive indicator, intra-day trading and package 'parallel'

On 09/13/2014 05:57 AM, domodo wrote:
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