question

Upvote
Accepted
87 10 13 14

Querying trading sessions of a RIC via Refinitiv Data Platform API

We would like to know if Refinitiv Data Platform supports requesting trade session information on a per RIC basis (or at least on a per exchange basis).

With trade session we mean time ranges where the market is open for trading, e.g. Mon-Fri 09:00-17:30.

The Eikon Desktop API has support for this via ThomsonReuters.Desktop.SDK.DataAccess.TimeSeries.Metadata.TradingSession.

We were told a couple of years ago that ultimately every functionality provided by Eikon Desktop API would be available via Refinitiv Data platform at some time as well.

We are aware of a legacy method to get hold of session times via so called TS1 QQ support pages but to our knowledge that data is no longer updated anymore and therefore not trustworthy anymore.

#productrdp-apirdpmetadata
icon clock
10 |1500

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

Upvotes
Accepted
551 0 0 1

@GoGoGroundhog I'm not aware of an endpoint designed for this type of metadata within rd/rdp libraries. The workaround I used is Average Volume Analytics API endpoint that outputs this data in info section of the response. This API covers all global equities. This solution obviously depends on your ability to access this API.

One more caveat is that these session times are Refinitiv session times (in line with our timeseries data/apps/charts), but not the session times established by the exchanges themselves (so for Nasdaq Refinitiv open/close is 14:30 UTC/21:02 UTC, while exchange open/close is 14:30 UTC/21:00 UTC). These 2 mins actually make a big difference. Closing cross trade is reported a few milliseconds after 21:00 and these additional 2 minutes allow to account for this important part of the session's volume. I hope this helps.

import refinitiv.data as rd
from datetime import datetime

session = rd.session.desktop.Definition().get_session()
rd.session.set_default(session)
session.open()

def mkt_hours_query(symbol):
    request_body={
        'universe': [symbol],
        'requestTime': datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
        'columns': [
            {'id': '1',
            'field': 'avat',
            'blendedVenue': False,
            'filters': {'official': True},
            'averagingInterval': 20,
            'startTime': {'marketTime': True},
            'endTime': {'marketTime': True}}
        ]
    }

    request = rd.delivery.endpoint_request.Definition(
        url = "https://api.refinitiv.com/data/analytics/average-volume-analytics/v2/request",
        method= rd.delivery.endpoint_request.RequestMethod.POST, 
            body_parameters= request_body)
    response = request.get_data()
    open_time_utc = datetime.strptime(response.data.raw['info'][symbol]['1']['startTime'], "%Y-%m-%dT%H:%M:%SZ").time()
    close_time_utc = datetime.strptime(response.data.raw['info'][symbol]['1']['endTime'], "%Y-%m-%dT%H:%M:%SZ").time()
    return open_time_utc, close_time_utc

mkt_hours_query('VOD.L) 
icon clock
10 |1500

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

Thanks Marosz for your workaround proposal,

we do not seem to be permissioned to that endpoint. Unfortunately the equity restriction would be a problem as well as most of our customers work with commodities/futures.
Thanks anyway!

Ingo

Upvotes
10.3k 18 6 9

@GoGoGroundhog thanks for your question - so for timeseries history - you can request which session(s) you want and this will adjust to whichever RIC you present:

response = historical_pricing.summaries.Definition(
    universe = "VOD.L", 
    interval = Intervals.ONE_MINUTE,     # Supported intervals: ONE_MINUTE, FIVE_MINUTES, TEN_MINUTES, THIRTY_MINUTES, ONE_HOUR
    count = 500,
    sessions = [
        MarketSession.PRE, 
        MarketSession.NORMAL, 
        MarketSession.POST
    ]
).get_data()
response.data.df

1676373518922.png

Is this is the sort of thing you are after? I hope this can help.



1676373518922.png (85.5 KiB)
icon clock
10 |1500

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

Upvotes
10.3k 18 6 9

@GoGoGroundhog Also you can check the times as well by requesting history for any instrument for a day say:

response = historical_pricing.summaries.Definition(
    universe = "VOD.L", 
    interval = Intervals.TEN_MINUTES,     # Supported intervals: ONE_MINUTE, FIVE_MINUTES, TEN_MINUTES, THIRTY_MINUTES, ONE_HOUR
    #count = 500,
    start = datetime.datetime(2023,2,13,0,0,0),      
    end = datetime.datetime(2023,2,13,23,59,59),   
    sessions = [
        #MarketSession.PRE, 
        MarketSession.NORMAL, 
        #MarketSession.POST
    ]
).get_data()
response.data.df

I hope this can help.

icon clock
10 |1500

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

Upvote
87 10 13 14

Hi Jason, thanks for your answer. Unfortunately this is not what we are after.
We need official trading session metadata for several purposes, e.g. for filtering realtime updates outside the session and we also present trading sessions to the end-user as additional information.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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