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

Portfolio bundle fix #2665

Merged
merged 16 commits into from
Sep 29, 2022
Merged

Portfolio bundle fix #2665

merged 16 commits into from
Sep 29, 2022

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Sep 29, 2022

Description

Fixes #2601
Fixes #2599
Fixes #2598
Fixes #2669
Fixes #2602

Fixes portfolio integration tests, portfolio file was not loading.
Fixes portfolio var command from qa_model.py. Percentile was only accepted if between 0 and 1.
Fixes es and omega docstring
Sort es and var output by percentile
Changes boolean arguments to true booleans in portfolio optimization.

Add more coverage to portfolio integration tests:

  • test_portfolio.openbb
  • test_portfolio_boolean_args.openbb

How has this been tested?

api

from openbb_terminal.api import openbb
from openbb_terminal.api import Portfolio

transactions = Portfolio.read_orderbook("...\\OpenBBTerminal\\portfolio\\holdings\\canadian_gold.csv")

P = Portfolio(transactions)
P.generate_portfolio_data()
P.load_benchmark()
P.get_orderbook()

windows = ["mtd", "qtd", "ytd", "all", "3m", "6m", "1y", "3y", "5y", "10y"]

for w in windows:
  openbb.portfolio.rvol(P, window=w, chart=True)
  openbb.portfolio.rsharpe(P, window=w, chart=True)
  openbb.portfolio.rsortino(P, window=w, chart=True)
  openbb.portfolio.rbeta(P, window=w, chart=True)


openbb.portfolio.var(P)
openbb.portfolio.es(P, percentile=80)

terminal

python terminal.py scripts\test_portfolio.openbb
python terminal.py scripts\test_stocks_qa.openbb
python terminal.py  scripts\test_portfolio_boolean_args.openbb


portfolio
load -f canadian_gold.csv
rvol
rsharpe
rsort
rbeta
rvol -p mtd
rsharpe -p qtd
rsort -p ytd
rbeta -p all
var
var -p 80
es
es -p 50


stocks
load AAPL
qa
var
var -p 80
es
es -p 50



portfolio
load --file Public_Equity_Orderbook.xlsx
po
params
file --file OpenBB_Parameters_Template_v1.0.0.xlsx
set ef
arg tangency False
arg log_returns True
exit

@colin99d colin99d added the bug Fix bug label Sep 29, 2022
@montezdesousa montezdesousa marked this pull request as ready for review September 29, 2022 10:43
@montezdesousa montezdesousa changed the title fix rvol Portfolio bundle fix Sep 29, 2022
@hjoaquim hjoaquim requested review from colin99d and removed request for hjoaquim September 29, 2022 15:12
@hjoaquim hjoaquim merged commit e4f5039 into main Sep 29, 2022
@hjoaquim hjoaquim deleted the rolling_fix branch September 29, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment