Example #1
0
        private static void ParseGovt(Element fieldData, string security)
        {
            Govt govt;

            try
            {
                string country    = fieldData.GetElementAsString("COUNTRY_ISO");
                double px_last    = fieldData.GetElementAsFloat64("PX_LAST");
                string currency   = fieldData.GetElementAsString("DDIS_CURRENCY");
                string name       = fieldData.GetElementAsString("NAME");
                int    id_Mcorp   = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");
                double duration   = fieldData.GetElementAsFloat64("YAS_MOD_DUR");
                string maturity   = fieldData.GetElementAsString("MATURITY");

                string date_cpn       = fieldData.GetElementAsString("NXT_CPN_DT");
                int    nb_day_nxt_cpn = fieldData.GetElementAsInt32("DAYS_TO_NEXT_COUPON");
                double cpn            = fieldData.GetElementAsFloat64("CPN");
                int    cpn_freq       = fieldData.GetElementAsInt32("CPN_FREQ");


                int rating = Rating.GetQuality(fieldData);

                govt = new Govt(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp, rating, d_title[security].Item2, date_cpn, maturity, duration, cpn, cpn_freq, nb_day_nxt_cpn);
            }
            catch (NotFoundException e)
            {
                govt = new Govt(security, d_title[security].Item1, d_title[security].Item2, e.Description());
            }
            l_title.Add(govt);
        }
Example #2
0
        private static void ParseGovt(Element fieldData, string security)
        {
            Govt govt;
            try
            {
                string country = fieldData.GetElementAsString("COUNTRY_ISO");
                double px_last = fieldData.GetElementAsFloat64("PX_LAST");
                string currency = fieldData.GetElementAsString("DDIS_CURRENCY");
                string name = fieldData.GetElementAsString("NAME");
                int id_Mcorp = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");
                double duration = fieldData.GetElementAsFloat64("YAS_MOD_DUR");
                string maturity = fieldData.GetElementAsString("MATURITY");

                string date_cpn = fieldData.GetElementAsString("NXT_CPN_DT");
                int nb_day_nxt_cpn = fieldData.GetElementAsInt32("DAYS_TO_NEXT_COUPON");
                double cpn = fieldData.GetElementAsFloat64("CPN");
                int cpn_freq = fieldData.GetElementAsInt32("CPN_FREQ");

                int rating = Rating.GetQuality(fieldData);

                govt = new Govt(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp, rating, d_title[security].Item2,date_cpn, maturity, duration, cpn, cpn_freq, nb_day_nxt_cpn);
            }
            catch (NotFoundException e)
            {
                govt = new Govt(security, d_title[security].Item1, d_title[security].Item2, e.Description());
            }
            l_title.Add(govt);
        }
Example #3
0
        private static void ParseGovt(Element fieldData, string security)
        {
            /*valeur actuel = qt* nominale*/
            Govt govt;
            string name = "";
            try
            {
                name = fieldData.GetElementAsString("NAME");
                string maturity = fieldData.GetElementAsString("MATURITY");
                if (Convert.ToDateTime(maturity) > DateTime.Now)
                {
                    string country = fieldData.GetElementAsString("COUNTRY_ISO");
                    double px_last = fieldData.GetElementAsFloat64("PX_LAST");
                    string currency = fieldData.GetElementAsString("DDIS_CURRENCY");
                    int id_Mcorp = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                    string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");
                    double duration = fieldData.GetElementAsFloat64("YAS_MOD_DUR");

                    string date_cpn = fieldData.GetElementAsString("NXT_CPN_DT");
                    int nb_day_nxt_cpn = fieldData.GetElementAsInt32("DAYS_TO_NEXT_COUPON");
                    double cpn = fieldData.GetElementAsFloat64("CPN");
                    int cpn_freq = fieldData.GetElementAsInt32("CPN_FREQ");
                    double px_emit = fieldData.GetElementAsFloat64("WORKOUT_PX_BID");

                    int rating = Rating.GetQuality(fieldData);
                    govt = new Govt(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp, rating, d_title[security].Item2, date_cpn, maturity, duration, cpn, cpn_freq, nb_day_nxt_cpn, px_emit);

                    l_title.Add(govt);
                }
                else
                {
                    govt = new Govt(security,name, d_title[security].Item1, d_title[security].Item2, "Obligation ECHU, maturity : " + maturity);
                    l_err.Add(govt);
                }
            }
            catch (NotFoundException e)
            {
                govt = new Govt(security,name, d_title[security].Item1, d_title[security].Item2, e.Description());
                l_err.Add(govt);
            }
        }