Universal Close Price not coming for non traded equities from API

I am having some difficulty in getting ‘Universal Close Price’ for equities. We have a schedule for Premium EOD for international equities. The file generated every day has ‘Universal Close Price’. If the equity is not traded on a particular day, then the previous ‘Universal Close Price’ is used in the file created.
Also I am trying to execute the
same report using API. The result I get from API is very similar to the one
generated above. However the only difference is that if the equity is not
traded then the ‘Universal Close Price’ is null. (ex: RIC = 002236.SZ).
Is there any reason or am I doing something wrong?
My code is as follows:
public void GetPricing()
{
extractionResult = new ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult();
var extractionsContext = ContextHelper.CreateExtractionsContext();
//Create the instrument list
var instrumentList = new InstrumentList { Name = "ImmediateNonCustomized" + Suffix.New() };
extractionsContext.InstrumentListOperations.Create(instrumentList);
extractionsContext.InstrumentListOperations.AppendIdentifiers(instrumentList, InstrumentIdentifiers, false);
//Create the report template
var retrievedTemplate = extractionsContext.ReportTemplateOperations.GetByName(ReportTemplateName);
//Schedule the extraction to run immediately
var schedule = new Schedule
{
Name = "ImmediateNonCustomized" + Suffix.New(),
TimeZone = TimeZoneInfo.Local.Id,
Recurrence = ScheduleRecurrence.CreateSingleRecurrence(DateTimeOffset.UtcNow, true),
Trigger = ScheduleTrigger.CreateImmediateTrigger(true),
ListId = instrumentList.ListId,
ReportTemplateId = retrievedTemplate.ReportTemplateId
};
extractionsContext.ScheduleOperations.Create(schedule);
try
{
//Wait for the extraction to complete. This involves polling GetLastExtractionForScheduleId until
//the returned ReportExtraction.Status is completed.
var extraction = extractionsContext.ScheduleOperations.WaitForNextExtraction(schedule);
//Get the list of files for this extraction. This includes the contents, notes files and RIC maintenance files.
extractionsContext.LoadProperty(extraction, "Files");
//Find the extract file. Other ExtractedFileTypes are: Note, RicMaintenanceNote, Full, Partial, Other
var extractFile = extraction.Files.FirstOrDefault(f => f.FileType == ExtractedFileType.Full);
if (extractFile != null)
{
//Output the contents of the extracted file
reutersResponse = extractionsContext.ExtractedFileOperations.GetReadStream(extractFile);
reutersResponseNotes = extractionsContext.ExtractedFileOperations.GetReadStream(extraction.Files[2]);
reutersResponseNotesTxt = extractionsContext.ExtractedFileOperations.GetReadStream(extraction.Files[0]);
extractionsContext.ScheduleOperations.Delete(schedule);
}
}
catch (TimeoutException ex)
{
throw (ex);
}
//Delete the extracted files, schedule, instrument list and report template. See the "Cleanup" example for
//the various steps involved with cleanup. NOTE: It is a good idea to clean up the extracted files (Report Extractions)
//once you have downloaded the results. If the schedule is not immediate (i.e. recurring), you want to keep the
//instrument list, report template and schedule around.
QuickStart.QuickStartExamples qse = new QuickStart.QuickStartExamples();
//qse.Cleanup(schedule, instrumentList, reportTemplate);
//QuickStart.QuickStartExamples.Cleanup(schedule, instrumentList, reportTemplate);
}
Best Answer
-
Hi Vivek,
If you want the code in the initial question to create a schedule with "Last Updated" type, you can change the parameter of ScheduleTrigger.CreateImmediateTrigger() method to false. Below is the sample code.
//Schedule the extraction to run immediately
var schedule = new Schedule
{
Name = "ImmediateNonCustomized" + Suffix.New(),
TimeZone = TimeZoneInfo.Local.Id,
Recurrence = ScheduleRecurrence.CreateSingleRecurrence(DateTimeOffset.UtcNow, true),
Trigger = ScheduleTrigger.CreateImmediateTrigger(false),
ListId = instrumentList.ListId,
ReportTemplateId = retrievedTemplate.ReportTemplateId
};
extractionsContext.ScheduleOperations.Create(schedule);According to DSS GUI User Guide, the Type can affect the value of Universal Close Price when today's validated end of day prices are not available. Below is the screenshot from the guide.
0
Answers
-
Hi @vivek.arkalgud,
The behavior of "Universal Closed Price" is related to the "Return Null Codes Values in Extraction Pricing Fields" and "Exclude Null Codes For Universal Close Price" options in the user preference. For example, if the "Return Null Codes Values in Extraction Pricing Fields" option is cleared, a blank field will appear when price is not available.
Anyway, these options affect every Schedule Extractions done by user who sets these options, so the GUI and your API code should return the same result. Were API and GUI extractions done with the same DSS User?
0 -
Thanks Veerapath.
Yes. I am using the same DSS user for both GUI and API. Interestingly if I use the following code instead of the code used above, I get 'Universal Close Price' :
var extractionsContext = ContextHelper.CreateExtractionsContext();
extractionsContext.Preferences.WaitSeconds = 5;
var extractionRequest = new EndOfDayPricingExtractionRequest
{
IdentifierList = SubjectIdentifierList.CreateInstrumentIdentifierList(instrumentIdentifiers, null, false),
ContentFieldNames = new[] { "RIC", "User Defined Identifier", "User Defined Identifier2", "User Defined Identifier3", "Exchange Code", "Exchange Description", "Asset SubType Description", "Asset Type Description", "Ask Price", "Bid Price", "Close Price", "Instrument ID Type", "Instrument ID", "Security Description", "Ticker", "Currency Code", "Currency Code Description", "Currency Code Scaled", "Currency Code Scaled Description", "Asset Status", "Trading Status", "Universal Close Price", "Universal Close Price Date", "Domicile", "Domicile Description" }
};
//Extract
extractionResult = extractionsContext.ExtractWithNotes(extractionRequest);
0 -
According to your code in the initial question, the schedule is created with "limitReportToTodaysData" option = True. The option should be equivalent to the "Today Only" option on Web GUI.
Trigger = ScheduleTrigger.CreateImmediateTrigger(true),
Could you verify whether the schedule created on Web GUI has the same "Today Only" option?
Below is the sample on Web GUI.
0 -
Hi Veerapath,
Thanks. I will check.
0 -
Hi Veerapath,
I checked web GUI. The Type is set to "Last Updated". Is there a way to set this "Type" in the code while executing this schedule?
Thanks
Vivek
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
- 687 Datastream
- 1.4K DSS
- 622 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- 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
- 680 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
- 104 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 91 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛