Example #1
0
        public override QLNet.CashFlow build_ql_cf(FP_Parameter fp_parameter)
        {
            double notional = this.DAO_.NOTIONAL;
            QLNet.Date paymentDate = this.PaymentDate_;

            string index_cd = this.DAO_.FIXING_INDEX_CD;

            QLNet.DayCounter dayCounter = new QLNet.Actual365Fixed();
            QLNet.YieldTermStructure ql_yield_ts = fp_parameter.getEvaluationCurve(index_cd);

            QLNet.Date accrualStartDate = this.CalculationStartDate_;
            QLNet.Date accrualEndDate = this.CalculationEndDate_;
            
            double forwardRate = 0.0;
            
            DateTime fixingDate = ConvertingTool.ToDateTime(this.DAO_.FIXING_DT);

            if (fp_parameter.CalcDate_ >= fixingDate)
            {
                if (this.DAO_.FIXED_FIXING_CALCLATED
                    == (int)clsMAST_CF_VANILLA_FLOATING_TB.FIXED_FIXING_CALCLATED_Type.NOT_FIXED)
                {
                    this.fixing_calulate(fp_parameter.CalcDate_);
                }
                // 계산함.

                forwardRate = this.DAO_.FIXED_FIXING;

            }
            else
            {
                forwardRate = ql_yield_ts.forwardRate(accrualStartDate,
                                                accrualEndDate,
                                                dayCounter,
                                                QLNet.Compounding.Compounded).rate();
            }

            QLNet.CashFlow ql_cf
                = new QLNet.FixedRateCoupon(
                                notional,
                                paymentDate,
                                forwardRate,
                                dayCounter,
                                accrualStartDate,
                                accrualEndDate);

            return ql_cf;
        }
Example #2
0
        // ql_net calculation interface
        public override QLNet.CashFlow build_ql_cf(FP_Parameter fp_parameter)
        {
            double notional = this.DAO_.NOTIONAL;
            QLNet.Date paymentDate = this.PaymentDate_;
            double rate = this.DAO_.FIXED_RATE;

            QLNet.DayCounter dayCounter = new QLNet.Actual365Fixed();
                             
            QLNet.Date accrualStartDate = this.CalculationStartDate_;
            QLNet.Date accrualEndDate = this.CalculationEndDate_;

            QLNet.CashFlow ql_cf 
                = new QLNet.FixedRateCoupon(
                                notional,
                                paymentDate,
                                rate,
                                dayCounter,
                                accrualStartDate,
                                accrualEndDate);

            return ql_cf;
        }