상속: QLNet.Loan
예제 #1
0
파일: T_Loan.cs 프로젝트: akasolace/qlnet
        public void testFairRate()
        {
            Calendar calendar = new TARGET();

             Date settlementDate = new Date(10, Month.Mar, 2010);

             /*********************
             * LOAN TO BE PRICED *
             **********************/

             // constant nominal 1,000,000 Euro
             double nominal = 1000000.0;
             // fixed leg
             Frequency fixedLegFrequency = Frequency.Monthly;
             BusinessDayConvention fixedLegConvention = BusinessDayConvention.Unadjusted;
             BusinessDayConvention principalLegConvention = BusinessDayConvention.ModifiedFollowing;
             DayCounter fixedLegDayCounter = new Thirty360(Thirty360.Thirty360Convention.European);
             double fixedRate = 0.04;

             // Principal leg
             Frequency pricipalLegFrequency = Frequency.Annual;

             int lenghtInMonths = 3;
             Loan.Type loanType = Loan.Type.Payer;

             Date maturity = settlementDate + new Period(lenghtInMonths, TimeUnit.Years);
             Schedule fixedSchedule = new Schedule(settlementDate, maturity, new Period(fixedLegFrequency),
                                  calendar, fixedLegConvention, fixedLegConvention, DateGeneration.Rule.Forward, false);
             Schedule principalSchedule = new Schedule(settlementDate, maturity, new Period(pricipalLegFrequency),
                                  calendar, principalLegConvention, principalLegConvention, DateGeneration.Rule.Forward, false);
             Loan testLoan = new FixedLoan(loanType, nominal, fixedSchedule, fixedRate, fixedLegDayCounter,
                                     principalSchedule, principalLegConvention);
        }
예제 #2
0
파일: MakeLoans.cs 프로젝트: vdt/QLNet
        public FixedLoan value()
        {
            Schedule fixedSchedule = new Schedule(startDate_, endDate_, new Period(frequency_),
                                  calendar_, convention_, convention_, rule_, endOfMonth_);

             Period principalPeriod = amortising_ == Loan.Amortising.Bullet ?
                                  new Period(Frequency.Once) :
                                  new Period(frequency_);

             Schedule principalSchedule = new Schedule(startDate_, endDate_, principalPeriod,
                                  calendar_, convention_, convention_, rule_, endOfMonth_);

             FixedLoan fl = new FixedLoan(type_, nominal_, fixedSchedule, fixedRate_, dayCounter_,
                                     principalSchedule, convention_);
             return fl;
        }