# How do I backtest a convertible bond arbitrage strategy in R/Matlab?

Since no one was able to answer my previous question, I am going to try to backtest a modern convertible bond arbitrage strategy myself (perhaps I'll report the results back here, if you're lucky :)). What suite of R packages should I use? Where can I get the data (free or cheap, preferably)?

The main question here is what pre-packaged routines or packages are available to test convertible bond arbitrage models (see linked question for description of models), not simply quantitative models in general. I presume they are most likely to be available in R, but I'd take Matlab, too. The cbprice function in the Fixed-Income Toolbox leaves much to be desired, here.

-
Does it matter what security generates the price? I have only used the backtest in R, but any of these should let you generate portfolios along with a periodicity and condition for portfolio entry/exit. –  Richard Herron Aug 4 '11 at 11:08
@richardh The tough part of these strategies is figuring out the Greeks (like options pricing). –  Tal Fishman Aug 4 '11 at 11:58
OK. I guess I consider that more a Greeks question than a backtesting question. Have you considered RQuantLib? –  Richard Herron Aug 4 '11 at 16:09
@richardh, right, hence my update above. I have tried looking through RQuantLib, but as I commented to Brian Peterson's post below, the documentation is not exactly user friendly, hence my question. –  Tal Fishman Aug 4 '11 at 16:18

I can't answer your question about the data, since my sources for data like that are Reuters and Bloomberg, neither of which are cheap.

For testing trading strategies, I'll separate them into three camps.

For 'simple' optimization schemes, RMetrics fPortfolio can likely do the trick. This would be for weight-based asset allocation. RMetrics also has some pricing functionality for bonds.

For 'complex' optimization schemes, still weight-based, PortfolioAnalytics can construct complex portfolio optimization problems using any arbitrary R function as part of your objective.

If you want to use indicators to define signals and construct trading rules, the quantstrat package will likely fit.

If you want additional pricing functionality for bonds, look at RQuantLib

-
Thanks for the info, but I was looking for specific info about convertible bonds (see update). I have tried searching the various R tools, but they are not exactly user friendly, hence my question. –  Tal Fishman Aug 2 '11 at 14:29