[R-SIG-Finance] Recomendations for backtesting...
Ulrich Staudinger
ustaudinger at gmail.com
Sun Jun 20 15:01:14 CEST 2010
Brian,
I indeed agree with you, not everything can be vectorized and your path
dependent examples are indeed a great visualization of exactly this.
Nonetheless, for many basic algorithms where you have a clear situations
like "be short 5", "be long 2", vectorization is (from my point of view) the
way to go.
Maximum positions, conditional trades (if former trade executed) seem to
make vectorization impossible.
In the end I think it depends on the algo and the framework, I doubt that a
generic backtesting framework can be a winner in maximum performance and the
best feature richness at the same time. As an example, blotter (IIRC) uses
short and long buy and sell commands to memorize/process orders. Whereas
this gives a lot of flexibility when one just wants to process a price list,
it seems to be less optimal from the performance point of view, as (IIRC)
this approach depends on iterating over the mentioned price list.
As already said, the different frameworks are really great and very likely
fit different needs.
Kind regards,
Ulrich
-----Original Message-----
From: Brian G. Peterson [mailto:brian at braverock.com]
Sent: Sonntag, 20. Juni 2010 14:38
To: Ulrich Staudinger
Cc: 'Daniel Cegiełka'; 'Nick Torenvliet'; r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Recomendations for backtesting...
On 06/20/2010 06:36 AM, Ulrich Staudinger wrote:
> Try AQ-R, the R offspring of activeQuant. It's in the aq svn repository
and,
> if you ask me, without down setting the other packages, it is much more
> suited and also much more practical for large scale backtesting than the
> other ones, it works with bid/ask prices and just as an example, it uses
> vectors and not iterations ...
Not everything can be vectorized.
While it is true that much in strategy execution can and should be
vectorized,
at some point there are path dependent steps. You have a maximum position,
or
your next trade depends on the current trade, or you target position is some
percentage of current account equity. While indicators and signals can
often
be vectorized, these path-dependent steps are also a part of strategy
execution. Even some indicators are iterative, such as any ARMA or GARCH or
Kalman model.
That aside, there are always opportunities for performance improvement, and
C/C++ are readily available for places where the code needs to be faster.
Cheers,
- Brian
More information about the R-SIG-Finance
mailing list