Fixed Income
The Fixed Income module covers a wide variety of calculations including the Effective Yield, Macaulay Duration, Modified Duration, Convexity, Yield to Maturity and derivative pricing models such as Black and Bachelier (used for Swaptions and other instruments).
Every function of the Fixed Income module has its own page with an example and its parameters. Pick one from the sidebar on the left.Every function of the Fixed Income module has its own page with an example and its parameters. Pick one from the .
To install the FinanceToolkit it simply requires the following:
pip install financetoolkit -U
Getting Started
Besides these calculations, the module provides central bank rates and ICE BofA bond indices, such as the ICE BofA US High Yield Index, the ICE BofA US Corporate Index and the ICE BofA US Treasury Index.
The module doesn’t depend on company data, so you can also import it on its own with from financetoolkit import FixedIncome when you don’t need the rest of the Toolkit.
For example:
from financetoolkit import FixedIncome
fixedincome = FixedIncome(
start_date='2024-01-01',
end_date='2024-01-15',
)
fixedincome.get_effective_yield(maturity=False)
Which returns:
| Date | AAA | AA | A | BBB | BB | B | CCC |
|---|---|---|---|---|---|---|---|
| 2024-01-01 | 0.0456 | 0.047 | 0.0505 | 0.054 | 0.0613 | 0.0752 | 0.1319 |
| 2024-01-02 | 0.0459 | 0.0473 | 0.0509 | 0.0543 | 0.0622 | 0.0763 | 0.1333 |
| 2024-01-03 | 0.0459 | 0.0474 | 0.051 | 0.0544 | 0.0634 | 0.0779 | 0.1358 |
| 2024-01-04 | 0.0466 | 0.0481 | 0.0518 | 0.0551 | 0.0639 | 0.0784 | 0.1367 |
| 2024-01-05 | 0.047 | 0.0485 | 0.0521 | 0.0554 | 0.0641 | 0.0787 | 0.137 |
| 2024-01-08 | 0.0465 | 0.0481 | 0.0517 | 0.055 | 0.0633 | 0.0776 | 0.1365 |
| 2024-01-09 | 0.0464 | 0.048 | 0.0516 | 0.0548 | 0.0629 | 0.0771 | 0.1359 |
| 2024-01-10 | 0.0464 | 0.048 | 0.0515 | 0.0547 | 0.0622 | 0.0762 | 0.1351 |
| 2024-01-11 | 0.0456 | 0.0472 | 0.0507 | 0.054 | 0.0619 | 0.076 | 0.1344 |
| 2024-01-12 | 0.0451 | 0.0467 | 0.0502 | 0.0534 | 0.0613 | 0.0753 | 0.1338 |
| 2024-01-15 | 0.0451 | 0.0467 | 0.0501 | 0.0533 | 0.0611 | 0.0751 | 0.1328 |
The sidebar gives access to every metric in the Fixed Income module, each on its own page with a description, an example and its parameters. Pick one there to open it.The sidebar gives access to every metric in the Fixed Income module, each on its own page with a description, an example and its parameters. On a phone, open the to pick one.