For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
0 2 4 6

Request for On Demand IntraDay Bars not readable response

Hello support,

I would like to pull all the available data for a contract during the period of First trade data to Current data/Last Trade date through on demand request.

But unfortunately waiting with lots of time, some of the response lines are contains special characters and different length. so can't parse the data as per expectation for analysis.

Please help me and let me know if we are missing something.

dss-rest-apidatascope-selectdsstick-history-rest-apic#
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question. Thanks, AHS

Hello @ziaul

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
84 3 0 1

Hi @ziaul : EndOfDayPricingReportTemplate retrieves instrument last EOD or today's EOD data only (1-day data). From your initial question, I think you're looking for a complete history of data and I would recommend using "PriceHistoryReportTemplate"

Attaching sample code for "PriceHistoryReportTemplate". Please let me know if you have any further questions.

/Create the request
var extractionRequest = new ElektronTimeseriesExtractionRequest()
{
    IdentifierList = new InstrumentIdentifierList()
    {
        InstrumentIdentifiers = new[] { new InstrumentIdentifier { Identifier = "TRI.N", IdentifierType = IdentifierType.Ric } }
    },
    Condition = new ElektronTimeseriesCondition
    {
        ReportDateRangeType = ReportDateRangeType.Range,
        QueryStartDate = new DateTimeOffset(new DateTime(2015, 12, 1)),
        QueryEndDate = new DateTimeOffset(new DateTime(2015, 12, 2))
    },
    ContentFieldNames = new[]
        {
            "Ask", "Bid", "High", "Last", "Low", "Trade Date"
        }
};
 
//Extract - NOTE: If the extraction request takes more than 30 seconds the async mechansim will be used.  See Key Mechanisms 
var extractionResult = ExtractionsContext.ExtractWithNotes(extractionRequest);
var extractedRows = extractionResult.Contents;
 
//Output
if (!extractedRows.Any())
    Debug.WriteLine("No rows returned");
else
{
    foreach (var row in extractedRows)
        Debug.WriteLine(
            row.Identifier + " (" + row.IdentifierType + ") " +
            String.Join(", ", row.DynamicProperties.Select(dp => dp.Key + "=" + dp.Value)));
}
//Output Notes
Debug.WriteLine("NOTES:");
foreach (var note in extractionResult.Notes)
    Debug.WriteLine(note);
 
/* === OUTPUT === *\
TRI.N (Ric) Ask=41.07, Bid=41.05, High=41.15, Last=41.05, Low=40.45, Trade Date=12/1/2015 12:00:00 AM
TRI.N (Ric) Ask=41.08, Bid=41.07, High=41.23, Last=41.07, Low=40.91, Trade Date=12/2/2015 12:00:00 AM
NOTES:
Extraction Services Version 11.3.37834 (fdf4aaf12f3f), Built Nov 13 2017 19:11:21
Processing started at 11/14/2017 11:13:08 AM.
User ID: 20058
Extraction ID: 160000074339
Schedule: 0x05f2f98090884050 (ID = 0x0000000000000000)
Input List (1 items):  (ID = 0x05f2f98090884050) Created: 11/14/2017 11:13:08 AM Last Modified: 11/14/2017 11:13:08 AM
Report Template (12 fields): _OnD_0x05f2f98090884050 (ID = 0x05f2f980a6d84050) Created: 11/14/2017 11:13:06 AM Last Modified: 11/14/2017 11:13:06 AM
Schedule dispatched via message queue (0x05f2f98090884050)
Schedule Time: 11/14/2017 11:13:07 AM
Timeseries Date Range: 12/01/2015 to 12/02/2015
Processing completed successfully at 11/14/2017 11:13:08 AM, taking 0.154 Secs.
Extraction finished at 11/14/2017 05:13:08 PM UTC, with servers: x04q12, ETS (0.1 secs), QSDEV1 (0.0 secs), QSRB01 (0.0 secs)
Quota Message: INFO: Tick History Compliance Quota Count Before Extraction: 2; Instruments Approved for Extraction: 1; Tick History Compliance Quota Count After Extraction: 2, 0.2% of Limit; Tick History Compliance Quota Limit: 1000

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
84 3 0 1

Hi @ziaul : May i know which template do you use to extract above information ?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
0 2 4 6

@Ramprasad.Kumaralu.J I am looking for "EndOfDayPricingReportTemplate" report template using C# .NET

I am looking for Daily candle. Please help me

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
0 2 4 6

Hi @Ramprasad.Kumaralu.J, Thank you for your quick response.

Please help me to get 5 Mins candle data with Maximum duration for a contract. Can I use the same above request & response?

Sample code would be really appreciated.

Thanks

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
84 3 0 1

Hi @ziaul: sorry, initially, I did not get your requirement but now it is clear.

Please use TickHistoryIntradaySummariesExtraction

You may give a try with below code

//Request an extraction
ExtractionsContext.Options.AutomaticDecompression = true; //Decompress gzip to plain text
var startDate = new DateTimeOffset(2008, 10, 13, 13, 0, 0, TimeSpan.FromHours(-5)); //Central Time Zone
var endDate = startDate.AddHours(1);
var result = ExtractionsContext.ExtractRaw(
    new TickHistoryIntradaySummariesExtractionRequest
    {
        Condition = new TickHistoryIntradaySummariesCondition
        {
            //Possible values: OneSecond, FiveSeconds, OneMinute, FiveMinutes, TenMinutes, FifteenMinutes, OneHour
            SummaryInterval = TickHistorySummaryInterval.OneMinute,
            //Possible values: Ric, Entity
            ExtractBy = TickHistoryExtractByMode.Ric,
            MessageTimeStampIn = TickHistoryTimeOptions.GmtUtc,
            ReportDateRangeType = ReportDateRangeType.Range,
            QueryStartDate = startDate,
            QueryEndDate = endDate,
            //Possible values: SingleByRic, SingleByTimestamp
            SortBy = TickHistorySort.SingleByRic,
            TimebarPersistence = true,
            DisplaySourceRIC = true
        },
        ContentFieldNames = availableFields.Select(x => x.Name).ToArray(),
        IdentifierList = new InstrumentIdentifierList
        {
            InstrumentIdentifiers = new[]
            {
                InstrumentIdentifier.Create(IdentifierType.Ric, "EUR=")
            }
        },
    });

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Ramprasad.Kumaralu.J, were you able to do this ? Does this solve your issue ?

Upvotes
0 2 4 6

Thank you very much for your reply and am able to resolve my issue.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.