Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 2 1 2

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apitrade
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.

1 Answer

· Write an Answer
Upvote
Accepted
39.4k 77 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 512.0 KiB each and 1.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!

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.