question

Upvotes
Accepted
3 0 0 4

How do I convert a DSGRID/DataStream query into one for the Python API?

 
               

I am trying to pull in Options pricing data. I already have the relevant input codes - here is the query I used to use in DataStream with DSGRID

=@DSGRID($D$2:$H$2,"O3",$C$1,"","D","SDateCellRef=true;ColHeader=true;DispSeriesDescription=false;YearlyTSFormat=false;QuarterlyTSFormat=false;AutoRefresh=false","")

where $D$2:$H$2 is

MSQ$DELTA25C MSQ$DELTA25P MSQ$DELTA10C MSQ$DELTA10P MSQ$DELTAATM

and $C$1 is a date, say, 1/1/2015.


I am now trying to pull this using the Python API // in codebook. Can somebody help?

Thanks

eikon-data-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.

Upvote
Accepted
45.3k 103 44 60

@Nikunj.Jain

The code looks like the following.

ds.get_data(tickers='MSQ$DELTA25C,MSQ$DELTA25P,MSQ$DELTA10C,MSQ$DELTA10P,MSQ$DELTAATM', 
            fields=['O3'], 
            start='2015-01-01', 
            freq='D')

The output is:

1636692270112.png


1636692270112.png (11.5 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.

Upvotes
1.9k 12 2 2

Hi @Nikunj.Jain ,

There are example Notebooks showing how one may use Datastream in Codebook:

1636655403436.png

Then under 01. Data Retrieval & Discovery

and then 01.03.Datastream Library


Please do let me know if those examples are enough


1636655403436.png (26.9 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.