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);
}