var extractionsContext = new ExtractionsContext(uri, sessionToken.SessionToken); //Reduce the poll time for the purposes of the example extractionsContext.Preferences.WaitSeconds = 5; //Create the request var extractionRequest = new TickHistoryTimeAndSalesExtractionRequest() { IdentifierList = new InstrumentIdentifierList() { InstrumentIdentifiers = new[] { new InstrumentIdentifier { Identifier = "UNG", IdentifierType = IdentifierType.Ric } } }, Condition = new ThomsonReuters.Dss.Api.Extractions.ReportTemplates.TickHistoryTimeAndSalesCondition() { DaysAgo = null, MessageTimeStampIn = ThomsonReuters.Dss.Api.Extractions.ReportTemplates.TickHistoryTimeOptions.LocalExchangeTime, //DateRangeTimeZone = "UTC", QueryEndDate = DateTime.UtcNow, QueryStartDate = DateTime.UtcNow - TimeSpan.FromDays(27), ReportDateRangeType = ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ReportDateRangeType.Range, ExtractBy = ThomsonReuters.Dss.Api.Extractions.ReportTemplates.TickHistoryExtractByMode.Ric, SortBy = ThomsonReuters.Dss.Api.Extractions.ReportTemplates.TickHistorySort.SingleByRic, ApplyCorrectionsAndCancellations = false, DisplaySourceRIC = false }, ContentFieldNames = new[] { "Trade - Price", "Trade - Volume", } }; //Extract - NOTE: If the extraction request takes more than 30 seconds the async mechansim will be used. See Key Mechanisms extractionsContext.Options.AutomaticDecompression = true; //Decompress gzip to plain text DateTime dt = DateTime.UtcNow; var extractionResult = extractionsContext.ExtractRawStart(extractionRequest); while (extractionResult.Status == ThomsonReuters.Dss.Api.Jobs.JobStatus.InProgress) { extractionResult = extractionsContext.MonitorJob(extractionResult); if (extractionResult.Status != ThomsonReuters.Dss.Api.Jobs.JobStatus.InProgress) break; System.Threading.Thread.Sleep(100); } var t = DateTime.UtcNow - dt; if (extractionResult.Status == ThomsonReuters.Dss.Api.Jobs.JobStatus.Completed) { var streamResponse = extractionsContext.GetReadStream(extractionResult.Result); using (var reader = new System.IO.StreamReader(streamResponse.Stream)) { //Output var result = reader.ReadLine(); if (string.IsNullOrEmpty(result)) System.Diagnostics.Debug.WriteLine("No raw results returned"); else { System.Diagnostics.Debug.WriteLine(result); int lineCount = 0; for (; !reader.EndOfStream; lineCount++) //Limit output results to 100 reads. { result = reader.ReadLine(); if (lineCount == 0) System.Diagnostics.Debug.WriteLine(result); } System.Diagnostics.Debug.WriteLine(result); } } //Output Notes System.Diagnostics.Debug.WriteLine("NOTES:"); foreach (var note in extractionResult.Result.Notes) System.Diagnostics.Debug.WriteLine(note); }