Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TRTH /
avatar image
REFINITIV
Question by Arthur PHAM · Mar 02, 2018 at 05:29 PM · tick-history-rest-apipricingvolatility

EOD Implied volatility of equity stock options

I tried to follow the tutorial https://developers.thomsonreuters.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/learning?content=11268&type=learning_material_item in python and managed to retrieve the field list for EOD data but i don't see any fields to retrieve the implied volatility.

Is is possible ?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Mar 05, 2018 at 03:57 AM

Refer to DATA DICTIONARY - CUSTOM REPORTING FOR TICK HISTORY 11.3, the implied volatility fields are available in the Tick History Time and Sales report template.

  • Quote - Ask Implied Volatility
  • Quote - Bid Implied Volatility
  • Quote - Implied Volatility
  • Trade - Implied Volatility
       {
            "Code": "THT.Quote - Ask Implied Volatility",
            "Name": "Quote - Ask Implied Volatility",
            "Description": "Expected ask volatility that the market is pricing into the option, where ask volatility is the measure of the rate and magnitude of the change in the underlying instrument's ask price",
            "FormatType": "Number",
            "FieldGroup": "Quote"
        },
        {
            "Code": "THT.Quote - Bid Implied Volatility",
            "Name": "Quote - Bid Implied Volatility",
            "Description": "Expected bid volatility that the market is pricing into the option, where bid volatility is the measure of the rate and magnitude of the change in the underlying instrument's bid price",
            "FormatType": "Number",
            "FieldGroup": "Quote"
        },
        {
            "Code": "THT.Quote - Implied Volatility",
            "Name": "Quote - Implied Volatility",
            "Description": "Expected volatility that the market is pricing into the option, where volatility is the measure of the rate and magnitude of the change in the underlying instrument's price",
            "FormatType": "Number",
            "FieldGroup": "Quote"
        },

        {
            "Code": "THT.Trade - Implied Volatility",
            "Name": "Trade - Implied Volatility",
            "Description": "Expected volatility that the market is pricing into the option, where volatility is the measure of the rate and magnitude of the change in the underlying instrument's price",
            "FormatType": "Number",
            "FieldGroup": "Trade"
        },

To extract Tick History Time and Sales data, please refer to REST API Tutorial 4: On Demand tick data extraction.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Arthur PHAM · Mar 05, 2018 at 09:43 AM
@jirapongse.phuriphanvichai

Thank you, but it seems a little inconvenient to go though the tick data endpoint when i just need the EOD data. I used to use the EOD Realtime on TRTH v1 via the GUI, is there an equivalent here to retrieve the EOD needed to build an equity volatility surface on a stock (for each option ric, i need the bid/ask close, settlement price and the volatility at the end of day) ?

Here is the python code i have at this moment (i removed my password and username):

import requests, json
from requests import Request, Session
from collections import OrderedDict
import pprint as pp
import pandas as pd

class TRTH:
    def __init__(self):
        self._auth_token = self.get_auth_token()
        
    def get_auth_token(self):
        urlGetToken = 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Authentication/RequestToken'
        header = {'Content-Type': 'application/json'}
        body = json.dumps({'Credentials':{'Password':'#######','Username':'#######'}})
        response = requests.post(urlGetToken, body, headers=header)
        return response.json()['value']
    
    def resolve_historical_optionchain(self, chain, start_date, end_date):
        url = 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Search/HistoricalChainResolution'
        header = {'Content-Type': 'application/json', 'Authorization': 'Token ' + self._auth_token }
        body = json.dumps({'Request' : {'ChainRics': [chain], 'Range':{'Start':start_date, 'End':end_date} } } )
        response = requests.post(url, body, headers=header).json()['value'][0]['Constituents']
        output_rics = [{'Identifier':ric['Identifier'], 'IdentifierType':ric['IdentifierType']} for ric in response]
        return output_rics[0], output_rics[1:]
    
    def retrieve_historical_ref_data_fields(self):
        url = "https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/GetValidContentFieldTypes(ReportTemplateType=ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportTemplateTypes'HistoricalReference')"
        header = {'Content-Type': 'application/json', 'Authorization': 'Token ' + self._auth_token }
        body = json.dumps({})
        response = requests.get(url, body, headers=header).json()['value']
        return response
    
    #https://developers.thomsonreuters.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/learning?content=13675&type=learning_material_item
    def retrieve_historical_ref_data(self, rics, fields, start_date, end_date):
        url = 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/Extract'
        header = {'Content-Type': 'application/json', 'Authorization': 'Token ' + self._auth_token }
        body = json.dumps(
            {
                "ExtractionRequest": {
                    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest",
                    "ContentFieldNames": fields,
                    "IdentifierList": {
                        "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
                        "InstrumentIdentifiers": rics,
                        "ValidationOptions": {"AllowHistoricalInstruments": True},
                        "UseUserPreferencesForValidationOptions": False
                    },
                    "Condition": {
                        "ReportDateRangeType": "Range",
                        "QueryStartDate": start_date,
                        "QueryEndDate": end_date
                    }
                }
            }
        )


        response = requests.post(url, body, headers=header)
        try:
            response = response.json()['value']
        except KeyError:
            print(response, response.text)
        return response
    
    def retrieve_historical_eod_data_fields(self):
        url = "https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/GetValidContentFieldTypes(ReportTemplateType=ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportTemplateTypes'ElektronTimeseries')"
        header = {'Content-Type': 'application/json', 'Authorization': 'Token ' + self._auth_token }
        body = json.dumps({})
        response = requests.get(url, body, headers=header).json()['value']
        return response


trth = TRTH()
date = '2018-02-27'
underlying_ric, options_rics = trth.resolve_historical_optionchain(chain='0#DTEGn*.EX', start_date=date, end_date=date)
pp.pprint(underlying_ric)
#pp.pprint(options_rics)
#print(pd.DataFrame(data=underlying_ric).head())


#pp.pprint(trth.retrieve_historical_ref_data_fields())
ref_data = trth.retrieve_historical_ref_data(rics=options_rics, fields=['Strike Price', 'Expiration Date', 'Exercise Style', 'Put Call Flag'], start_date=date, end_date=date)
print(pd.DataFrame(data=ref_data).head())


pp.pprint(trth.retrieve_historical_eod_data_fields())


### Retrieve bid, ask, settlement price, implied vol at EOD for each option rics of the option chain
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Christiaan Meihsl · Mar 05, 2018 at 10:45 AM

@Arthur Pham,

The DATA DICTIONARY - CUSTOM REPORTING FOR TICK HISTORY 11.3 is your best tool to determine what templates will deliver what data fields. If you filter the field name column to display only those that contain the word Volatility, you will see that only the Tick History Time and Sales template delivers what you need. You will therefore have to make a separate request for that.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

Unable to download the EOD Data via AWS

RIC change: Cannot get TimeAndSales for Historic Instrument

Unable to make TimeAndSales ExtractionRequest

TRTH: Retrieving range data using Time and Sales Data

Do you have more detailed documentation?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges