Skip to content

Using quantstrat with options

4 messages · Sal Abbasi, Frank

#
What is a good way to model holding an option till expiry?

The only way I can think about is this:

1.  For each option, add or update the final bar?s price to option expiry value (0 or intrinsic value).  For many options, there is no market data at expiry date / time since the option is too deep in the money or out of the money, so I would have to add the final bar if it does not exist.
2.  Add or update the penultimate bar so the order can be generated at the penultimate bar and executed at the final bar.
3.  Add an indicator for time to maturity
3.  Add a signal for ttm == 1 minute (since my bars are 1 minute long)
4.  Added a rule to exit when ttm == 1 minute (the order is generated at ttm == 1 minute and gets executed when ttm == 0)

Is there a cleaner way to accomplish this?

Best,

Sal
2 days later
#
Traders use bar charts to uncover actionable patterns: double tops, rounded bottoms, selling against a trendline, outside day lower close and lots of others. This is because the price discovery of stocks, futures, FX and bonds follow certain patterns that technical traders use to trade. I have not seen any research that says this can be translated to options. 

Implied volatility of option(s) is the closest to price discovery for stocks, bonds ... You can buy historical options to calculate your own volatility or you can buy volatility data from the CBOE.  Option traders use the Black-Scholes, Fisher Black or their own option model to analyze options. Which options, the weighting method all impact the implied volatility. 

What would be the ultimate goal of your analysis?

Frank
Chicago, IL
-----Original Message-----
From: R-SIG-Finance <r-sig-finance-bounces at r-project.org> On Behalf Of Sal Abbasi
Sent: Wednesday, April 04, 2018 10:18 PM
To: Brian G. Peterson <brian at braverock.com>
Cc: r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] Using quantstrat with options

What is a good way to model holding an option till expiry?

The only way I can think about is this:

1.  For each option, add or update the final bar?s price to option expiry value (0 or intrinsic value).  For many options, there is no market data at expiry date / time since the option is too deep in the money or out of the money, so I would have to add the final bar if it does not exist.
2.  Add or update the penultimate bar so the order can be generated at the penultimate bar and executed at the final bar.
3.  Add an indicator for time to maturity 3.  Add a signal for ttm == 1 minute (since my bars are 1 minute long) 4.  Added a rule to exit when ttm == 1 minute (the order is generated at ttm == 1 minute and gets executed when ttm == 0)

Is there a cleaner way to accomplish this?

Best,

Sal
_______________________________________________
R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
#
I have an options strategy that I?m trying to backtest.  It involves buying or selling options that are underpriced or overpriced according to my model and delta hedging them.  In some cases I would end up getting rid of the option before expiry and in other cases I would hold the option till expiry. In the cases where I hold till expiry I had to follow the approach below to make this work within quantstrat. I was wondering if somebody had come up with a less ?hacky?, more elegant solution. 

Best,

Sal
#
Sal,

OK, that is clear.

1) I would run your model on back data to estimate whatever additional parameters you need with your model. The sum of the squared differences between your model prices and market prices should be substantially less than the sum of the squared differences  for the Black-Scholes or Fisher Black model. Although this is not the kind of back testing I'd do on a stock trading model, it is effective for options.

2) Pick out an expensive option spread. Buy a cheap or fairly priced option and sell an expensive option, i.e. sell this spread. Follow the option spread over time. I don't think you want to model the option prices going forward. Your model identifies mispriced options, which you don't want to use, and volatility bounces around in a non-forecastable way for the Black or Black-Scholes model, leaving you with using historical data. See if the spread makes money.

3) Assume the cheap option has a delta of 0.25 and the expensive option has a delta of 0.50. You'd buy 2 of the cheap options against selling 1 of the expensive options. Watch this trade going forward to see if it makes money. It will make less money than the 1 x 1 spread in 2 above: you are buying double the number of cheap options which will probably lose value and short one expensive option on which you will probably make money. I think the CBOE has a dataset that does include delta and other Greeks. That may be one way of creating a delta neutral spread. Back testing the trade and rebalancing the options over time to keep the trade delta neutral is probably best done using a procedural language like C/C++ or a spreadsheet, not quantstrat.

Best,

Frank
Chicago


-----Original Message-----
From: Sal Abbasi <abbasi.sal at gmail.com> 
Sent: Sunday, April 08, 2018 2:13 PM
To: Frank <frankm60606 at gmail.com>
Cc: Brian G. Peterson <brian at braverock.com>; r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] Using quantstrat with options

I have an options strategy that I?m trying to backtest.  It involves buying or selling options that are underpriced or overpriced according to my model and delta hedging them.  In some cases I would end up getting rid of the option before expiry and in other cases I would hold the option till expiry. In the cases where I hold till expiry I had to follow the approach below to make this work within quantstrat. I was wondering if somebody had come up with a less ?hacky?, more elegant solution. 

Best,

Sal