Mimic excel financial functions price, coupncd, couppcd, etc

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

Mimic excel financial functions price, coupncd, couppcd, etc

Dax Reyes
Hi List,

I have been trying out quantlib-python (0.9.9 ubuntu lucid) and was
wondering how to mimic excel functions such as price, etc.
My starting point was the bonds.py in the test directory and the excel
price function PRICE(settlement,maturity,rate,yld,redemption,frequency,basis).
Since Quantlib.Schedule needed for FixedRateBond needs an
effectiveDate , what is the best way to handle this?
I might be doing this the wrong way, so any suggestions are welcome.


Regards,
Dax

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Mimic excel financial functions price, coupncd, couppcd, etc

Luigi Ballabio
On Wed, 2010-10-06 at 16:39 +0800, Raikage wrote:
> I have been trying out quantlib-python (0.9.9 ubuntu lucid) and was
> wondering how to mimic excel functions such as price, etc.
> My starting point was the bonds.py in the test directory and the excel
> price function PRICE(settlement,maturity,rate,yld,redemption,frequency,basis).
> Since Quantlib.Schedule needed for FixedRateBond needs an
> effectiveDate , what is the best way to handle this?

I would go backwards from the maturity with the bond frequency until I
get a date before the settlement. (For example, settlement = November
2nd 2010,  maturity = July 15th, 2012, semiannual frequency, I'd go:
2012-07-15 -> 2012-01-15 -> 2011-07-15 -> 2011-01-15 -> 2010-07-15 and
use the last one as effective date.)

Luigi



--

Call on God, but row away from the rocks.
-- Indian proverb



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Mimic excel financial functions price, coupncd, couppcd, etc

Dax Reyes
Hi Luigi,

Thanks for the insight. :) Great stuff you got here.

On Wed, Oct 27, 2010 at 8:42 PM, Luigi Ballabio
<[hidden email]> wrote:

> On Wed, 2010-10-06 at 16:39 +0800, Raikage wrote:
>> I have been trying out quantlib-python (0.9.9 ubuntu lucid) and was
>> wondering how to mimic excel functions such as price, etc.
>> My starting point was the bonds.py in the test directory and the excel
>> price function PRICE(settlement,maturity,rate,yld,redemption,frequency,basis).
>> Since Quantlib.Schedule needed for FixedRateBond needs an
>> effectiveDate , what is the best way to handle this?
>
> I would go backwards from the maturity with the bond frequency until I
> get a date before the settlement. (For example, settlement = November
> 2nd 2010,  maturity = July 15th, 2012, semiannual frequency, I'd go:
> 2012-07-15 -> 2012-01-15 -> 2011-07-15 -> 2011-01-15 -> 2010-07-15 and
> use the last one as effective date.)
>
> Luigi
>
>
>
> --
>
> Call on God, but row away from the rocks.
> -- Indian proverb
>
>
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users