For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 0 1

Dowloading Traded Volume using Python (Eikon API) - get_data

Hi,

I'm trying to download the traded volume (accumulated volume) for bonds between two specific dates. In Excel, the syntax is :

=TR(Bond Identifier,"TR.ACCUMULATEDVOLUME","Frq:W TRANSPOSE:YES CALCMETHOD:SUM SDate:05/23/19 EDate:05/30/19").

I'm trying this:

TV, err = ek.get_data(Bond Identifier,[{'TR.BidPrice':{'params':{'SDate':"05/23/2019", 'EDate':"05/30/2019"}}}], debug = False)

but only NaN values shows up. Can you help me translate that into Python syntax? Thank you!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontrade
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
39.2k 75 11 27

Try

ek.get_data('US345370BR09',['TR.BidPrice'],
            {'SDate':'05/23/2019', 'EDate':'05/30/2019'}
icon clock
10 |1500

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

Thanks Alex, but I was meant to download 'ACCUMULATEDVOLUME' not Bid Price. Bid Price works fine but ACCUMULATEDVOLUME does not seem to work...

Ah. OK. Here's the expression that exactly replicates =TR function you mentioned.

ek.get_data('345370BR0=FINR',['TR.ACCUMULATEDVOLUME'],
            {'SDate':'05/23/2019', 'EDate':'05/30/2019',
            'CALCMETHOD':'SUM', 'FRQ':'W'})

Amazing, thank you!

Click below to post an Idea Post Idea