DEX 2 Requst on TR.CAAdjustmentFactor Is NULL when Sdate ist set as a parameter

Hi,
I'm trying to get Corporate Action Data for a company. Everything works as expected until I pass edate/sdate parameters:
.InstrumentIDList = "NORR.OL"
.FieldList = "TR.CAAdjustmentFactor(CAEventType=SCN:SSP:SRE:CRD)"
.RequestParam = "SDate=04/27/2020"
No Error is returned, instead the returned array is an scaler of value NULL
When I leave the Request Parameters empty, I get a scaler value of 100, which is expected.
The corresponding EIKON Excel Formula works when parameters are set.
Function TR(RICs As Variant, Fields As Variant, Params As Variant)
Dim strInstrList As String
Dim ErrorArray(0, 0) As Variant
Dim DataStatus As Dex2Lib.DEX2_DataStatus
Application.EnableEvents = True
'Refer to Error Handler
On Error GoTo errHandler
ErrorArray(0, 0) = " - "
'Tidy Up
If Not MyDex2Cookie = 0 Then
MyDex2Mgr.Finalize (MyDex2Cookie)
MyDex2Cookie = 0
Set MyDex2Mgr = Nothing
Set MyDex2RData = Nothing
End If
' Create the Dex2 and IDex2 objects.
Set MyDex2Mgr = CreateDex2Mgr()
Set MyDex2MgrADC = MyDex2Mgr
' Initialise using the DE_MC_ADC_POWERLINK enumeration
MyDex2Cookie = MyDex2MgrADC.Initialize(DE_MC_ADC_POWERLINK)
' And create an RData object.
Set MyDex2TR = MyDex2Mgr.CreateRData(MyDex2Cookie)
' Make a TR Request
Async_UPDT_RCVD = False 'Set recent update to false
With MyDex2TR
.InstrumentIDList = RICs
.FieldList = Fields
.RequestParam = Params
.Subscribe False
End With ' For the With myDex2RData
Dim StopTime As Date
StopTime = Now() + (1 / 24 / 60 / 60 * 30)
Do Until Async_UPDT_RCVD = True Or Now() >= StopTime
DoEvents
Loop
TR = MyDex2TR.Data
Exit Function
Best Answer
-
I don't see inconsistent behavior between =TR function in Excel and RData class of DEX2 COM library. =TR("NORR.OL","TR.CAAdjustmentFactor(CAEventType=SCN:SSP:SRE:CRD)","SDate=20200427") returns NULL just like RData object in your VBA example does. If you have an example where =TR function and RData object return different results given equivalent parameters, please provide both examples: the worksheet function and the VBA code snippet.
When only the SDate parameter is specified, it is interpreted as the request for a single event with announcement date prior to the value of SDate. In the case where there were several events with the same announcement date, all these events will be returned. E.g. =TR("NORR.OL","TR.CAAdjustmentFactor;TR.CAAnnouncementDate;TR.CAEffectiveDate;TR.CAExDate","SDate=20201231 CH=Fd RH:capitalchangeeventid") returns 3 capital change events (with capital change event IDs 73073019917, 73073011444, 73073011468 and announcement date of 2020-12-03).
In your example NORR.OL did not have any capital change events that satisfy capital change event type filters in your request and that were announced prior to 2020-04-27, hence the return value is NULL.
What I suppose you were looking for is the capital change events announced between 2020-04-27 and today. If this is indeed the case, you need to use EDate parameter instead of SDate. =TR("NORR.OL","TR.CAAdjustmentFactor(CAEventType=SCN:SSP:SRE:CRD)","EDate=20200427") returns 100. It is interpreted as a request for all capital change events that satisfy event type filters that were announced between the values of EDate and SDate, i.e. between 2020-04-27 and today's date (the default value of SDate is "0D" or today). There was only one such event (event ID 73073011444 announced on 2020-12-03), and the value of TR.CAAdjustmentFactor for this event is 100.0
Answers
-
What I suppose you were looking for is the capital change events announced between 2020-04-27 and today. If this is indeed the case, you need to use EDate parameter instead of SDate.
You are right of course. What got me confused is that start and end date are backward looking, ie. SDate=recent, EDate=old. It does make sense, now that you told me SDate=0D by default.
There is some inconsistency vs the TR function however. I guess that is because the frontend adjusts for my mixup, hence I didn't notice that mistake earlier....:
=TR(E15,"TR.CAAdjustmentFactor(CAEventType=SCN:SCO:SSP:SDI:SIS:DIV)","SDate=04/27/2020 EDate=12/22/2020")
This Excel Formula will return 100, although the dates are turned around.....
0 -
When you explicitly specify both SDate and EDate, the request returns the events announced between the values of SDate and EDate. The order of SDate and EDate (i.e. whether SDate is nearest and EDate is farthest or vice versa) determines the order of the results; i.e. it determines whether the events are returned in chronological (the most recent event last) or reverse chronological (the most recent event first) order. In all cases the behavior is consistent between =TR worksheet function and RData COM object.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 688 Datastream
- 1.4K DSS
- 625 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 695 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 105 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 92 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛