question

Upvotes
Accepted
1 0 1 3

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?

pythondatastream-apidsws-apitime-series
icon clock
10 |1500

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

Upvotes
Accepted
1.4k 6 2 2

Hi @tom.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.

icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

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.


icon clock
10 |1500

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

Upvotes
1 0 1 3

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

icon clock
10 |1500

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

Upvotes
1.4k 6 2 2

Hi @tom.oddo

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


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':

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')



1604316777926.png (34.3 KiB)
1604317182590.png (197.3 KiB)
icon clock
10 |1500

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

Upvotes
1 0 1 3

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

icon clock
10 |1500

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

Click below to post an Idea Post Idea