-
-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
321 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""ECB Model""" | ||
__docformat__ = "google" | ||
|
||
import pandas as pd | ||
|
||
from financetoolkit.fixedincome.helpers import collect_ecb_data | ||
|
||
|
||
def get_euribor_rate(maturity: str, nominal: bool = True) -> pd.DataFrame: | ||
""" | ||
Get the Main Refinancing Operations from the European Central Bank over | ||
time. The Main Refinancing Operations are the rate at which banks can | ||
borrow money from the central bank for the duration of one week. | ||
Returns: | ||
pd.DataFrame: A DataFrame containing the Main Refinancing Operations over time. | ||
""" | ||
if maturity not in ["1M", "3M", "6M", "1Y"]: | ||
raise ValueError("Invalid maturity. Please choose from 1M, 3M, 6M, 1Y.") | ||
|
||
if nominal: | ||
ecb_data_string = f"M.U2.EUR.RT.MM.EURIBOR{maturity}D_.HSTA" | ||
else: | ||
ecb_data_string = f"M.U2.EUR.4F.MM.R_EURIBOR{maturity}D_.HSTA" | ||
|
||
euribor_rate = collect_ecb_data( | ||
ecb_data_string=ecb_data_string, dataset="FM", frequency="M" | ||
) | ||
|
||
# Convert to percentage | ||
euribor_rate = euribor_rate / 100 | ||
|
||
return euribor_rate |
Oops, something went wrong.