public override void scheduleDataGenerate()
        {
            this.excel_fixedBond_subScheduleViewModel_.Clear();

            FixedBond_TradeString fb_ts = new FixedBond_TradeString();

            fb_ts.parsingString(this.productString_);

            #region block

            #region comment
            
            
            //this.scheduleGeneratorVM_.InitialDate_ = this.effectiveDate_;
            //this.scheduleGeneratorVM_.EndDate_ = this.maturity_;
            //this.scheduleGeneratorVM_.Tenor_ = this.couponTenor_;
            //this.scheduleGeneratorVM_.PaymentDays_ = this.settlementDays_;

            //this.scheduleGeneratorVM_.Calendar_ = 
            //this.scheduleGeneratorVM_.DateGeneration_ = this.date

            //QLNet.Period maturityPeriod = new Period(maturityTenor, tu);
            //QLNet.Period maturityPeriod = new Period(this.maturity_);

            //// Y 말고 M도 처리해야함 // 우선은 int로 하자 1.5Y이런거는 잠시 대기
            //int maturityTenor = maturityPeriod.length();

            //TimeUnit tu = maturityPeriod.units(); //TimeUnit.Years;

            //this.scheduleGeneratorVM_.EndDate_ = this.effectiveDate_.AddYears(maturityTenor);

            //QLNet.Period couponPeriod = new Period(this.couponTenor_); //new Period(couponTenor, tu);

            //// coupon
            //int couponTenor = couponPeriod.length();
            //double couponMultiplier = Convert.ToDouble(couponPeriod.frequency());//1.0;

            //this.scheduleGeneratorVM_.Tenor_ = couponPeriod.ToShortString();

            //int addingDays = 0;

            //this.scheduleGeneratorVM_.genDates(addingDays);

            //ObservableCollection<DateTime> eventDates = this.scheduleGeneratorVM_.Dates_;

            //int scheduleLength = eventDates.Count;

            //this.SettlementDays_ = Convert.ToInt32(tsm.SettlementDays_);

            #endregion

            #endregion

            this.scheduleGeneratorVM_.genDates();

            for (int i = 0; i < this.scheduleGeneratorVM_.Dates_.Count - 1; i++)
            {
                Excel_fixedBond_subScheduleViewModel data = new Excel_fixedBond_subScheduleViewModel();

                data.EventDate_ = this.scheduleGeneratorVM_.Dates_[i+1];

                data.CalculationStartDate_ = this.scheduleGeneratorVM_.Dates_[i];
                data.CalculationEndDate_ = this.scheduleGeneratorVM_.Dates_[i + 1];
                data.PaymentDate_ = this.scheduleGeneratorVM_.Dates_[i + 1].AddDays(Convert.ToDouble(this.scheduleGeneratorVM_.PaymentDays_));
                data.FixedRate_ = this.FixedRate_;

                this.excel_fixedBond_subScheduleViewModel_.Add(data);
            }

        }
Esempio n. 2
0
        public override void scheduleDataGenerate()
        {
            this.excel_fixedBond_subScheduleViewModel_.Clear();

            FixedBond_TradeString fb_ts = new FixedBond_TradeString();

            fb_ts.parsingString(this.productString_);

            #region block

            #region comment


            //this.scheduleGeneratorVM_.InitialDate_ = this.effectiveDate_;
            //this.scheduleGeneratorVM_.EndDate_ = this.maturity_;
            //this.scheduleGeneratorVM_.Tenor_ = this.couponTenor_;
            //this.scheduleGeneratorVM_.PaymentDays_ = this.settlementDays_;

            //this.scheduleGeneratorVM_.Calendar_ =
            //this.scheduleGeneratorVM_.DateGeneration_ = this.date

            //QLNet.Period maturityPeriod = new Period(maturityTenor, tu);
            //QLNet.Period maturityPeriod = new Period(this.maturity_);

            //// Y 말고 M도 처리해야함 // 우선은 int로 하자 1.5Y이런거는 잠시 대기
            //int maturityTenor = maturityPeriod.length();

            //TimeUnit tu = maturityPeriod.units(); //TimeUnit.Years;

            //this.scheduleGeneratorVM_.EndDate_ = this.effectiveDate_.AddYears(maturityTenor);

            //QLNet.Period couponPeriod = new Period(this.couponTenor_); //new Period(couponTenor, tu);

            //// coupon
            //int couponTenor = couponPeriod.length();
            //double couponMultiplier = Convert.ToDouble(couponPeriod.frequency());//1.0;

            //this.scheduleGeneratorVM_.Tenor_ = couponPeriod.ToShortString();

            //int addingDays = 0;

            //this.scheduleGeneratorVM_.genDates(addingDays);

            //ObservableCollection<DateTime> eventDates = this.scheduleGeneratorVM_.Dates_;

            //int scheduleLength = eventDates.Count;

            //this.SettlementDays_ = Convert.ToInt32(tsm.SettlementDays_);

            #endregion

            #endregion

            this.scheduleGeneratorVM_.genDates();

            for (int i = 0; i < this.scheduleGeneratorVM_.Dates_.Count - 1; i++)
            {
                Excel_fixedBond_subScheduleViewModel data = new Excel_fixedBond_subScheduleViewModel();

                data.EventDate_ = this.scheduleGeneratorVM_.Dates_[i + 1];

                data.CalculationStartDate_ = this.scheduleGeneratorVM_.Dates_[i];
                data.CalculationEndDate_   = this.scheduleGeneratorVM_.Dates_[i + 1];
                data.PaymentDate_          = this.scheduleGeneratorVM_.Dates_[i + 1].AddDays(Convert.ToDouble(this.scheduleGeneratorVM_.PaymentDays_));
                data.FixedRate_            = this.FixedRate_;

                this.excel_fixedBond_subScheduleViewModel_.Add(data);
            }
        }