AdxRtList.RegisterItems - how can I use ISIN instead of RIC?
Best Answer
-
Hi @vik-t
There's a couple of errors in your code.
1. m_dex2mgrADC variable must be declared as Dex2Lib.IDex2Mgr2, not as Dex2Lib.IDex2Mgr
2. To create RData object you need to use Dex2Lib.Dex2Mgr class. So it should be
Set m_rdata = m_dex2mgr.CreateRData(m_cookie)
and not Set m_rdata = m_dex2mgrADC.CreateRData(m_cookie) as in your code.
Once I corrected these two errors I was able to retrieve the data using your code. Oh, and just as a sanity check, your run the example by calling ConnectToEikon procedure, right? Cause if you call Command0_Click then CloseDex procedure will run and destroy RData object before it has a chance to retrieve the data.
1
Answers
-
I would recommend using the reference data API for this, it is called DEX2.
If you have a list of ISINs, you can send it in a RData query (a part of the DEX2) requesting the RIC (either field RI.ID.RIC or TR.RIC depending on the interface).
You can find the usage sample here.
1 -
I followed your advice but I'm running into some issues. Could you please elaborate on the interfaces? I'm trying to understand why using RI.ID.RIC works fine but TR.RIC or any other TR.xyz taken from the Data Item Browser hopelessly crashes MS Access with the error message "Run-time error '-2147220965 (8004021b)': Method 'Data' of object 'IRData' failed." As I mentioned, I'm using VBA in MS Access 2016 and I'm connecting to Eikon which is up and running.
0 -
Ok, so I followed the information in section 8 of Tutorial 6. Can you help me figure out what's wrong with this code? (See next comment because of comment size limitations..)
0 -
Public WithEvents rtConn As EikonDesktopDataAPI
Private m_dex2mgr As Dex2Lib.Dex2Mgr
Private m_dex2mgrADC As Dex2Lib.IDex2Mgr
Private m_cookie As Long
Private WithEvents m_rdata As Dex2Lib.RData
Set rtConn = New EikonDesktopDataAPI
Set m_dex2mgr = rtConn.CreateDex2Mgr
Set m_dex2mgrADC = m_dex2mgr
m_cookie = m_dex2mgrADC.Initialize(DE_MC_ADC_POWERLINK)
Set m_rdata = m_dex2mgrADC.CreateRData(m_cookie)
m_rdata.InstrumentIDList = "TRI.N"
m_rdata.FieldList = "TR.RIC"
m_rdata.SubscribeResult of the code above is an "Application-defined or object-defined error" in the 'Data' field of m_rdata.
0 -
Hi @vik-t
I don't see any event handling in the code snippet you posted. Are you trying to get the Data property of RData object immediately after calling m_rdata.Subscribe? OnUpdate event of RData class notifies you that the data you requested has been retrieved and is available. You should access the data from the callback for OnUpdate event, as it's done in the tutorial you referenced. If you already access the data from within OnUpdate event handler, then what are the values of DataStatus and Error parameters returned to the event handler procedure?
1 -
@Alex Yes, I just summarized the code to fit in the comment. In reality, it is built according to the tutorial, i.e. with an OnUpdate Event. However, since I changed the code from the regular Dex2Mgr to the ADC version, the OnUpdate event is no longer called.. Find the full source code that I use here: Pastebin Link
0 -
Alex, this solved it, thanks a lot. The class names are quite confusing with the many 2's. Can I ask a couple of follow-up questions?
- The goal of my script is to populate a table with certain reference data, once. So running the procedure should start and end without further intervention. How do I correctly call the code in "CloseDex" so that the event can still be processed first?
- What is the general difference between TR and RI codes, and why or when would I prefer one over the other? What did Zhenya mean by "interfaces"? Maybe you can refer me to some documentation on the topic.
0 -
1. I don't see the need to call CloseDex procedure at all. It does some cleanup, which is a good practice in general, but in your case it won't make any difference. It will free up an unnoticeable teeny bit of memory, that's all. If your code was creating lots and lots of objects repetitively, then cleanup would be important. In your use case however it's quite unnecessary. This said if for whatever reason you do need to call this procedure, you can call it from the bottom of OnUpdate event handler.
0 -
2. RI field names are a legacy scheme that we're phasing out. Unless you run a very old version of Eikon where you cannot use TR field names, you never want to use RI fields in any new applications. The old field name scheme is only preserved for backwards compatibility, and will eventually be retired.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛