Files
OpenBB/website/content/sdk/reference/portfolio/po/dividend.md
DidierRLopes 4ad995fdd0 Docs/terminalpro and improvement (#5622)
* add first iteration of content for Terminal Pro

* Update index.md

* Update dashboards.md

* Update folders.md

* Update grouping.md

* Update report.md

* Update templates.md

* Update quick-start.md

* Update index.md

* Update index.md

* Update home.md

* Update news.md

* Update index.md

* Update index.md

* Update index.md

* Update data-provider.md

* Update chat-with-widget.md

* Update data-manipulation.md

* Update forecasting.md

* fix: images self closing tags

* fix: only pro visitors can see pro

* inter font

* improve SEO content and restructuring

* add new package for toggle on tutorials

* move folder around

* improve main page of each prod

* small updates and improvements

* fix logo above

* small improvement in headtitle for portfolio funcs

* fix typos from OpenAI's GPT-4

* fix _category_ json

* remove generic SEO words

* add script that generates SEO for documentation

* add missing file

* remove sdk warning message

* fix links for andrew

---------

Co-authored-by: jose-donato <zmcdonato@gmail.com>
Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com>
Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
2023-10-30 21:01:29 +00:00

2.9 KiB
Vendored

title, description, keywords
title description keywords
dividend The 'dividend' feature of the OpenBB library allows optimized weight allocation in portfolio based on dividend yield. The document offers detailed examples and parameters of the implementation.
dividend
portfolio optimization
po model
portfolio engine
weights allocation
AAPL
MSFT
AMZN

import HeadTitle from '@site/src/components/General/HeadTitle.tsx';

Optimize weighted according to dividend yield

Source Code: [link]

openbb.portfolio.po.dividend(symbols: List[str] = None, portfolio_engine: portfolio_optimization.po_engine.PoEngine = None, kwargs: Any)

Parameters

Name Type Description Default Optional
portfolio_engine PoEngine Portfolio optimization engine, by default None
Use portfolio.po.load to load a portfolio engine
None True
symbols List[str] List of symbols, by default None None True
interval str Interval to get data, by default '3y' None True
start_date str If not using interval, start date string (YYYY-MM-DD), by default "" None True
end_date str If not using interval, end date string (YYYY-MM-DD). If empty use last weekday, by default "" None True
log_returns bool If True use log returns, else arithmetic returns, by default False None True
freq str Frequency of returns, by default 'D'. Options: 'D' for daily, 'W' for weekly, 'M' for monthly None True
maxnan float Maximum percentage of NaNs allowed in the data, by default 0.05 None True
threshold float Value used to replace outliers that are higher than threshold, by default 0.0 None True
method str Method used to fill nan values, by default 'time'
For more information see interpolate <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.interpolate.html>__.
None True
value float Amount to allocate to portfolio in long positions, by default 1.0 None True

Returns

Type Description
Tuple[pd.DataFrame, Dict] Tuple with weights and performance dictionary

Examples

from openbb_terminal.sdk import openbb
openbb.portfolio.po.dividend(symbols=["AAPL", "MSFT", "AMZN"])
(         value
 AAPL  0.350575
 MSFT  0.649425
 AMZN  0.000000,
 {'Return': 0.26879215033541076,
  'Volatility': 0.3348681656035649,
  'Sharpe ratio': 0.8026805111526232})
from openbb_terminal.sdk import openbb
p = openbb.portfolio.po.load(symbols_file_path="~/openbb_terminal/miscellaneous/portfolio_examples/allocation/60_40_Portfolio.xlsx")
weights, performance = openbb.portfolio.po.dividend(portfolio_engine=p)