Skip to content
All library documents

Choosing R Tools for Convertible Bond Arbitrage Backtesting

Article Quant Q&A · Author: Tal Fishman

Summary

The document asks how to backtest a modern convertible bond arbitrage strategy, with particular interest in R or Matlab packages and affordable data. The response separates strategy research tools by task: fPortfolio for simpler weight-based allocation, PortfolioAnalytics for more complex portfolio objectives, and quantstrat for indicator-driven signals and trading rules. It also points to RQuantLib for additional bond-pricing functionality.

The response distinguishes portfolio optimization from signal-based strategy testing, which helps narrow a software choice to the structure of the proposed model. It does not identify a ready-made package specifically for convertible bond arbitrage, provide implementation steps, or demonstrate a backtest. Data availability is a stated limitation: the respondent relies on commercial market-data services and cannot suggest a low-cost source. The recommendations are general tool guidance, and their suitability would depend on the model, instrument data, and pricing needs.

Key ideas

  • Tool choice depends on whether the research centers on portfolio weights or trading signals.
  • fPortfolio is suggested for simpler weight-based allocation and some bond pricing.
  • PortfolioAnalytics supports more complex portfolio objectives using custom functions.
  • quantstrat is suggested for indicator-based signals and trading rules.
  • The response does not provide convertible-bond data or a demonstrated backtest.

Tags

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


# 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)?

Updated to add:

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.

## Answer by Brian G. Peterson (score 4)

https://quant.stackexchange.com/a/1570

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

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.