Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"If you want customer service that answers the phone, your best bet is IQFeed. I cannot stop praising them or their technical support. They are always there for you, and they are quick. I have used ****** too but the best value is IQFeed." - Comment from Public Forum
"For anyone considering using DTN.IQ for a data feed, my experience with the quality of data and the tech support has been very positive." - Comment from Public Forum
"If you are serious about your trading I would not rely on IB data for serious daytrading. Took me a while to justify the cost of IQ Feed and in the end, it's just a 2 point stop on ES. Better safe than sorry" - Comment from Public Forum
"And by the way, have to say this. I love the IQFeed software. It's rock solid and it has a really nice API." - Comment from Thomas via RT Chat
"I'm satisfied with IQFeed. It's the most reliable and fastest quote feed I have ever used. Although I'm a resident in China, it's still very fast!" - Comment from Xiaofei
"Everything is working great with the API. I love it." - Comment from Calvin
"IQ feed is brilliant. The support is mind-bending. What service!" - Comment from Public Forum Post
"I've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"I am a hedge fund manager here. It’s funny, I have a Bloomberg terminal and a Bridge feed, but I still like having my DTN feed!" - Comment from Feras
"I "bracket trade" all major news releases and I have not found one lag or glitch with DTN.IQ feed. I am very comfortable with their feed under all typical news conditions (Fed releases, employment numbers, etc)." - Comment from Public Forum
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »Archive (2017 and earlier) »IQFeed Developer Support »greeks / delta
Author Topic: greeks / delta (11 messages, Page 1 of 1)

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 8, 2017 09:14 PM          Msg. 1 of 11
For historical and/or real-time options data, is there any computation of greeks available from iqfeed?

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Sep 12, 2017 06:12 AM          Msg. 2 of 11
Hello, sorry for the late response. We do not provide the greeks themselves within the API but there should be sufficient underlying data within the API that you can do these calculations within your application.

We also provide an option chains display within our DTN.IQ product (your account might already be authorized to use this) that shows greeks but they aren't available programatically.

stargrazer
-DTN Guru-
Posts: 302
Joined: Jun 13, 2005

Right Here & Now


Posted: Sep 12, 2017 06:18 AM          Msg. 3 of 11
Part of a 'greeks' calculation is the risk free interest rate. What symbol or set of symbols could be used for obtaining these values?

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Sep 12, 2017 06:34 AM          Msg. 4 of 11
Good catch. We do not provide the interest rate within the feed. Our chains display leaves this field up to the user to populate.

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 12, 2017 07:03 AM          Msg. 5 of 11
The short story is, use IRX.XO. The long story is longer, of course.

Theoretically, if you want to be precise, that depends on two things. A call is a delayed purchase, so you are holding cash and earning the risk-free rate on that cash prior to purchase. The benefit of delaying the purchase with the call goes up as the interest rate on your cash goes up, so the price of the call goes up. So length of time and location in the world where you are holding your cash would both be factors.

In the US, you might typically use T-bill rates that correspond to the time-to-expiry of the option.

In Europe, you might typically use German Bund rates.

However the LIBOR interbank over-night interest rates is also widely used for shorter terms.

https://quant.stackexchange.com/questions/15916/which-risk-free-rate-is-assumed-by-market-when-pricing-american-options

https://quant.stackexchange.com/questions/24414/how-to-use-the-black-scholes-formula-with-libor-rates

https://quant.stackexchange.com/questions/28287/risk-free-rate-vs-libor

Hull and White (authors of the canonical textbook on derivatives pricing)
http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/LIBORvsOIS.pdf
write in their abstract:
"Traditionally practitioners have used LIBOR and LIBOR-swap rates as proxies for risk-free rates
when valuing derivatives. This practice has been called into question by the credit crisis that
started in 2007. Many banks now consider that overnight indexed swap (OIS) rates should be
used as the risk-free rate when collateralized portfolios are valued and that LIBOR should be
used for this purpose when portfolios are not collateralized. This paper examines this practice
and concludes that OIS rates should be used in all situations."

Beyond theory, in practice, the risk-free rate is both (nowadays) small and changes very slowly. Since you usually want to match your markets pricing, you would typically either (1) just use a 30-day t-bill price; or (2) just calibrate against what an average of what current prices are saying they are using for the risk free rate by backsolving for it.

In even simpler practice, and for computing with IQFeed data, I would simply use the IRX.XO symbol:

IRX.XO is the 13-week T-bill (Treasury bill) yield index, published by the CBOE. Currently it is about 1% so its not going to make a huge impact on your greeks anyway, but you've got to use something, so use IRX.XO. It is readily available in the IQFeed.

stargrazer
-DTN Guru-
Posts: 302
Joined: Jun 13, 2005

Right Here & Now


Posted: Sep 12, 2017 07:33 AM          Msg. 6 of 11
Thanx for that. I guess for what I found so far is not so far off the mark.

One of those links suggested using an interest rate near the expiry. There is an IQFeed LIBOR symbol set. The following seem to be active, based upon

http://www.global-rates.com/interest-rates/libor/american-dollar/american-dollar.aspx

An extract from some of my code for using the symbols.

Quote:
structSymbol( time_duration( hours( 0 * 24 ) ), "ONLIB.X" ), // overnight
structSymbol( time_duration( hours( 7 * 24 ) ), "1WLIB.X" ), // 1 week
structSymbol( time_duration( hours( 30 * 24 ) ), "1MLIB.X" ), // 1 month
structSymbol( time_duration( hours( 60 * 24 ) ), "2MLIB.X" ), // 2 month
structSymbol( time_duration( hours( 90 * 24 ) ), "3MLIB.X" ), // 3 month
structSymbol( time_duration( hours( 180 * 24 ) ), "6MLIB.X" ), // 6 month
structSymbol( time_duration( hours( 365 * 24 ) ), "1YLIB.X" ); // 1 year


For treasury, I found these symbols:

Quote:
structSymbol( time_duration( hours( 0 * 24 ) ), "TB30.X" ), // overnight, base at 0 days needed for algorithm
structSymbol( time_duration( hours( 30 * 24 ) ), "TB30.X" ), // 30 day
structSymbol( time_duration( hours( 90 * 24 ) ), "TB90.X" ), // 90 day
structSymbol( time_duration( hours( 180 * 24 ) ), "TB180.X" ), // 180 day
structSymbol( time_duration( hours( 365 * 24 ) ), "1YCMY.X" ); // 1 year


Can't say this is the right way, but at least it gets me in to the right ball park.

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 12, 2017 12:59 PM          Msg. 7 of 11
Nice. Great finds.

For those using IRX.XO (e.g. for the ~13week timeframe), remember to divide by 1000 to get a percentage (annualized percentage rate). Example: the current value of 10.18 represents a 1.018% interest rate.
Edited by J on Sep 12, 2017 at 03:16 PM

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 12, 2017 10:24 PM          Msg. 8 of 11
@stargazer: The data look reasonable for those symbols. My only concern would be interest rate used for 0-2 week expiring options. TB30.X may be reasonable, but then again it may not be. I would spot check and compare against broker or other software's computed greeks.

Also as a sanity check for the 90 day/IRX.XO suggestion, here is the IRX.XO in context. It doesn't interpolate perfectly, but its not bad.

## showing current values after market close 2017Sept12.
## for same day/same week options, TB30.X is probably a little too high.
##
structSymbol( time_duration( hours( 0 * 24 ) ), "ONLIB.X" ), // overnight # 1.18%
structSymbol( time_duration( hours( 7 * 24 ) ), "1WLIB.X" ), // 1 week # 1.20%
structSymbol( time_duration( hours( 30 * 24 ) ), "1MLIB.X" ), // 1 month # 1.24%
structSymbol( time_duration( hours( 60 * 24 ) ), "2MLIB.X" ), // 2 month # 1.27%
structSymbol( time_duration( hours( 90 * 24 ) ), "3MLIB.X" ), // 3 month # 1.32%
structSymbol( time_duration( hours( 180 * 24 ) ), "6MLIB.X" ), // 6 month # 1.45%
structSymbol( time_duration( hours( 365 * 24 ) ), "1YLIB.X" ); // 1 year # 1.70%

structSymbol( time_duration( hours( 0 * 24 ) ), "TB30.X" ), // ???
structSymbol( time_duration( hours( 30 * 24 ) ), "TB30.X" ), // 30 day # 0.96%
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "IRX.XO" // 91 day # 1.018
structSymbol( time_duration( hours( 90 * 24 ) ), "TB90.X" ), // 90 day # 1.03%
structSymbol( time_duration( hours( 180 * 24 ) ), "TB180.X" ), // 180 day # 1.14%
structSymbol( time_duration( hours( 365 * 24 ) ), "1YCMY.X" ); // 1 year # 1.27%
structSymbol( time_duration( hours( 2*365*24 ) ), "2YCMY.X" ); // 2 year # 1.33%

stargrazer
-DTN Guru-
Posts: 302
Joined: Jun 13, 2005

Right Here & Now


Posted: Sep 13, 2017 07:49 AM          Msg. 9 of 11
@J: I needed to do a linear interpolation from 0 to 30 days for the TB30.X... that is why you see it as 0 in my list. I don't know what symbol might reflect a TB overnight rate, or similar, or if even there is such an animal. Any thoughts?

I havn't done the inverse calculation to see what others are doing. I'm still evolving towards matching up what other providers, like IB, are generating for IV first. Whether they use mid-bid, or log(mid-bid), or bid or ask, or last trade or .....

In case any one is interested in what I've done:

Basic binomial code is at:

https://github.com/rburkholder/trade-frame/blob/master/lib/TFOptions/Binomial.cpp

The code where I build those tables and interpolate the interest rate:

https://github.com/rburkholder/trade-frame/blob/master/lib/TFTrading/NoRiskInterestRateSeries.cpp

Code where I bring all that together:

https://github.com/rburkholder/trade-frame/blob/master/lib/TFOptions/Option.cpp

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 15, 2017 12:51 AM          Msg. 10 of 11
> Any thoughts?

I'm not certain. I was reading that libor USD overnight rate is the usual thing, as "its more independent of New York". LOL. For all that suspicion of the US market, it turns out LIBOR is more likely to have been manipulated. Anyway, the short term LIBOR rates denominated in USD should be reasonable.

> Whether they use mid-bid...

The midpoint is probably your best bet. Model computations typically put the theoretical price between the inside bid and inside ask of my broker's quotes.

> code is at:

This is quite a nice collection of code!

J
-Interested User-
Posts: 24
Joined: Jun 27, 2017


Posted: Sep 27, 2017 08:17 AM          Msg. 11 of 11
> Any thoughts?

@stargazer: I confirmed with a popular vendor of historical options data and derived data that they use the 30 day interest rate even for expirations of less than 30 days.
 

 

Time: Fri April 26, 2024 11:19 PM CFBB v1.2.0 11 ms.
© AderSoftware 2002-2003