question

Upvotes
Accepted
73 3 5 5

Some Instruments not returning correct data for Composite Extraction

I am trying to obtain a list of exchange codes that the security is traded on using the 9th tutorial example in the .NET SDK set of tutorials - On Demand Composite Extraction. I have replaced the requested fieldnames with :

            string[] requestedFieldNames = {  "Instrument ID",
                    "Exchange Code",
                    "Exchange Country Code",
                    "Exchange Country Code Description",
                    "Exchange Description",
                    "Exchange Listed Flag",
                    "Security Description",
                    "Security Description Detail",
                    "Security Long Description",
                    "Security Long Name",
                    "Exchange Code List"};

and the Instruments with :

instrumentIdentifiers[0] = new InstrumentIdentifier
            {
                IdentifierType = IdentifierType.Cusip,
                Identifier = "922908769"	//Security we are using
            };
            instrumentIdentifiers[1] = new InstrumentIdentifier
            {
                IdentifierType = IdentifierType.Cusip,
                Identifier = "594918104"	//Microsoft
            };

The output of the extraction request returns proper values for Microsoft, while the security we use does not return anything except LIP as exchange code.

Running the same composite extraction on the web GUI returns a proper result with the correct exchange code and a list of exchanges its traded on, which leads me to believe it is a problem with the on demand extraction.

Is there a reason some securities do not work with the API?

dss-rest-apidssdatascope-selectexchanges
untitled.png (6.2 KiB)
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.

1 Answer

· Write an Answer
Upvotes
Accepted
11.3k 26 9 14

@jayzoww

It seems that the security you are using, 92290879, requires the "Use Exchange Code Instead of Lipper as Mutual Fund Default Source" instrument list option which is configured in the User Preferences page .

Normally, the On Demand extraction doesn't apply the options configured in the User Preferences page.

Application can either:

- directly add the option in the extraction request.

DssClient.cs

public IDssEnumerable<ExtractionRow> CreateAndRunCompositeExtraction(
    InstrumentIdentifier[] instrumentIdentifiers, string[] contentFieldNames)
{
    CompositeExtractionRequest extractionComposite = new CompositeExtractionRequest
    {
        IdentifierList = InstrumentIdentifierList.Create(instrumentIdentifiers,
        new InstrumentValidationOptions { 
            UseExchangeCodeInsteadOfLipper = true
        }
        ,false),
        ContentFieldNames = contentFieldNames,
                
    };
    //Run the extraction.
    //This call is blocking, it returns when the extraction is completed:
    return extractionsContext.Extract(extractionComposite);
}

- or set the useUserPreferencesForValidationOptions=true, when call InstrumentIdentifierList.Create() to allow the extraction request to use the options setting in the User Preferences page.

DssClient.cs

public IDssEnumerable<ExtractionRow> CreateAndRunCompositeExtraction(
    InstrumentIdentifier[] instrumentIdentifiers, string[] contentFieldNames)
{
    CompositeExtractionRequest extractionComposite = new CompositeExtractionRequest
    {
        IdentifierList = InstrumentIdentifierList.Create(instrumentIdentifiers, null , true),
        ContentFieldNames = contentFieldNames,
                
    };
    //Run the extraction.
    //This call is blocking, it returns when the extraction is completed:
    return extractionsContext.Extract(extractionComposite);
}

Below is the result.

Returned field values:
922908769, PSE, US, United States, NYSE Arca, , VANGUARD TOTAL STOCK MARKET ETF, , Vanguard Total Stock Market Index Fund;ETF, , ADC,ASE,BAT,BER,BOS,BTY,CIN,DEA,DEX,IEX,MEX,MID,NBA,PCQ,PPB,PSE,TDG,THM,XPH
594918104, NSM, US, United States, NASDAQ Stock Exchange Global Select Market, , MICROSOFT ORD, , Microsoft Ord Shs, , AEX,BDS,BEC,BER,BRN,COL,DEU,DUS,ETX,FRA,GCD,GCY,GCZ,GDA,GER,GSA,GSB,GSC,GSD,GSM,GSP,GSX,HAM,HAN,HKG,IES,MEX,MIL,MUN,NSM,NSQ,NXB,PPB,SGO,STO,STU,SWX,TDG,TRQ,VIE,XBO,XDS

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.