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 1 0 0

RIC/Flied combination in VBA requests

Good morning,

I have a question about the Eikon API and the way historical data requests are constructed using VBA.

It has to do with RIC/field combination. I have a sample sheet that requests historical data via VBA for all the RICS provided as long as I want the same field for all of them. I would like to use different fields for different RICS (eg EUROSTR=, Value and EURIBOR3MD=, Close) in the same request.

The code i was given creates a String of RICs contained in a range using the following loop:

For i = 1 To rngRICS.Count

RICList = RICList & rngRICS.Value2(1, i) & ";"

Next i

while the field is created as follows:

Fields = ".Timestamp;." & Range("Field").Value

I tried to create a Fields string the same way as the RICs field is created but it requests all the fields for all the RICS. In other words, it doesnt put Field1 in front of RC1, Field2 in front of RIC2 etc.

Could you help me strucure this the right way? Appologies if this is a basic question, I am new to Eikon.

Thanks

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

@Antoine.Bouvet

Thank you for your participation in the forum.


Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question.

This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.


Thanks,

-AHS

@Antoine.Bouvet

Hi,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvote
Accepted
39.4k 77 11 27

@Antoine.Bouvet

From the code snippets you provided I figure you must be using RHistory COM Library.

As @umer.nalla said, there's no way to create a request where certain fields would be requested only for certain RICs and other fields for other RICs. You could, however, create a separate request for each RIC, and then within each request you can specify only the fields you need for that request (or RIC). You could do this one RIC at a time in an artificial loop using a single instance of RHistoryQuery object, where the next request is sent from the callback for OnUpdate event (which is raised when the data for the previous request has been retrieved). Or you could create a separate instance of RHistoryQuery object for each RIC, keep all these objects in a collection and destroy the collection once the data for all RICs has been retrieved. To achieve this you'd need to create a couple of custom wrapper classes. Attached example demonstrates one way of approaching this.

RHistoryMultipleQueries.zip


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
25.3k 87 12 25

Hi @Antoine.Bouvet

Whilst I am not a VBA expert, I can say that based on my knowledge of Eikon API, I understand it is not possible to request multiple RICs with different fields for each RIC in a single request.

If you refer to the Eikon DATA API reference
Eikon Data API for Python: eikon (refinitiv.com)

you will note that the historical data function takes a list of RICs, followed by an optional list of Fields - and it will attempt to obtain all the specified fields for all the RICs.

If you want to request different Fields for individual RICs, you will need to make individual requests for each RIC along with its list of required fields.


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.