fixed rate bond in ib, sse, szse
Project description
Fixed Rate Bond in China Mainland with Python
We take account frbs in inter-bank market, sse and szse only
Attributes
- maturitydate
- couponrate
- frequency
- issuedate: optional, None by default
Methods
method names mimic those in MS-Excel
- yearsresidual(settlement)
- coupnum(settlement)
- couppcd(settlement)
- coupncd(settlement)
- accrint(settlement, *, dcc)
- price(settlement, yld, *, dcc)
- yld(settlement, prc, *, dcc)
- duration(settlement, yld, *, continuous)
- convexity(settlement, yld, *, continuous)
- __cfs(settlement)
Dependencies
- numpy
Installation
pip install cnfixedratebond
Usage
from cnfixedratebond import FixedRateBond as FRB
from datetime import date
bond basic info (25国债22)
maturity = date(2035, 11, 15)
coupon = 0.0178
freq = 2
instantiation
b = FRB(maturity, coupon, freq)
market info
settle = date(2025, 11, 31)
mkt = 'szse'
prc = 99.947
attributes
b.couponrate
b.maturitydate
b.frequency
years residual
b.yearsresidual(settle)
number of coupon payments
b.coupnum(settle)
previous coupon payment date
b.couppcd(settle)
next coupon payment date
b.coupncd(settle)
accrued interests
b.accrint(settle)
intrinsic value or theoretical clean price (yld = 0.03)
yld = 0.03
b.price(settle, yld, dcc = 'szse')
yield to maturity (price = prc)
y = b.ytm(settle, prc, dcc = 'szse')
duration (yld = y)
b.duration(settle, y)
convexity (yld = y)
b.convexity(settle, y)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cnfixedratebond-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cnfixedratebond-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23d6f3c66b1d0ffff90d55aac8be60e8c7e1f68152b7c877f477ec3e6790fcc3
|
|
| MD5 |
33ff5f5bafd3190cf886402102a0eec2
|
|
| BLAKE2b-256 |
166764f6d3fcb8a44559f6cd5d2e024714a4ddf5b304eeb61ad1d3b16fbd96cf
|