Yahoo! Finance Options
Usage
Excel formula for using option codes:
=RTD("gartle.rtd",,"YahooFinanceOptions","<Option Code>","<Data Field>")
Option code format:
[.]<Option Symbol><Expiration Date><Option Type Char><Strike>
Expiration date format:
yymmdd
Option type char: C or P
Strike format:
8 digits with leading zero as strike * 1000 (Yahoo! Finance format) 7 digits with leading zero as strike * 100 6 digits with leading zero as strike * 10 strike as is with or without decimal part (common strike format)
Examples:
=RTD("gartle.rtd",,"YahooFinanceOptions","YHOO170120C00050000","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO170120C00050","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO170120C50","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO170120C50.0","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions",".YHOO170120C50.0","OpenInt") (Thinkorswim format)
Excel formula for using option specifications:
=RTD("gartle.rtd",,"YahooFinanceOptions","<Option Symbol>",<Expiration Date>,<Strike>,"<Option Type>","<Data Field>")
Expiration date formats:
yymmdd yyyy-mm-dd mmmdd,yy mmmdd'yy
Option type format: C or CALL, P or PUT
Examples:
=RTD("gartle.rtd",,"YahooFinanceOptions","YHOO", "170120", 50, "CALL","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO", "2017-01-20", 50, "C","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO", "JAN20,17", 50, "PUT","OpenInt") =RTD("gartle.rtd",,"YahooFinanceOptions","YHOO", "JAN20'17", 50, "P","OpenInt")
Use https://finance.yahoo.com/ to find option codes. Options data is available for US exchanges and can be not available for other world's exchanges.
Important Notes
Do not request the Yahoo! website frequently. Otherwise, your IP can be banned by the Yahoo! website.
RealTimeToExcel loads one page to get the data for all options of the month. This feature significantly reduces amount of requests to the Yahoo! website.
Data Fields and Excel Formulas
Formulas for getting data by option codes:
Excel Column | Excel Formula |
---|---|
Code | AAPL170120C00100000 |
OptionCode | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"OptionCode") |
Symbol | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Symbol") |
OptionSymbol | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"OptionSymbol") |
ExpDate | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Exp") |
Strike | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike") |
Type | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Type") |
Last | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Last") |
Change | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Change") |
PercentChange | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"ChangeInPercent") |
Mark | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Mark") |
Bid | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Bid") |
Ask | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Ask") |
Volume | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Volume") |
OpenInt | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"OpenInt") |
ImpliedVolatility | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"ImpliedVolatility") |
Strike~0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike~0") |
Strike+0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike+0") |
Strike-0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike-0") |
Strike+1 | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike+1") |
Strike-1 | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"Strike-1") |
rtd_LastError | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"rtd_LastError") |
rtd_LastMessage | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"rtd_LastMessage") |
rtd_LastUpdate | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"rtd_LastUpdate") |
rtd_LastUpdateDate | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"rtd_LastUpdateDate") |
rtd_LastUpdateTime | =RTD("gartle.rtd",,"YahooFinanceOptions",[Code],"rtd_LastUpdateTime") |
Formulas for getting data by option contract specifications:
Excel Column | Excel Formula |
---|---|
OptionSymbol | AAPL |
ExpDate | 170120 |
Strike | 100 |
Type | CALL |
OptionCode | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"OptionCode") |
Symbol | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Symbol") |
Last | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Last") |
Change | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Change") |
PercentChange | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"ChangeInPercent") |
Mark | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Mark") |
Bid | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Bid") |
Ask | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Ask") |
Volume | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Volume") |
OpenInt | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"OpenInt") |
ImpliedVolatility | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"ImpliedVolatility") |
Strike~0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Strike~0") |
Strike+0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Strike+0") |
Strike-0 | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Strike-0") |
Strike+1 | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Strike+1") |
Strike-1 | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"Strike-1") |
rtd_LastError | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"rtd_LastError") |
rtd_LastMessage | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"rtd_LastMessage") |
rtd_LastUpdate | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"rtd_LastUpdate") |
rtd_LastUpdateDate | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"rtd_LastUpdateDate") |
rtd_LastUpdateTime | =RTD("gartle.rtd",,"YahooFinanceOptions",[OptionSymbol],[ExpDate],[Strike],[Type],"rtd_LastUpdateTime") |
Symbol, OptionSymbol, Exp, Strike, and Type are calculated by parsing the option code.
OptionCode is the option code in the standard Yahoo! Finance format.
OptionSymbol ends with 7 for Mini Options, and with 1 for some options before splits.
The ChangeInPercent, ChangePercent, and Percent values are calculated by RealTimeToExcel and are the same. The Mark value is calculated as (Bid+Ask)/2.
Use Strike~0 to find the ATM strike, Strike+0 or Strike-0 to find equal or the nearest strikes, and Strike+1 and Strike-1 to find the nearest strikes above and below the strike.
See Copying formulas about inserting formulas into Excel spreadsheets.
Data Provider Settings
The data provider is configured to loading data every hour when the Excel workbook is open.
Parameter | Value |
---|---|
RefreshInterval | 01:00:00, one hour |
NextRequestDelay | 1000, one second |
DataStartTime | 00:00:00 -05:00 |
DataEndTime | 24:00:00 -05:00 |
LoadEndTime | 24:00:00 -05:00 |
LoadOnSaturday | 1, loading Friday's data once. |
LoadOnSunday | 1, loading Friday's data once. |
Data Source
YQL web service query:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.options
Yahoo! Finance website link example:
https://finance.yahoo.com/q/op?s=AAPL+Options