NTN-C
cash_flows(settlement, maturity)
Generate the cash flows for NTN-C bonds between the settlement and maturity dates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settlement
|
DateScalar
|
The settlement date (exclusive) to start generating the cash flows. |
required |
maturity
|
DateScalar
|
The maturity date of the bond. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: DataFrame with columns "PaymentDate" and "CashFlow". |
Returned columns
- PaymentDate: The payment date of the cash flow
- CashFlow: Cash flow value for the bond
Examples:
>>> from pyield import ntnc
>>> ntnc.cash_flows("21-03-2025", "01-01-2031")
PaymentDate CashFlow
0 2025-07-01 5.830052
1 2026-01-01 5.830052
2 2026-07-01 5.830052
3 2027-01-01 5.830052
4 2027-07-01 5.830052
5 2028-01-01 5.830052
6 2028-07-01 5.830052
7 2029-01-01 5.830052
8 2029-07-01 5.830052
9 2030-01-01 5.830052
10 2030-07-01 5.830052
11 2031-01-01 105.830052
Source code in pyield/tn/ntnc.py
data(date)
Fetch the LTN Anbima indicative rates for the given reference date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date
|
DateScalar
|
The reference date for fetching the data. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: DataFrame with columns "MaturityDate" and "IndicativeRate". |
Examples:
>>> from pyield import ntnc
>>> ntnc.data("21-03-2025")
ReferenceDate BondType MaturityDate IndicativeRate Price
0 2025-03-21 NTN-C 2031-01-01 0.067626 8347.348705
Source code in pyield/tn/ntnc.py
duration(settlement, maturity, rate)
Calculate the Macaulay duration of the NTN-C bond in business years.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settlement
|
DateScalar
|
The settlement date of the operation. |
required |
maturity
|
DateScalar
|
The maturity date of the NTN-C bond. |
required |
rate
|
float
|
The discount rate used to calculate the duration. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The Macaulay duration of the NTN-C bond in business years. |
Examples:
>>> from pyield import ntnc
>>> ntnc.duration("21-03-2025", "01-01-2031", 0.067626)
4.405363320448003
Source code in pyield/tn/ntnc.py
payment_dates(settlement, maturity)
Generate all remaining coupon dates between a given date and the maturity date. The dates are inclusive. The NTN-C bond is determined by its maturity date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settlement
|
DateScalar
|
The settlement date (exlusive) to start generating the coupon dates. |
required |
maturity
|
DateScalar
|
The maturity date. |
required |
Returns:
Type | Description |
---|---|
Series
|
pd.Series: Series of coupon dates within the specified range. |
Examples:
>>> from pyield import ntnc
>>> ntnc.payment_dates("21-03-2025", "01-01-2031")
0 2025-07-01
1 2026-01-01
2 2026-07-01
3 2027-01-01
4 2027-07-01
5 2028-01-01
6 2028-07-01
7 2029-01-01
8 2029-07-01
9 2030-01-01
10 2030-07-01
11 2031-01-01
dtype: datetime64[ns]
Source code in pyield/tn/ntnc.py
price(vna, quotation)
Calculate the NTN-C price using Anbima rules.
price = VNA * quotation / 100
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vna
|
float
|
The nominal value of the NTN-C bond. |
required |
quotation
|
float
|
The NTN-C quotation in base 100. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The NTN-C price truncated to 6 decimal places. |
References
- https://www.anbima.com.br/data/files/A0/02/CC/70/8FEFC8104606BDC8B82BA2A8/Metodologias%20ANBIMA%20de%20Precificacao%20Titulos%20Publicos.pdf
Examples:
Source code in pyield/tn/ntnc.py
quotation(settlement, maturity, rate)
Calculate the NTN-C quotation in base 100 using Anbima rules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settlement
|
DateScalar
|
The settlement date of the operation. |
required |
maturity
|
DateScalar
|
The maturity date of the NTN-C bond. |
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-C. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The NTN-C quotation truncated to 4 decimal places. |
References
- https://www.anbima.com.br/data/files/A0/02/CC/70/8FEFC8104606BDC8B82BA2A8/Metodologias%20ANBIMA%20de%20Precificacao%20Titulos%20Publicos.pdf
- The semi-annual coupon is set to 2.956301, which represents a 6% annual coupon rate compounded semi-annually and rounded to 6 decimal places as per Anbima rules.
Examples: