Beispiel #1
0
 Real LinearTsrPricer::swapletPrice() const {
     if (fixingDate_ <= today_) {
         // the fixing is determined
         const Rate Rs = coupon_->swapIndex()->fixing(fixingDate_);
         Rate price =
             (gearing_ * Rs + spread_) *
             (coupon_->accrualPeriod() *
              discountCurve_->discount(paymentDate_) * couponDiscountRatio_);
         return price;
     } else {
         Real atmCapletPrice = optionletPrice(Option::Call, swapRateValue_);
         Real atmFloorletPrice = optionletPrice(Option::Put, swapRateValue_);
         return gearing_ * (coupon_->accrualPeriod() *
                                discountCurve_->discount(paymentDate_) *
                                swapRateValue_ * couponDiscountRatio_ +
                            atmCapletPrice - atmFloorletPrice) +
                spreadLegValue_;
     }
 }
 Real LognormalCmsSpreadPricer::floorletPrice(Rate effectiveFloor) const {
     // floorlet is equivalent to put option on fixing
     if (fixingDate_ <= today_) {
         // the fixing is determined
         const Rate Rs = std::max(
             effectiveFloor - coupon_->index()->fixing(fixingDate_), 0.);
         Rate price = gearing_ * Rs * coupon_->accrualPeriod() * discount_;
         return price;
     } else {
         Real floorletPrice = optionletPrice(Option::Put, effectiveFloor);
         return gearing_ * floorletPrice;
     }
 }
 Real LognormalCmsSpreadPricer::capletPrice(Rate effectiveCap) const {
     // caplet is equivalent to call option on fixing
     if (fixingDate_ <= today_) {
         // the fixing is determined
         const Rate Rs = std::max(
             coupon_->index()->fixing(fixingDate_) - effectiveCap, 0.);
         Rate price = gearing_ * Rs * coupon_->accrualPeriod() * discount_;
         return price;
     } else {
         Real capletPrice = optionletPrice(Option::Call, effectiveCap);
         return gearing_ * capletPrice;
     }
 }
Beispiel #4
0
 Real LinearTsrPricer::floorletPrice(Rate effectiveFloor) const {
     // floorlet is equivalent to put option on fixing
     if (fixingDate_ <= today_) {
         // the fixing is determined
         const Rate Rs = std::max(
             effectiveFloor - coupon_->swapIndex()->fixing(fixingDate_), 0.);
         Rate price =
             (gearing_ * Rs) *
             (coupon_->accrualPeriod() *
              discountCurve_->discount(paymentDate_) * couponDiscountRatio_);
         return price;
     } else {
         Real floorletPrice = optionletPrice(Option::Put, effectiveFloor);
         return gearing_ * floorletPrice;
     }
 }
Beispiel #5
0
 Real LinearTsrPricer::capletPrice(Rate effectiveCap) const {
     // caplet is equivalent to call option on fixing
     if (fixingDate_ <= today_) {
         // the fixing is determined
         const Rate Rs = std::max(
             coupon_->swapIndex()->fixing(fixingDate_) - effectiveCap, 0.);
         Rate price =
             (gearing_ * Rs) *
             (coupon_->accrualPeriod() *
              discountCurve_->discount(paymentDate_) * couponDiscountRatio_);
         return price;
     } else {
         Real capletPrice = optionletPrice(Option::Call, effectiveCap);
         return gearing_ * capletPrice;
     }
 }
 Real CPICouponPricer::capletPrice(Rate effectiveCap) const{
     Real capletPrice = optionletPrice(Option::Call, effectiveCap);
     return gearing_ * capletPrice;
 }
 Real CPICouponPricer::floorletPrice(Rate effectiveFloor) const{
     Real floorletPrice = optionletPrice(Option::Put, effectiveFloor);
     return gearing_ * floorletPrice;
 }