Setting Ibor Coupon Pricer to Fixed Rate Bond in C#

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting Ibor Coupon Pricer to Fixed Rate Bond in C#

sergvil
Hello,

I have a problem when I try to set a pricer to a Fixed Rate Bond. In C++ we have to do this:

  // Coupon pricers
  boost::shared_ptr<IborCouponPricer> pricer(new BlackIborCouponPricer);

 // optionLet volatilities
  Handle<OptionletVolatilityStructure> vol = Handle<OptionletVolatilityStructure>(
          boost::shared_ptr<OptionletVolatilityStructure>(new
                  ConstantOptionletVolatility(
                          settlementDays,
                          calendar,
                          ModifiedFollowing,
                          volatility,
                          Actual365Fixed())));

  pricer->setCapletVolatility(vol);
  setCouponPricer(floatingRateBond.cashflows(),pricer);

In C#, I can't find "setCouponPricer" method. It belongs to class "PricerSetter". Perhaps this class it isn't included in SWIG, is it?

Anyway, can I set the pricer using other methods?

Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed Rate Bond in C#

sergvil

I'm trying to solve this issue adding "setCouponPricer" method to SWIG. I need to include this method in bonds.i but I'm not sure how to write it.

Somebody can help me?

Thank you very much.

sergvil wrote
Hello,

I have a problem when I try to set a pricer to a Fixed Rate Bond. In C++ we have to do this:

  // Coupon pricers
  boost::shared_ptr<IborCouponPricer> pricer(new BlackIborCouponPricer);

 // optionLet volatilities
  Handle<OptionletVolatilityStructure> vol = Handle<OptionletVolatilityStructure>(
          boost::shared_ptr<OptionletVolatilityStructure>(new
                  ConstantOptionletVolatility(
                          settlementDays,
                          calendar,
                          ModifiedFollowing,
                          volatility,
                          Actual365Fixed())));

  pricer->setCapletVolatility(vol);
  setCouponPricer(floatingRateBond.cashflows(),pricer);

In C#, I can't find "setCouponPricer" method. It belongs to class "PricerSetter". Perhaps this class it isn't included in SWIG, is it?

Anyway, can I set the pricer using other methods?

Thank you very much.