question

Upvotes
Accepted
1 3 3 3

How do extract symbols that fulfil regex criteria in datastream?

How do extract symbols that fulfil regex criteria in datastream?

For instance, when I type SPXw, I can see a list of options RIC/ Mnemonic in DFO Navigator.

I want this to an output from a python function.

datastream-apiricsdsws-apiderivativesmnemonics
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
Accepted
79.7k 257 52 74

@kenneth.fung

You can DS.SYMBOLLOOKUP with the DataStream.

ds.get_data(tickers="SPXw", fields=["DS.SYMBOLLOOKUP(Count=50)"],  kind=0)

The output is:


1605759459831.png (45.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.

To retrieve RICs instead of mnemonics, you need to send another request.

df1 = ds.get_data(tickers="SPXw", fields=["DS.SYMBOLLOOKUP(Count=50)"],  kind=0)
ds.get_data(','.join(df1['Instrument']),fields=["RIC"], kind=0)


Upvotes
1 3 3 3
DS.SYMBOLLOOKUP(Count=50) // I try to set it as 1000, in anticipation of a result of similar size (1000); but it returns only 25 rows
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 3 3 3

Plus, DS.SYMBOLLOOKUP(Count=50) seems to return valid RICS/Mnemonic but not the dead ones.

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.

@kenneth.fung

Navigator is the tool that DSWS clients are advised to use.

The symbol lookup was created for quick search, has limited search functionality, and doesn’t cover all content sets.

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.