Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fixed income menu #4071

Merged
merged 54 commits into from
Feb 24, 2023

Conversation

northern-64bit
Copy link
Contributor

@northern-64bit northern-64bit commented Jan 29, 2023

Description

Adding a fixed income menu to the terminal.

Will cover the following:

  • Reference rates (ESTER, SOFR, SONIA, Ameribor)
  • Central Bank Rates (FED and ECB with projections)
  • Government Bond Rates (3 month and 10 year rates for any country, including yield curves for US and Euro)
  • Corporate Bond Rates (ICE BoFa, Moody’s, Spot Rates and Commercial Paper)

Credit Ratings for now not available (because paid). We'll be able to calculate the spreads with the ICE BoFa benchmarks.

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.
  • Make sure affected commands still run in terminal
  • Ensure the SDK still works
  • Check any related reports

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.

@northern-64bit northern-64bit added enhancement Enhancement do not merge Label to prevent pull request merge labels Jan 29, 2023
@northern-64bit northern-64bit self-assigned this Jan 29, 2023
@reviewpad reviewpad bot added the feat XL Extra Large feature label Jan 29, 2023
@northern-64bit northern-64bit changed the title [WIP] Add fixed income menu Add fixed income menu Feb 14, 2023
@northern-64bit northern-64bit marked this pull request as ready for review February 14, 2023 18:27
@northern-64bit northern-64bit removed the do not merge Label to prevent pull request merge label Feb 14, 2023
@JerBouma
Copy link
Contributor

I'm going ham on this PR right now. Will make a bunch of adjustments.

@JerBouma
Copy link
Contributor

I've made some significant changes already. The main point here is that a lot of the functionality is actually the same interest rate but split out in commands. I've made it so they are now all in the same one.

(🦋) /fixedincome/ $ effr -h

usage: effr [-p {monthly,daily,weekly,daily_excl_weekend,annual,biweekly,volume}] [-s START_DATE] [-e END_DATE] [-o] [-q] [-t] [-h] [--export EXPORT]
            [--sheet-name SHEET_NAME [SHEET_NAME ...]] [--raw]

Get Effective Federal Funds Rate data. A bank rate is the interest rate a nation's central bank charges to its domestic banks to borrow money. The rates central banks charge are set
to stabilize the economy. In the United States, the Federal Reserve System's Board of Governors set the bank rate, also known as the discount rate.

optional arguments:
  -p {monthly,daily,weekly,daily_excl_weekend,annual,biweekly,volume}, --parameter {monthly,daily,weekly,daily_excl_weekend,annual,biweekly,volume}
                        Specific Effective Federal Funds Rate data to retrieve (default: monthly)
  -s START_DATE, --start START_DATE
                        Starting date (YYYY-MM-DD) of data (default: 1900-01-01)
  -e END_DATE, --end END_DATE
                        Ending date (YYYY-MM-DD) of data (default: None)
  -o, --overnight       Gets the Overnight Bank Funding Rate (default: False)
  -q, --quantiles       Whether to show 1, 25, 75 and 99 percentiles (default: False)
  -t, --target          Whether to show the target range data (default: False)
  -h, --help            show this help message (default: False)
  --export EXPORT       Export raw data into csv, json, xlsx and figure into png, jpg, pdf, svg (default: )
  --sheet-name SHEET_NAME [SHEET_NAME ...]
                        Name of excel sheet to save data to. Only valid for .xlsx files. (default: None)
  --raw                 Flag to display raw data (default: False)

For more information and examples, use 'about effr' to access the related guide.

And:

(🦋) /fixedincome/ $ projection -h

usage: projection [-l] [-h] [--export EXPORT] [--sheet-name SHEET_NAME [SHEET_NAME ...]] [--raw]

Get FOMC Summary of Economic Projections for the Fed Funds Rate.

optional arguments:
  -l, --long-run        Whether to show the long run projection (default: False)
  -h, --help            show this help message (default: False)
  --export EXPORT       Export raw data into csv, json, xlsx and figure into png, jpg, pdf, svg (default: )
  --sheet-name SHEET_NAME [SHEET_NAME ...]
                        Name of excel sheet to save data to. Only valid for .xlsx files. (default: None)
  --raw                 Flag to display raw data (default: False)

For more information and examples, use 'about projection' to access the related guide.

Just an example, all comes from two commands:

image

@JerBouma
Copy link
Contributor

I still need to go over all other commands and I still need to put everything into context. Why is this relevant to look at, does this allow for a detailed analysis of any kind? If not, what's missing? Etcetera.

@JerBouma
Copy link
Contributor

@northern-64bit Can you look into the implementation of ICE BoFA, Moody's and Spot Rates? Jira tickets for that exist already. These will form the basis for the "Corporate Bonds" section.

Slowly getting there, still lots to do.

image

@jmaslek
Copy link
Collaborator

jmaslek commented Feb 21, 2023

@JerBouma are you going to change the guides/documentation to reflect the changes.

@JerBouma
Copy link
Contributor

@jmaslek I've updated the Fixed Income documentation and docstrings. Should now be clear. Also made sure that within the SDK you can view the options relatively easy. For example:

Help on get_fed in module openbb_terminal.fixedincome.fred_model object:

class get_fed(builtins.object)
 |  get_fed(parameter: str = 'monthly', start_date: Optional[str] = None, end_date: Optional[str] = None, overnight: bool = False, quantiles: bool = False, target: bool = False) -> pandas.core.frame.DataFrame
 |  
 |  Obtain data for Effective Federal Funds Rate.
 |  
 |  Parameters
 |  ----------
 |  parameter: str
 |      The parameter to get data for. Choose from:
 |          "monthly"
 |          "daily"
 |          "weekly"
 |          "daily_excl_weekend"
 |          "annual"
 |          "biweekly"
 |          "volume"
 |  start_date: Optional[str]
 |      Start date, formatted YYYY-MM-DD
 |  end_date: Optional[str]
 |      End date, formatted YYYY-MM-DD
 |  overnight: bool
 |      Whether you want to plot the Overnight Banking Federal Rate
 |  quantiles: bool
 |      Whether you want to see the 1, 25, 75 and 99 percentiles
 |  target: bool
 |      Whether you want to see the high and low target range

And icebofa and icespread can obtain the more elaborate explanations:

image

So.. Ready for Review!

Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legggoooooo

@jmaslek jmaslek added this pull request to the merge queue Feb 24, 2023
Merged via the queue into OpenBB-finance:develop with commit 07aaefe Feb 24, 2023
@northern-64bit northern-64bit deleted the feature/fixed_income branch February 25, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement feat XL Extra Large feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants