示例#1
0
        public void Test_MSCI_Indexes_Daily_Security()
        {
            var x = new
            {
                indexType   = indexType_DM,
                xmlPath     = rootPath_DM,
                xsdClass    = typeof(MSCIBarra_EquityIndex.package_D15D),
                xmlDataFile = "CORE_DM_ALL_SECURITY_MAIN_DAILY_D.xml"
            };


            MSCIBarra_EquityIndex.package_D15D p = (MSCIBarra_EquityIndex.package_D15D) this.Test_package(x.xmlPath, x.xsdClass, PREFIX_DATE + x.xmlDataFile);

            Console.WriteLine("DATE;ISIN;SEDOL;CODE_RIC;CODE_BLOOM;NOM;PAYS;DEVISE;SECTEUR;SOUSSECTEUR;COURS Ouverture;COURS Cloture;FLOTTANT;ACTIF_NET;ACTIF_NET_USD;PERF_PRICE;PERF_PRICE_USD;PERF_GROSS;PERF_GROSS_USD;PERF_NET;PERF_NET_USD;FACTEUR_AJUSTEMENT_PRIX");
            //Console.WriteLine("ALL:  Nb of Securities: {0}", p.dataset_D15D.Count);
            foreach (MSCIBarra_EquityIndex.package_D15DEntry e in p.dataset_D15D)
            {
                //Console.WriteLine("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9}", e.calc_date, e.security_name, e.isin, e.price, e.price_ISO_currency_symbol, e.price_return_loc, e.bb_ticker, e.industry, e.ISO_country_symbol, e.sector);
                Console.WriteLine("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21}",
                                  String.Format("{0:dd/MM/yyyy}", e.calc_date), e.isin, e.sedol, e.RIC, e.bb_ticker,
                                  e.security_name, e.ISO_country_symbol, e.price_ISO_currency_symbol, e.sector, e.sub_industry, e.price, e.price, e.closing_number_of_shares, e.initial_mkt_cap_loc_next_day,
                                  e.initial_mkt_cap_usd_next_day,

                                  e.price_return_loc, e.price_return_usd,
                                  e.gross_return_loc, e.gross_return_usd,
                                  e.net_return_intl_loc, e.net_return_intl_usd,
                                  e.price_adjustment_factor);
            }
        }
示例#2
0
        private DataTable read(MSCIBarra_EquityIndex.package_D15D p)
        {
            DataTable DT = new DataTable("MSCI_D15D");



            string columnsDef = "DATE;ISIN;SEDOL;CODE_RIC;CODE_BLOOM;NOM;PAYS;DEVISE;SECTEUR;SOUSSECTEUR;COURS Ouverture;COURS Cloture;FLOTTANT;ACTIF_NET;ACTIF_NET_USD;PERF_PRICE;PERF_PRICE_USD;PERF_GROSS;PERF_GROSS_USD;PERF_NET;PERF_NET_USD;FACTEUR_AJUSTEMENT_PRIX";

            foreach (string c in columnsDef.Split(';'))
            {
                DT.Columns.Add(c);
            }

            //Console.WriteLine("ALL:  Nb of Securities: {0}", p.dataset_D15D.Count);
            foreach (MSCIBarra_EquityIndex.package_D15DEntry e in p.dataset_D15D)
            {
                DT.Rows.Add(String.Format("{0:dd/MM/yyyy}", e.calc_date), e.isin, e.sedol, e.RIC, e.bb_ticker,
                            e.security_name, e.ISO_country_symbol, e.price_ISO_currency_symbol, e.sector, e.sub_industry, e.price, e.price, e.closing_number_of_shares, e.initial_mkt_cap_loc_next_day,
                            e.initial_mkt_cap_usd_next_day,
                            e.price_return_loc, e.price_return_usd,
                            e.gross_return_loc, e.gross_return_usd,
                            e.net_return_intl_loc, e.net_return_intl_usd,
                            e.price_adjustment_factor);
                //Console.WriteLine("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9}", e.calc_date, e.security_name, e.isin, e.price, e.price_ISO_currency_symbol, e.price_return_loc, e.bb_ticker, e.industry, e.ISO_country_symbol, e.sector);
            }
            return(DT);
        }
示例#3
0
        public void Test_MSCI_Indexes_Daily_Security_ZIPFile()
        {
            var x = new
            {
                indexType   = indexType_DM,
                xmlPath     = rootPath,
                xsdClass    = typeof(MSCIBarra_EquityIndex.package_D15D),
                xmlDataFile = "CORE_DM_ALL_SECURITY_MAIN_DAILY_D.xml",
                zipDataFile = USED_DATE + @"core_dm_daily_d.zip"
            };


            MSCIBarra_EquityIndex.package_D15D p = (MSCIBarra_EquityIndex.package_D15D) this.Test_packageZIP(x.xmlPath, x.xsdClass, x.zipDataFile, PREFIX_DATE + x.xmlDataFile);
            DataSet DS = new DataSet();

            DS.Tables.Add(this.read(p));

            String   excel = @"C:\YYYYMMDDMSCI_Sec.xls";
            DateTime now   = DateTime.Now;

            excel = excel.Replace("YYYYMMDD", now.ToString("yyyyMMdd"));

            ExcelFile.CreateWorkbook(DS, excel);
        }