Net yield (after taxes) of a Bond. How to differentiate on cashflow type?

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

Net yield (after taxes) of a Bond. How to differentiate on cashflow type?

Martino Fornasa
Hi all.
I'm trying to build a function to calculate the net yield (after taxes)
of a fixed rate bond. In order to do that, I need to differentiate
between coupon-cashflows and, for example, redemption cashflows.

With a plain-vanilla fixed-rate bond I can assume that only the last
cashflow is a redemption.
In the general case what is my best option? Till now the better option I
can think is to intersect the cashflow vector with the redemption
vector. Any ideas?

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Net yield (after taxes) of a Bond. How to differentiate on cashflow type?

Luigi Ballabio
On Tue, 2010-12-14 at 15:20 +0100, Martino Fornasa wrote:
> I'm trying to build a function to calculate the net yield (after taxes)
> of a fixed rate bond. In order to do that, I need to differentiate
> between coupon-cashflows and, for example, redemption cashflows.
>
> With a plain-vanilla fixed-rate bond I can assume that only the last
> cashflow is a redemption.
> In the general case what is my best option? Till now the better option I
> can think is to intersect the cashflow vector with the redemption
> vector. Any ideas?

Yes, it's either that or switching on the type of each cashflow (you can
try casting to Coupon, or use a visitor; <ql/cashflows/cashflows.cpp>
has examples of both approaches.)

Luigi


--

Vin: It's like this fellow I knew in El Paso. One day, he just took
all his clothes off and jumped in a mess of cactus. I asked him that
same question, "Why?"
Calvera: And?
Vin: He said, "It seemed like a good idea at the time."
-- The Magnificent Seven



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Net yield (after taxes) of a Bond. How to differentiate on cashflow type?

Martino Fornasa
Yes, it's either that or switching on the type of each cashflow (you can
try casting to Coupon, or use a visitor; <ql/cashflows/cashflows.cpp>
has examples of both approaches.)

Thanks. The casting approach is very straightforward.
Speaking about bond cashflows, coupons are correctly instantiated as QuantLib::Coupon class instances, while redemptions are not instantiated as a specific class. Maybe in the future it could be useful to dedicate a QuantLib::CashFlow subclass to redemptions?

B.R., Martino.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Net yield (after taxes) of a Bond. How to differentiate on cashflow type?

Luigi Ballabio
On Sat, 2011-02-05 at 10:48 +0100, Martino Fornasa wrote:

> Speaking about bond cashflows, coupons are correctly instantiated as
> QuantLib::Coupon class instances, while redemptions are not
> instantiated as a specific class. Maybe in the future it could be
> useful to dedicate a QuantLib::CashFlow subclass to redemptions?

Yes, I have this in the pipeline.

Luigi



--

The doctrine of human equality reposes on this: that there is no man
really clever who has not found that he is stupid.
-- Gilbert K. Chesterson



------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users