question

Upvotes
Accepted
1 2 3 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 512.0 KiB each and 1.0 MiB total.

Thank you for your participation in the forum.
Is the reply below satisfactory in resolving your query?
If yes please click the 'Accept' text next to the reply.
This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
AHS


Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
AHS


Upvotes
Accepted
5.7k 21 2 6

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 512.0 KiB each and 1.0 MiB total.

Upvotes
25.3k 87 12 25

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 512.0 KiB each and 1.0 MiB total.

Upvotes
1 2 3 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 512.0 KiB each and 1.0 MiB total.

Upvotes
5.7k 21 2 6

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 512.0 KiB each and 1.0 MiB total.

Upvotes
1 2 3 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 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.