question

Upvotes
Accepted
9 1 7 13

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

1 Answer

· Write an Answer
Upvotes
Accepted
78.1k 246 52 72

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