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 used to have *******, but they are way more money for the same thing. I have had no probs with data from DTN since switching over." - Comment from Public Forum Post
"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 like you guys better than *******...much more stable and a whole lot fewer issues." - Comment from Philip
"I just wanted to let u know that your data feed/service is by far the best!!! Your unfiltered tick data is excellent for reading order flow and none of your competitors delivers this quality of data!" - Comment from Peter via Email
"You are much better than lawyers or the phone company because you answer the phone when I call! I just love your customer service." - Comment from Isreal
"It’s so nice to be working with real professionals!" - Comment from Len
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via Public Forum
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"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
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
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 »NEW IQFEED FORUMS »Data Questions »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: 73
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: 302
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: 302
Joined: Jun 13, 2005

Right Here & Now


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

altmany
-Interested User-
Posts: 73
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 Guru-
Posts: 394
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: Fri April 26, 2024 11:37 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003