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
37 2 3 3

Total Market Volume with EIkon API

Hi All,


using the eikon chart or excel add in, I can call the total market volume traded for a commoditiy however I can not call it into EIkon API.


I have tried .getdata, .gettimerseries and gethistory but i can not call the field.


This is the syntax in excel - =@RHistory("SBc1","TOT_VOLUME.Timestamp;TOT_VOLUME.Value","INTERVAL:1D",,"TSREPEAT:NO CH:Fd",B2)



eikonpythonapi
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
10.2k 18 6 9

@Moody Sorry to hear your issue! So this is very easily achieved with our new Refinitiv Data (RD) Library which offers access to Refinitiv Data Platform services - including for this case our Historical Pricing Service. First you need to install the library:

pip install refinitiv-data

then in a notebook or IDE:

import refinitiv.data as rd
rd.open_session()
rd.get_history("SBc1")

The accumulated volume field is called 'ACVOL_UNS'. This is the simplest default call - but there are more parameters such as start date, end date, count, fields etc. You can play around with this call using CODEBOOK app with example notebook EX_01_01_02__Access_Get_History.ipynb - I hope this can help. Let us know how you get on.

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
37 2 3 3

Hi Jason,

Thank you for your rapid answer.

Yes, I got that far in the example library before however, the ACVOL_UNS is the field for the current RICs volume, SBc1, which gives total volume.

The field, TOT_VOLUME.Value however which is possible with excel, allows us to get the total volume across all the SB contracts on a given day. The issue is that there is no RIC to give us the total volume, ie LCOTOT equivalent for SB.

So this field is quite different than the one output in python. Is it possible to recieve the full traded volume across all contracts in SB as an example?

Volume on contract - 63k

Total volume across all contracts - 143k.

Is it possible to convert this formula to python?

=@RHistory("SBc1","TOT_VOLUME.Timestamp;TOT_VOLUME.Value","INTERVAL:1D",,"TSREPEAT:NO CH:Fd",B2)






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.

@Moody So if you want the total volume of all contracts in the 0#SB chain then you would need to request the chain elements using a get_data and then for each contract request ACVOL_UNS and finally aggregate using df.column.sum() or similar. The data models are different for some RICs between current and RDP based services. If you need more detailed explanations on the content side please open a content query and they might be able to assist you further. I hope this can help.
Upvotes
37 2 3 3

Thank you Jason for that

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.

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.