[R-SIG-Finance] Backtesting trade systems

Mark Breman breman.mark at gmail.com
Thu Jul 16 16:15:11 CEST 2009

I have spend quit some time now looking for a package that allows me to
backtest (technical) trading systems based on single financial instruments
with R.

I had a look at Rmetrics, blotter, fTrading, PerformanceAnalytics, backtest,
quantmod, TTR etc, but not one of these fill my requirements. It's not that
they are not usefull, on the contrary, they are all filled with terrific
statistical stuff, but it's not the simple, practical and straightforward
approach that I am looking for as a trader rather than as a statisticus.

So I have decided to build my own solution, reusing as much as possible from
these existing packages. (As a former software engineer I know how much time
and effort goes into buiding reliable software, so the more reuse the
better). As I am quite new to R and statistics in general, there is a lot to
learn for me here...

What I have build so far is a very basic set of functions called
"tradesim.R" (I have attached it to this post). A very basic example of how
these functions can be used for a backtest-run can be found in
"tradesim_example.R". The example runs a backtest with end-of-day data from
AAPL, using a (rather poor) trading system based on the RSI indicator (from
the TTR package).

Now I have read in some older post on this list that others were also
searching for a backtesting package. I even read a post proposing to start a
group effort creating such a package. I suspect that some of you might be
interested in what I made so far and maybe would like to put in a effort
creating such a package together. I certainly know that it's a lot easier to
create good software as a group, rather than by a single person...

So if you are interested have a look at what I got so far and let me know
what you think.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090716/b29a70de/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tradesim.R
Type: application/octet-stream
Size: 4743 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090716/b29a70de/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tradesim_example.R
Type: application/octet-stream
Size: 521 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090716/b29a70de/attachment-0001.obj>

More information about the R-SIG-Finance mailing list