question

johnchristopher.clemens avatar image

The RI price for ISMVUS.L is getting an invalid item in Matlab or Python

Hi Team,

I'm posting this query on client's behalf and below is his verbatim.

"I have a question regarding datastream API's I can pull RI price for ISMVUS.L using the excel addon but when using matlab or python its an invalid item? Does it not all pull from the same database though? It's not a code issue. Everything else works fine.

ds.get_data(tickers='ISMVUS.L', fields='RI', kind=0)

But thats a simple arguemnt there that is failing with this ticker with and without the .L"


I instructed the client to use the mnemonic MVUS instead on the argument, as ISMVUS.L is an Eikon ticker, and it worked after restaring the kernal. Also, the argument and "RI" are for Datastream. His question now that needs to be addressed is why does the original ticker work on excel and not on python on the datastream API? Surely consistency is preferred?

pythondatastream-apidsws-apimatlab
10 |1500

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

Jirapongse avatar image
45.2k 103 43 60

@johnchristopher.clemens

In DatastreamWS, RIC must be enclosed with an angle bracket (<>). The fields must be a list.

The code looks like the following.

ds.get_data(tickers='<ISMVUS.L>', fields=['RI'], kind=0) 

The output is:

1625019951101.png


1625019951101.png (10.4 KiB)
1 comment
10 |1500

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

Hi @jirapongse.phuriphanvichai,

Many thanks for this answer. The client has a follow up question as shown below.

When calling data using the below code.Rather than cycling through individual tickers can I select a list or an array and call multiple securities at once or will they have to be fed in one by one by looping though a list or dataframe?

Jirapongse avatar image
45.2k 103 43 60

@johnchristopher.clemens

Yes, the client can specify a list of items, as shown below. Each item is separated by a comma.

ds.get_data(tickers='<ISMVUS.L>,<IBM.N>', fields=['RI'], kind=0)

The output is:
1625061567699.png

Please also refer to the DSWS user stats and limits for request limits.


1625061567699.png (14.4 KiB)
1 comment
10 |1500

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