3
$\begingroup$

I would like to backtest an options strategy in R. I require the ability to delta hedge and rebalance to options in the portfolio at different frequencies (daily, monthly,etc.) What packages are the correct ones to use for this purpose? (I have seen the R Finance task view but there is a lot there)

$\endgroup$
3
$\begingroup$

Assuming you already have a way to obtain hedge ratios and the like, your best available choice is probably blotter (used to be just quantstrat). You will find that it isn't necessarily oriented toward options.

Generally for options backtesting, pros end up making their own or buying commercial software. There are tons of commercial providers, but I don't know anyone who has investigated the top candidates.

$\endgroup$
2
  • 2
    $\begingroup$ note though that since it's not on CRAN yet, i think that means the ensemble of packages is still in 'beta' mode. $\endgroup$
    – Veeken
    May 10 '13 at 14:34
  • $\begingroup$ blotter is very stable, but quantstrat is not. blotter is accounting infrastructure, it isn't oriented toward any type of security. I'm currently working on adding options functionality to quantstrat. $\endgroup$ May 20 '13 at 17:20
2
$\begingroup$

My first thought would be to use quantlib package to get the delta values and comply those to get a position delta. Then use rules based on delta values to hedge. Use discrete time adjustments or use delta bands.

$\endgroup$
1
  • $\begingroup$ yep, i got the deltas already. i really need something to do the delta hedging for me and pnl computations as those get slightly messy $\endgroup$
    – Alex
    May 10 '13 at 1:20
0
$\begingroup$

I just published a blog post on how to backtest options strategies with R:
Backtesting Options Strategies with R

In the post, I provide the fully documented R code for your own experiments. The "trick" is to use the often publicly available implied volatility as a proxy for option prices (which are often hard to come by and/or very expensive).

For details please consult the post.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.