Sample C# code that excludes deleted items when pulling data from DSS Corporate Actions table

We have 3 queries:
1) We are using
CorporateActionsStandardExtractionRequest whereas I see that you are using
CorporateActionsStandardReportTemplate – do you anticipate differences in
behavior when using one class versus the other?
2) If you look at our setting of the condition,
you will see that we set our IncludeInstrumentsWithNoEvents to false whereas
you set it to null, and we set our ReportDateRangeType to a string (“Last”)
whereas you set it to whatever the value behind ReportDateRangeType.Delta is.
Could this be causing issues? Do we need to set any other flags?
newCorporateActionsStandardCondition{ExcludeDeletedEvents =
true,ReportDateRangeType =
ReportDateRangeType,IncludeInstrumentsWithNoEvents
= false,};
3) Can you confirm that the code below works
(i.e. that if you try to run it against a sedol with the excludedeleted flag
set to true, then no retired shares will be returned)
Your original solution/response was:
Here is the code for
excluding deleted events in corp actions:
publicvoid CreateCorporateActionsStandardReportTemplate()
{
Status.Notify(ExtractionsContext, "ReportTemplateType", "GetContentFieldTypes", MethodType.Operation, Publish.Secondary);
//Retrieve the list of available fields. You can skip this step if you already know the list of fields to extract.
//The list of fields contains the code, name, format. Either the code or name can be used as the fieldName when
//adding content fields
var availableFields = ExtractionsContext.GetValidContentFieldTypes(ReportTemplateTypes.CorporateActions);
Status.EndNotify(ExtractionsContext);
Status.Notify(ExtractionsContext, "CorporateActionsStandardReportTemplate", "Create",
MethodType.Operation, Publish.Primary);
//Create the new report template
var reportTemplate = new CorporateActionsStandardReportTemplate
{
Name = Guid.NewGuid().ToString(),
OutputFormat = ReportOutputFormat.CommaSeparatedValues,
Condition = newCorporateActionsStandardCondition
{
PreviousDays = 30,
ReportDateRangeType = ReportDateRangeType.Delta,
CorporateActionsCapitalChangeType = CorporateActionsCapitalChangeType.CapitalChangeExDate,
CorporateActionsDividendsType = CorporateActionsDividendsType.DividendPayDate,
CorporateActionsEarningsType = CorporateActionsEarningsType.PeriodEndDate,
CorporateActionsEquityOfferingsType = CorporateActionsEquityOfferingsType.AllPendingDeals,
CorporateActionsMergersAcquisitionsType = CorporateActionsMergersAcquisitionsType.DealAnnouncementDate,
CorporateActionsNominalValueType = CorporateActionsNominalValueType.NominalValueDate,
CorporateActionsSharesType = CorporateActionsSharesType.SharesAmountDate,
CorporateActionsStandardEventsType = CorporateActionsStandardEventsType.None,
CorporateActionsVotingRightsType = CorporateActionsVotingRightsType.VotingRightsDate,
QueryStartDate = null,
NextDays = null,
QueryEndDate = null,
PendingEventsHours = null,
PendingEventsMinutes = null,
IncludeInstrumentsWithNoEvents = null,
IncludeNullDates = null,
//
// EXCLUDE DELETED EVENTS
//
ExcludeDeletedEvents = true,
IncludeCapitalChangeEvents = true,
IncludeDividendEvents = true,
IncludeEarningsEvents = true,
IncludeMergersAndAcquisitionsEvents = true,
IncludeNominalValueEvents = true,
IncludePublicEquityOfferingsEvents = true,
IncludeSharesOutstandingEvents = true,
IncludeVotingRightsEvents = true
},
};
Best Answer
-
1) We are using CorporateActionsStandardExtractionRequest whereas I see that you are using CorporateActionsStandardReportTemplate – do you anticipate differences in behavior when using one class versus the other?
These are 2 different approaches to a similar goal. The choice depends on your use case.
CorporateActionsStandardExtractionRequest is used in the context of an On Demand (i.e. on the fly) extraction. The instrument list and report template are created dynamically, and are not saved on the DSS server. This is very easy to program and use. We have sample code for this, which you can find in the REST API Reference tree, under Extractions Context - Operations - Extract (select the scenario On Demand Extractions - Create - Standard Events (Corporate Actions)). Select tab C# full to see the entire code. You can also see and run the code in the C# example application, under On Demand Extractions - Create Standard Events (Corporate Actions). For detailed instructions on how to install and run it, see here.
CorporateActionsStandardReportTemplate is used to create a report template that is saved on the DSS server (you can check that using the DSS web GUI). That is useful if you want to create it once and for all, and reuse it later. We have sample code for this method, which you can find in the REST API Reference tree, under Extractions Context - Entities - Report Template (with Derived Entities) - Derived Entities - CorporateActionsStandardReportTemplate - Operations - Create (select the scenario Report Template Examples - Create - Standard Events (Corporate Actions).primary). Select tab C# full to see the entire code. You can also see and run the code in the C# example application, under Report Template Examples - Create Standard Events (Corporate Actions).
But this second method is not sufficient for an extraction. In this scenario you also need to create an instrument list on the DSS server, and a schedule for your extraction, after which you can retrieve the extracted data. This approach is similar to what you can do manually in the DSS GUI. For an explanation of the 2 approaches see here. For a complete code sample with all required steps using this 2nd approach (for EoD data, not Corax, but the idea is the same) see here.
2) If you look at our setting of the condition, you will see that we set our IncludeInstrumentsWithNoEvents to false whereas you set it to null, and we set our ReportDateRangeType to a string (“Last”) whereas you set it to whatever the value behind ReportDateRangeType.Delta is. Could this be causing issues? Do we need to set any other flags?
A) false vs null
Property IncludeInstrumentsWithNoEvents is a nullable boolean (type bool?). If you do not want to include instruments with no event data, then setting it to false is fine.
Last vs Delta
ReportDateRangeType is an enumerable that can have any of the following values: Delta, Init, Last, NoRange, Range. The difference between Delta and Last is the following:
- Delta: Limit your extraction to only new and updated events that have occurred within a specified number of hours or days.
- Last: Retrieve the most recent events available, regardless of when the data was last updated.
Depending on the chosen value, other properties must be set. For more info search for Delta in the DSS GUI help, then select Report Options for Corporate Actions.
C) Properties (flags) list
There are many more properties that can be set. The sample code mentioned in the answer to query 1 above illustrates them. If you need to set them or not depends on your use case. Defaults will be used for unset values.
3) Can you confirm that the code below works (i.e. that if you try to run it against a sedol with the excludedeleted flag set to true, then no retired shares will be returned)
The purpose of ExcludeDeletedEvents is to exclude deleted Corporate Actions.
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
- 690 Datastream
- 1.4K DSS
- 629 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
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 280 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛