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)




"I just wanted to say how happy I am with your service. I was able to download the API docs last week and I was able to replicate Interactive Brokers historical bar queries and realtime bar queries over the weekend. That was about one of the fastest integrations that I've ever done and it works perfectly!!!!" - Comment from Jason via Email
"I have been using IQFeed now for a few years in MultiCharts and I have zero complaints. Very, very rare to have any data hiccups or anything at all go wrong." - Comment from Public Forum
"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
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"Thanks for all of your help. Great customer service deserves to be recognized which one the reasons I've been a customer of DTN for over 10 years!" - Comment from Stuart
"Just a thank you for the very helpful and prompt assistance and services. You provided me with noticeably superior service in my setup compared to a couple of other options I had looked at." - Comment from John
"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from Public Forum
"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"I had always used ******* but for the past 2 weeks have been trying DTN IQFeed. Customer support has been extraordinary. They call just to make sure your problem hasn't recurred." - 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 »Product Support »Data and Content Support »How do I get real-time options greeks using web sockets?
Author Topic: How do I get real-time options greeks using web sockets? (8 messages, Page 1 of 1)

gnosis
-Interested User-
Posts: 3
Joined: Feb 19, 2021


Posted: Feb 20, 2021 12:11 PM          Msg. 1 of 8
Hi,

I am able to get the real-time options data, like the last price, bid, and ask, but can't seem to find a way get the greeks using web sockets. Can someone please help?

Thanks

-Irfan

altmany
-Interested User-
Posts: 56
Joined: Jul 30, 2018

IQML - IQFeed-MATLAB connector


Posted: Feb 20, 2021 12:36 PM          Msg. 2 of 8
I do not believe that IQFeed has a dedicated query for requesting greeks, nor are the greeks reported by IQFeed in the standard market-data query.

Some of the software that connects to IQFeed (for example, my IQML connector for Matlab) calculate the greeks internally and report them to the user. If you are developing your own program, you can calculate the greeks using the information reported for the options and their underlying asset, and the standard Mathematical definitions: https://en.wikipedia.org/wiki/Greeks_(finance).

Yair Altman
IQML - IQFeed-MATLAB connector
https://UndocumentedMatlab.com/IQML

I am not a DTN employee; my post reflects my personal opinion

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

Right Here & Now


Posted: Feb 20, 2021 03:24 PM          Msg. 3 of 8
hi altmany:

Quote: my IQML connector for Matlab) calculate the greeks internally and report them to the user


What do you use as a source of interest rate?

----

https://github.com/rburkholder/trade-frame/tree/master/lib/TFIQFeed
Edited by stargrazer on Feb 20, 2021 at 03:25 PM

gnosis
-Interested User-
Posts: 3
Joined: Feb 19, 2021


Posted: Feb 20, 2021 04:41 PM          Msg. 4 of 8
The delta can be calculated using the following five values:

1. Stock Price
2. Option Strike Price
3. Time to Expiration
4. Risk-Free Rate
5. Implied Volatility

I am not sure how to get #4 and #5.

Does anyone know?

Thanks

-Irfan

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

Right Here & Now


Posted: Feb 20, 2021 05:23 PM          Msg. 5 of 8

altmany
-Interested User-
Posts: 56
Joined: Jul 30, 2018

IQML - IQFeed-MATLAB connector


Posted: Feb 21, 2021 02:48 AM          Msg. 6 of 8
For the volatility value you can use the Historical_Volatility field from the underlying asset's fundamental data. DTN's official description of this field is: “30-trading day volatility, calculated using Black-Scholes”. Apparently, the actual calculation (which is updated once a day, after midnight) for options computes the volatility of day-to-day price change values of the last 30 trading days, using the last 31 daily close prices, as follows:
100*sqrt(252)*std(ln(close(i+1)/close(i)))
, rounded to the nearest 0.01. For futures, the calculation is similar but apparently based on 90 (not 30) values. When a contract is newly-listed, fewer values are used, with a minimum of 4 values.

You can also calculate the historic volatility yourself, using historic prices of the underlying asset (use IQFeed's historic bars query for this). In this case, you can use a different number of historic prices for the calculation, ignore outlier values etc., without relying on DTN's built-in opaque calculation.

As an alternative to using the historic volatility, you can also calculate the implied volatility using Black-Scholes. This will typically be easier for European derivatives than for American/Asian/exotic ones.

In my IQML connector I enable the user to choose whether to use IQFeed's built-in Historical_Volatility field, or a calculated Implied Volatility, or a fixed value.

For the risk-free rate, you can either set a fixed rate (in the current financial situation, a simple value of 0 may be close enough for practical purposes), or use the current value of assets such as LIBOR/IRX.XO.

See http://forums.iqfeed.net/index.cfm?page=topic&topicID=4387 for some detailed discussion of these matters.


Yair Altman
IQML - IQFeed-MATLAB connector
https://UndocumentedMatlab.com/IQML

I am not a DTN employee; my post reflects my personal opinion

Edited by altmany on Feb 21, 2021 at 02:58 AM

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 180
Joined: Jul 3, 2019


Posted: Feb 22, 2021 07:12 AM          Msg. 7 of 8
For the record, altmany is correct that the IQFeed API will not give you the Greeks correctly; you will have to calculate them yourself using data that it does provide.

The "Fundamental Message" and "Update/Summary Messages" pages of the online IQFeed help will list of all data points that are available via the IQFeed API.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

gnosis
-Interested User-
Posts: 3
Joined: Feb 19, 2021


Posted: Feb 25, 2021 09:35 AM          Msg. 8 of 8
Thank you all.

It would be great to provide greeks along with other options data.

I have put in a wishlist request for a future release.

-Irfan
 

 

Time: Wed April 21, 2021 5:41 AM CFBB v1.2.0 16 ms.
© AderSoftware 2002-2003