Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

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

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

Lluis Pujol Bajador

Sergvil,

Just to add that it is included in cashflows.i.

Lluís


On Wed 19/10/11 12:02 , Lluis Pujol Bajador <[hidden email]> wrote:

Sergvil,

I believe that we already exported setCouponPricer in SWIG.

Have you check in the subversion trunk?. I found this on it.

void setCouponPricer(const Leg&,

                     const boost::shared_ptr<FloatingRateCouponPricer>&);

Lluís


On Wed 19/10/11 09:02 , sergvil <[hidden email]> wrote:



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.
>
>

--
View this message in context: http://old.nabble.com/Setting-Ibor-Coupon-Pricer-to-Fixed-Rate-Bond-in-C--tp32672637p32680201.html
Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
<A href="javascript:top.opencompose(" target=_blank QuantLib-users@lists.sourceforge.net?,??,??,?1?)?>javascript:top.opencompose('QuantLib-users@...','','','1')
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

_______________________________________________
QuantLib-users mailing list
<A href="javascript:top.opencompose('QuantLib-users@lists.sourceforge.net','','','1')">QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

sergvil

Thank you very much.

 

I found the method in CashFlows.i but I don’t know how to use it.

 

When I try to call this method I can’t find it.

 

Perhaps this method is not public?

 

De: Lluis Pujol Bajador [mailto:[hidden email]]
Enviado el: miércoles, 19 de octubre de 2011 12:04
Para: sergvil; [hidden email]
Asunto: Re: [Quantlib-users] Setting Ibor Coupon Pricer to Fixed RateBondin C#

 

Sergvil,

Just to add that it is included in cashflows.i.

Lluís


On Wed 19/10/11 12:02 , Lluis Pujol Bajador <[hidden email]> wrote:

Sergvil,

I believe that we already exported setCouponPricer in SWIG.

Have you check in the subversion trunk?. I found this on it.

void setCouponPricer(const Leg&,

                     const boost::shared_ptr<FloatingRateCouponPricer>&);

 

Lluís


On Wed 19/10/11 09:02 , sergvil <[hidden email]> wrote:



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.
>
>

--
View this message in context: http://old.nabble.com/Setting-Ibor-Coupon-Pricer-to-Fixed-Rate-Bond-in-C--tp32672637p32680201.html
Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
<a href="javascript:top.opencompose(" target="_blank">javascript:top.opencompose('QuantLib-users@...','','','1')
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

_______________________________________________
QuantLib-users mailing list
<a href="javascript:top.opencompose('QuantLib-users@lists.sourceforge.net','','','1')">QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

Luigi Ballabio
On Wed, 2011-10-19 at 12:11 +0200, Sergio Villar de María wrote:
> I found the method in CashFlows.i but I don’t know how to use it.
>
> When I try to call this method I can’t find it.

It's not a method, it's a free function.  C# doesn't like those, so SWIG
puts them in a class as static methods.  You can call it as

NQuantLibc.setCouponPricer(leg, pricer);

Luigi


--

Ninety percent of everything is crap.
--- Theodore Sturgeon



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

Lluis Pujol Bajador
In reply to this post by Lluis Pujol Bajador

Sergio,

I don't know in C#, but in python (you can look at the bonds.py example) is just used as you suggest.

setCouponPricer(floatingRateBond.cashflows(),pricer)

I don't know which Swig binaries do you have, but have you tried to rebuild it?

Finally, altough you mention Fixed Rate Bond, I assume that you are talking about Floating Rate bonds.

For Fixed Bonds you don't need a Coupon Pricer.

Lluís.




On Wed 19/10/11 12:11 , Sergio Villar de María <[hidden email]> wrote:

Thank you very much.

 

I found the method in CashFlows.i but I don’t know how to use it.

 

When I try to call this method I can’t find it.

 

Perhaps this method is not public?

 

De: Lluis Pujol Bajador [mailto:[hidden email]]
Enviado el: miércoles, 19 de octubre de 2011 12:04
Para: sergvil; [hidden email]
Asunto: Re: [Quantlib-users] Setting Ibor Coupon Pricer to Fixed RateBondin C#

 

Sergvil,

Just to add that it is included in cashflows.i.

Lluís


On Wed 19/10/11 12:02 , Lluis Pujol Bajador <[hidden email]> wrote:

Sergvil,

I believe that we already exported setCouponPricer in SWIG.

Have you check in the subversion trunk?. I found this on it.

void setCouponPricer(const Leg&,

                     const boost::shared_ptr<FloatingRateCouponPricer>&);

 

Lluís


On Wed 19/10/11 09:02 , sergvil <[hidden email]> wrote:



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.
>
>

--
View this message in context: http://old.nabble.com/Setting-Ibor-Coupon-Pricer-to-Fixed-Rate-Bond-in-C--tp32672637p32680201.html
Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
<A href="javascript:top.opencompose(" target=_blank>javascript:top.opencompose('QuantLib-users@...','','','1')
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

_______________________________________________
QuantLib-users mailing list
<A href="javascript:top.opencompose(" target=_blank QuantLib-users@lists.sourceforge.net?,??,??,?1?)?>QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

sergvil
In reply to this post by Luigi Ballabio
Ok, it Works!

I was getting crazy with this issue.

Thank you very much!!

-----Mensaje original-----
De: Luigi Ballabio [mailto:[hidden email]]
Enviado el: miércoles, 19 de octubre de 2011 12:23
Para: Sergio Villar de María
CC: [hidden email]; [hidden email]
Asunto: Re: [Quantlib-users] Setting Ibor Coupon Pricer to Fixed RateBondin C#

On Wed, 2011-10-19 at 12:11 +0200, Sergio Villar de María wrote:
> I found the method in CashFlows.i but I don’t know how to use it.
>
> When I try to call this method I can’t find it.

It's not a method, it's a free function.  C# doesn't like those, so SWIG
puts them in a class as static methods.  You can call it as

NQuantLibc.setCouponPricer(leg, pricer);

Luigi


--

Ninety percent of everything is crap.
--- Theodore Sturgeon




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting Ibor Coupon Pricer to Fixed RateBondin C#

sergvil
In reply to this post by Lluis Pujol Bajador

Yes, I’m sorry. I was talking about Floating Rate Bonds.

 

Thank you again.

 

De: Lluis Pujol Bajador [mailto:[hidden email]]
Enviado el: miércoles, 19 de octubre de 2011 12:30
Para: Sergio Villar de María; [hidden email]; [hidden email]
Asunto: RE: [Quantlib-users] Setting Ibor Coupon Pricer to Fixed RateBondin C#

 

Sergio,

I don't know in C#, but in python (you can look at the bonds.py example) is just used as you suggest.

setCouponPricer(floatingRateBond.cashflows(),pricer)

I don't know which Swig binaries do you have, but have you tried to rebuild it?

Finally, altough you mention Fixed Rate Bond, I assume that you are talking about Floating Rate bonds.

For Fixed Bonds you don't need a Coupon Pricer.

Lluís.




On Wed 19/10/11 12:11 , Sergio Villar de María <[hidden email]> wrote:

Thank you very much.

 

I found the method in CashFlows.i but I don’t know how to use it.

 

When I try to call this method I can’t find it.

 

Perhaps this method is not public?

 

De: Lluis Pujol Bajador [mailto:[hidden email]]
Enviado el: miércoles, 19 de octubre de 2011 12:04
Para: sergvil; [hidden email]
Asunto: Re: [Quantlib-users] Setting Ibor Coupon Pricer to Fixed RateBondin C#

 

Sergvil,

Just to add that it is included in cashflows.i.

Lluís


On Wed 19/10/11 12:02 , Lluis Pujol Bajador <[hidden email]> wrote:

Sergvil,

I believe that we already exported setCouponPricer in SWIG.

Have you check in the subversion trunk?. I found this on it.

void setCouponPricer(const Leg&,

                     const boost::shared_ptr<FloatingRateCouponPricer>&);

 

Lluís


On Wed 19/10/11 09:02 , sergvil <[hidden email]> wrote:



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.
>
>

--
View this message in context: http://old.nabble.com/Setting-Ibor-Coupon-Pricer-to-Fixed-Rate-Bond-in-C--tp32672637p32680201.html
Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
<a href="javascript:top.opencompose(" target="_blank">javascript:top.opencompose('QuantLib-users@...','','','1')
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

_______________________________________________
QuantLib-users mailing list
<a href="javascript:top.opencompose(" target="_blank">QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users