question

Upvotes
Accepted
7 1 0 3

Relative stock price vs index performance

Is there an API that returns historical(2 years) stock price(e.g Barclays) vs index(e.g FTSE) relative price performance data?

I want to create a comparative chart hence need data via API.

datastream-apidsws-apidatastream
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.

1 Answer

Upvotes
Accepted
38.1k 69 35 53

@vishal.kak

You can use the Datastream DSWS to retrieve historical data. The code looks like this:

ds.get_data(tickers='BARC,FTALLSH', start='-2Y', kind=1)

It returns daily historical prices for 2 years of Barclays and FTSE ALL SHARE.

You can access the Datastream navigator to search for instruments and data types used in the DatastreamDSWS.


1622197963810.png (18.4 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.

Click below to post an Idea Post Idea