示例#1
0
        public AmortizingBond(double FaceValue,
                              double MarketValue,
                              double CouponRate,
                              Date IssueDate,
                              Date MaturityDate,
                              Date TradeDate,
                              Frequency payFrequency,
                              DayCounter dCounter,
                              AmortizingMethod Method,
                              Calendar calendar,
                              double gYield = 0) :
            base(0, new TARGET(), IssueDate)
        {
            _faceValue    = FaceValue;
            _marketValue  = MarketValue;
            _couponRate   = CouponRate;
            _issueDate    = IssueDate;
            _maturityDate = MaturityDate;
            _tradeDate    = TradeDate;
            _payFrequency = payFrequency;
            _dCounter     = dCounter;
            _method       = Method;
            _calendar     = calendar;
            _isPremium    = _marketValue > _faceValue;

            // Store regular payment of faceValue * couponRate for later calculation
            _originalPayment = (_faceValue * _couponRate) / (double)_payFrequency;

            if (gYield == 0)
            {
                _yield = calculateYield();
            }
            else
            {
                _yield = gYield;
            }

            // We can have several method here
            //  Straight-Line Amortization , Effective Interest Rate, Rule 78
            // for now we start with Effective Interest Rate.
            switch (_method)
            {
            case AmortizingMethod.EffectiveInterestRate:
                addEffectiveInterestRateAmortizing();
                break;

            default:
                break;
            }
        }
示例#2
0
      public AmortizingBond(double FaceValue,
                            double MarketValue,
                            double CouponRate,
                            Date IssueDate,
                            Date MaturityDate,
                            Date TradeDate,
                            Frequency payFrequency,
                            DayCounter dCounter,
                            AmortizingMethod Method,
                            Calendar calendar,
                            double gYield = 0) :
         base(0, new TARGET(), IssueDate)
      {
         _faceValue = FaceValue;
         _marketValue = MarketValue;
         _couponRate = CouponRate;
         _issueDate = IssueDate;
         _maturityDate = MaturityDate;
         _tradeDate = TradeDate;
         _payFrequency = payFrequency;
         _dCounter = dCounter;
         _method = Method;
         _calendar = calendar;
         _isPremium = _marketValue > _faceValue;

         // Store regular payment of faceValue * couponRate for later calculation
         _originalPayment = (_faceValue * _couponRate) / (double)_payFrequency;

         if (gYield == 0)
            _yield = calculateYield();
         else
            _yield = gYield;

         // We can have several method here 
         //  Straight-Line Amortization , Effective Interest Rate, Rule 78
         // for now we start with Effective Interest Rate.
         switch ( _method )
         {
            case AmortizingMethod.EffectiveInterestRate:
               addEffectiveInterestRateAmortizing();
               break;
            default:
               break;
         }

      }
示例#3
0
 public static AmortizingBond makeAmortizingBond(double FaceValue,
                                                 double MarketValue,
                                                 double CouponRate,
                                                 Date IssueDate,
                                                 Date MaturityDate,
                                                 Date TradeDate,
                                                 Frequency payFrequency,
                                                 DayCounter dCounter,
                                                 AmortizingMethod Method,
                                                 double gYield = 0)
 {
     return(new AmortizingBond(FaceValue,
                               MarketValue,
                               CouponRate,
                               IssueDate,
                               MaturityDate,
                               TradeDate,
                               payFrequency,
                               dCounter,
                               Method,
                               new NullCalendar(), gYield));
 }
示例#4
0
 public static AmortizingBond makeAmortizingBond(double FaceValue,
                                                 double MarketValue,
                                                 double CouponRate,
                                                 Date IssueDate,
                                                 Date MaturityDate,
                                                 Date TradeDate,
                                                 Frequency payFrequency,
                                                 DayCounter dCounter,
                                                 AmortizingMethod Method,
                                                 double gYield=0)
 {
    return new AmortizingBond(FaceValue,
                              MarketValue,
                              CouponRate,
                              IssueDate,
                              MaturityDate,
                              TradeDate,
                              payFrequency,
                              dCounter,
                              Method,
                              new NullCalendar(),gYield);
 }