Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
  • Refinitiv Data Platform Libraries /
avatar image
REFINITIV
Question by mahjoub.faraj · Mar 17, 2021 at 08:34 AM · rdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries

Using the MarketSession parameter in RDP HistoricalPricing endpoint

Hello team,

I am trying to retrieve HistoricalPricing events using rdp.HistoricalPricing.get_events and I would like to specify the MarketSession, but I am getting an error,

Can you please help me build this request?

Thank you for your help


marketsession.png (39.2 KiB)

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 17, 2021 at 10:07 AM

@mahjoub.faraj

The get_events method in the RDP library doesn't have the sessions property. However, you can directly send a request to the /data/historical-pricing/v1/views/events/ endpoint to get the data.

import pandas as pd
endpoint = rdp.Endpoint(
    session = rdp.get_default_session(), # Optional
    url = "/data/historical-pricing/v1/views/events/VOD.L")
response = endpoint.send_request(
    method = rdp.Endpoint.RequestMethod.GET,
    query_parameters={
                
        'eventTypes': 'trade',        
        'start': '2021-03-15T00:00:00.000000000Z',
        'end': '2021-03-16T00:00:00.000000000Z',
        'sessions': 'normal'
    }
)
if response.is_success:
    headers = [h['name'] for h in response.data.raw[0]['headers']]
    df = pd.DataFrame(data=response.data.raw[0]['data'], columns=headers)
    display(df)
Comment
umer.nalla

People who like this

1 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 umer.nalla · Mar 17, 2021 at 09:50 AM

Hi @mahjoub.faraj

Looking at the help for the Historical Pricing, the sessions parameter is only valid with summaries data e.g.

rdp.get_historical_price_summaries(
    universe = 'IBM.N', 
    interval = rdp.Intervals.ONE_MINUTE,    
    count = 500,
    sessions = [
        rdp.MarketSession.PRE, 
        rdp.MarketSession.NORMAL, 
        rdp.MarketSession.POST
    ]
) 

or

response = rdp.HistoricalPricing.get_summaries(
    universe = 'IBM.N', 
    interval = rdp.Intervals.ONE_MINUTE,    
    count = 500,
    sessions = [
        rdp.MarketSession.PRE, 
        rdp.MarketSession.NORMAL, 
        rdp.MarketSession.POST
    ]
)   
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 mahjoub.faraj · Mar 17, 2021 at 10:50 AM

Thank you both for your answers!

@umer.nalla : the reference reads: "The sessions parameter represents a list of interested official durations in which trade and quote activities occur for a particular universe. The parameter is only available in intraday-summaries, events and single-event APIs and its possible values include"

I expect the feature to be available in the events api...


@jirapongse.phuriphanvichai

I tried your code and it works well! Thanks for that

That said, the python library suggest the feature (should) exist: a session parameter shows in the auto suggest as well as the sessions values enumerator.


getevents.png (6.3 KiB)
Comment

People who like this

0 Show 1 · 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
umer.nalla ♦♦ · Mar 17, 2021 at 11:02 AM 0
Share

Hi @mahjoub.faraj

Thanks for the update. I was referring to the help output for the RDP library Historical Pricing Contents and Function Layers that I assumed you wanted to use. e.g.

get_events(universe, session=None, eventTypes=None, start=None, end=None, adjustments=None, count=None, fields=None, on_response=None, closure=None)

OR

get_historical_price_events(universe, eventTypes=None, start=None, end=None, adjustments=[], count=1, fields=[], on_response=None, closure=None)

Just to clarify, the session parameter in the above list is the 'connection session' e.g. platform session or desktop session - not sessions

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 >
8 People are following this question.

Related Questions

How can I get hourly data via python RDP api?

Python RDP Refresh token failed, response is None

Where can I get refinitiv-dataplatform library document(python)

Cannot retreive chains with RDP Chains class

Python RDP StreamingPrices returns no data

  • 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