question

Upvotes
Accepted
401 15 18 33

How do I use User Tags with Adfin X Real Time in Eikon for Excel VBA?

eikoneikon-com-apiexcelvbaadfin
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

Upvotes
Accepted
791 9 7 14

User tags are used with the AdxRtList Class of the AdxRtLib library. A user tag is applied when the object and its parameters are set up, and is specific to an isntrument and field. This is very useful, for example, when data is returned for positioning an instrument/field value into a specific place, either in an array or on to a spreadsheet table.

With the PlVbaAPIs module added to the project, commenting out all sections except the AdfinX Real Time section (to avoid compilation errors), Tools, Reference for the AdfinX Real Time Library (rtx.dll)

Dim WithEvents myRTList As AdfinXRtLib.AdxRtList
In the main code;
Set myRTList = CreateAdxRtList()
    With myRTList
        .Source = "IDN"
        .RegisterItems  Array("EUR=", "GBP="),  Array("BID", "ASK")

        .UserTag("EUR=", "*") = 1 '  "*" indicates this is the user tag for the RIC itself.
        .UserTag("GBP=", "*") = 2
        .UserTag("EUR=", "BID") = 3 '  ' specific for the BID field for EUR=
        .UserTag("EUR=", "ASK") = 4
        .UserTag("GBP=", "BID") = 5 '  ' specific for the BID field for EUR=
        .UserTag("GBP=", "ASK") = 6

        .StartUpdates RT_MODE_ONUPDATE
End With

And for the ONUPDATE event callback;
         m = myRTList.UserTag(ItemName, "*")
         n = myRtList.UserTag(ItemName, "BID") 'etc.
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.

Click below to post an Idea Post Idea