fields and tickers with Datastream/Python

Cant get the tickers/fields to work when downloading with Python.. See below. Using DatastreamDSWS v1.0.10. Let me know! is there a simple guide to which tickers/RIC/fields anywhere? basically trying to download historical closing prices for variuos assets.. //Eirik

df = ds.get_data( tickers = ",".join([ 'EURSEK=', 'XLE', 'CLc1', 'ESc1', 'RXc1:RTS', 'TSLA.O' ]), fields = ['TR.CLOSEPRICE'] ) display(df) Instrument Datatype Value \ 0 EURSEK= TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED 1 XLE TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED 2 CLc1 TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED 3 ESc1 TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED 4 RXc1:RTS TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED 5 TSLA.O TR.CLOSEPRICE $$ER: E100,INVALID CODE OR EXPRESSION ENTERED

Currency 0 NA 1 NA 2 NA 3 NA 4 NA 5 NA

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @eirik10

    I am not the DataStream and content expert, but the DataStream symbol and field names are not the same as on the Eikon/Workspace.

    The Close Price field should be "P".

    price.png

    You need to encapsulate the RIC code with "<>" to request data from Datastream (like "<TSLA.O>").

    I highly recommend you find the Datastream symbol/Mnemonic and fields from the Datastream website (you can log in with your Datastream credentials). I found some of your requested symbols in the Datastream website.

    • XLE -> U:XLE
    • CLc1 -> NCLC.01 (or <CLc1>)
    • ESc1 -> ISMC.01 (or <ESc1>)
    • TSLA.O -> <TSLA.O>
    df = ds.get_data( tickers = ",".join([ 'U:XLE', 'NCLC.01','ISMC.01',  '<TSLA.O>' ]), fields = ['P'] ) 

    result.png


Answers