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.

image

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

Best Answer

  • @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 .

    image

    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