NTN-B Princ
dv01(settlement, maturity, rate, face_value)
Calculate the DV01 (Dollar Value of 01) for an LTN in R$.
Represents the price change in R$ for a 1 basis point (0.01%) increase in yield.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settlement
|
DateScalar
|
The settlement date in 'DD-MM-YYYY' format or a pandas Timestamp. |
required |
maturity
|
DateScalar
|
The maturity date in 'DD-MM-YYYY' format or a pandas Timestamp. |
required |
rate
|
float
|
The discount rate used to calculate the present value of the cash flows, which is the yield to maturity (YTM) of the LTN. |
required |
face_value
|
float
|
The face value of the bond (VNA). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The DV01 value, representing the price change for a 1 basis point increase in yield. |
Examples:
>>> from pyield import ntnbprinc as bp
>>> bp.dv01("02-12-2025", "15-05-2029", 0.0777, 4567.033825)
1.1200559999997495
Source code in pyield/tn/ntnbprinc.py
price(settlement, maturity, rate, face_value)
Calculate the NTN-B PRINCIPAL price using Anbima rules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settlement
|
DateScalar
|
The settlement date in 'DD-MM-YYYY' format or a pandas Timestamp. |
required |
maturity
|
DateScalar
|
The maturity date in 'DD-MM-YYYY' format or a pandas Timestamp. |
required |
rate
|
float
|
The discount rate used to calculate the present value of the cash flows, which is the yield to maturity (YTM) of the NTN-F. |
required |
face_value
|
float
|
The face value of the bond (VNA). |
required |
Returns: float: The NTN-B PRINCIPAL price using Anbima rules.
References
- https://www.anbima.com.br/data/files/A0/02/CC/70/8FEFC8104606BDC8B82BA2A8/Metodologias%20ANBIMA%20de%20Precificacao%20Titulos%20Publicos.pdf
Examples:
>>> from pyield import ntnbprinc
>>> ntnbprinc.price("02-12-2025", "15-05-2029", 0.0777, 4567.033825)
3537.763157