Get Open net return prices

My code is this:

ds.get_data('DJES50I',['NR'], start = '2000-01-01', end = '2020-07-31')


and I just want to know how do I have to fill in the "Open" statement to make it work?

I`ve seen the other article, but that is way too much unnecessary code for me..


so is there an easy solution?

Best Answer

  • [Deleted User]
    [Deleted User] Newcomer
    Answer ✓

    Hi @tom.oddotom.oddo,

    If you are particularly looking for historical 'NR' ('Net Return') daily data, you may use the following:


    ds.get_data(tickers = 'DJES50I', fields = ['NR'], start = '2000-01-01', end = '2020-07-31', freq = 'D')


    I tested it myself and it returns data as expected. I also verified the data returned by Datastream with our Refinitiv Workspace and can confirm that using 'fields = ['PO']' correctly returns Open Prices - i.e.: the EURO STOXX 50 index at the opening of the market.

Answers

  • Hi @tom.oddo

    I am not sure what the "Open" statement refers (if you can elaborate that would be great).

    However, I am going to guess from the ds prefix that you are trying to use DataStreamDSWS library

    If so, the following works for me when I use my own Datastream username and password

    import DatastreamDSWS as DSWS
    ds = DSWS.Datastream(username ="myusername", password="mypassword")
    ds.get_data('DJES50I',['NR'], start = '2000-01-01', end = '2020-07-31'

    if you are not using DatastreamDSWS then please state which library ds refers to.

    Or if the above does not answer your question please expand on what you mean with (incomplete) code snippets if appropriate.


  • Hi,

    yes thats right.

    With "Open" I want the value of the stoxx 50 index at the opening of the market.

    (I think the price I get is the close price)


    Thanks in advance

  • Hi @tom.oddotom.oddo

    You may find information on our DatastreamDSWS Python API's fields in several ways, either via the 'help' function:

    image


    Via the 'Getting started with Python' found in our Refinitiv Developer Portal's Datastream Web Service's Documentation page, or - most probably what you are looking for :


    Via 'product.datastream.com' (where you will need to log in with your Datasream credentials), where you may find information on DSWS data on the ticket 'DJES50I':

    image

    Once there, you may click on the 'More' option (that I pointed in red above for you) where you may find the exhaustive list of variables you may use in the 'fields' argument of 'DatastreamDSWS.get_data'.

    In your case, I believe the best candidate is 'Price - Opening' with variable 'PO'; i.e.:


    ds.get_data(tickers = 'DJES50I',
                fields = ['PO'],
                start = '2000-01-01',
                end = '2020-07-31',
                freq = 'D')


  • Hi,


    with the help function you dont see a lot.

    The datastream link is good, but not what I want... I already knew PI and PO

    but I want the open for NR , which doesnt seem to be available... that was the question.


    Thanks