diff --git a/docs/generate.py b/docs/generate.py new file mode 100644 index 000000000000..beade6fdb725 --- /dev/null +++ b/docs/generate.py @@ -0,0 +1,92 @@ +from typing import Callable, Any, Optional +from inspect import signature +import importlib +import os + +from openbb_terminal.api import functions + + +def all_functions() -> list[tuple[str, str, Callable[..., Any]]]: + """Uses the base api functions dictionary to get a list of all functions we have linked + in our API. + + Returns + ---------- + func_list: list[Tuple[str, str, Callable[..., Any]]] + A list of functions organized as (path_to_func, view/model, the_function) + """ + func_list = [] + for key, sub_dict in functions.items(): + for sub_key, item_path in sub_dict.items(): + full_path = item_path.split(".") + module_path = ".".join(full_path[:-1]) + module = importlib.import_module(module_path) + target_function = getattr(module, full_path[-1]) + func_list.append((key, sub_key, target_function)) + return func_list + + +def groupby(orig_list: list[Any], index: int) -> dict[Any, Any]: + """Groups a list of iterable by the index provided + + Parameters + ---------- + orig_list: list[Any] + A list of iterables + index: int + The index to groupby + + Returns + ---------- + grouped: dict[Any, Any] + Group information where keys are the groupby item and values are the iterables + """ + grouped: dict[Any, Any] = {} + for item in orig_list: + if item[index] in grouped: + grouped[item[index]].append(item) + else: + grouped[item[index]] = [item] + return grouped + + +def generate_documentation( + base: str, key: str, value: list[tuple[str, str, Callable[..., Any]]] +): + models = list(filter(lambda x: x[1] == "model", value)) + views = list(filter(lambda x: x[1] == "view", value)) + model_type = Optional[tuple[str, str, Callable[..., Any]]] + model: model_type = models[0] if models else None + view: model_type = views[0] if views else None + for end in key.split("."): + base += f"/{end}" + if not os.path.isdir(base): + os.mkdir(base) + with open(f"{base}/_index.md", "w") as f: + f.write(f"# {key}\n\n") + if view: + f.write( + "To obtain charts, make sure to add `chart=True` as the last parameter\n\n" + ) + if model: + f.write(f"## Get underlying data \n###{key}{signature(model[2])}\n\n") + m_docs = str(model[2].__doc__)[:-5] + f.write(f"{m_docs}\n") + if view: + if model: + f.write("\n") + v_docs = str(view[2].__doc__)[:-5] + temp = str(signature(view[2])) + # TODO: This breaks if there is a ')' inside the function arguments + idx = temp.find(")") + new_signature = temp[:idx] + ", chart=True" + temp[idx:] + f.write(f"## Getting charts \n###{key}{new_signature}\n\n") + f.write(f"{v_docs}\n") + + +if __name__ == "__main__": + folder_path = os.path.realpath("./website/content/api") + funcs = all_functions() + grouped_funcs = groupby(funcs, 0) + for k, v in grouped_funcs.items(): + generate_documentation(folder_path, k, v) diff --git a/openbb_terminal/alternative/oss/github_view.py b/openbb_terminal/alternative/oss/github_view.py index 9e811897f473..98860d97a5d6 100644 --- a/openbb_terminal/alternative/oss/github_view.py +++ b/openbb_terminal/alternative/oss/github_view.py @@ -128,7 +128,7 @@ def display_repo_summary(repo: str, export: str = "") -> None: repo : str Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal export : str - Export dataframe data to csv,json,xlsx file + Export dataframe data to csv,json,xlsx file """ data = github_model.get_repo_summary(repo) if not data.empty: diff --git a/openbb_terminal/cryptocurrency/defi/graph_model.py b/openbb_terminal/cryptocurrency/defi/graph_model.py index 86f61156ffdd..cc808178862a 100644 --- a/openbb_terminal/cryptocurrency/defi/graph_model.py +++ b/openbb_terminal/cryptocurrency/defi/graph_model.py @@ -13,6 +13,7 @@ from openbb_terminal.decorators import log_start_end logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation UNI_URL = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" diff --git a/openbb_terminal/cryptocurrency/due_diligence/coinpaprika_model.py b/openbb_terminal/cryptocurrency/due_diligence/coinpaprika_model.py index 2f7ba694e315..242c2654d7d7 100644 --- a/openbb_terminal/cryptocurrency/due_diligence/coinpaprika_model.py +++ b/openbb_terminal/cryptocurrency/due_diligence/coinpaprika_model.py @@ -14,6 +14,7 @@ from openbb_terminal.rich_config import console logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation @log_start_end(log=logger) diff --git a/openbb_terminal/cryptocurrency/due_diligence/glassnode_model.py b/openbb_terminal/cryptocurrency/due_diligence/glassnode_model.py index b20fd1916784..1b15bd5379a8 100644 --- a/openbb_terminal/cryptocurrency/due_diligence/glassnode_model.py +++ b/openbb_terminal/cryptocurrency/due_diligence/glassnode_model.py @@ -10,6 +10,7 @@ from openbb_terminal.rich_config import console logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation api_url = "https://api.glassnode.com/v1/metrics/" diff --git a/openbb_terminal/cryptocurrency/due_diligence/messari_model.py b/openbb_terminal/cryptocurrency/due_diligence/messari_model.py index 5cedf3deaf95..01e72c85ecff 100644 --- a/openbb_terminal/cryptocurrency/due_diligence/messari_model.py +++ b/openbb_terminal/cryptocurrency/due_diligence/messari_model.py @@ -25,6 +25,7 @@ logger = logging.getLogger(__name__) INTERVALS_TIMESERIES = ["5m", "15m", "30m", "1h", "1d", "1w"] +# pylint: disable=unsupported-assignment-operation @log_start_end(log=logger) diff --git a/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py b/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py index e146194d1522..2886d699c438 100644 --- a/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py +++ b/openbb_terminal/cryptocurrency/onchain/ethplorer_view.py @@ -14,6 +14,7 @@ from openbb_terminal.rich_config import console logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation @log_start_end(log=logger) diff --git a/openbb_terminal/cryptocurrency/overview/pycoingecko_model.py b/openbb_terminal/cryptocurrency/overview/pycoingecko_model.py index 2fde69356893..8555d67b612d 100644 --- a/openbb_terminal/cryptocurrency/overview/pycoingecko_model.py +++ b/openbb_terminal/cryptocurrency/overview/pycoingecko_model.py @@ -20,6 +20,7 @@ from openbb_terminal.decorators import log_start_end logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation HOLD_COINS = ["ethereum", "bitcoin"] diff --git a/openbb_terminal/economy/finviz_model.py b/openbb_terminal/economy/finviz_model.py index cb926b46add7..0863f4c59de8 100644 --- a/openbb_terminal/economy/finviz_model.py +++ b/openbb_terminal/economy/finviz_model.py @@ -14,6 +14,7 @@ from openbb_terminal.helper_funcs import get_user_agent logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation GROUPS = { "sector": "Sector", diff --git a/openbb_terminal/forex/polygon_model.py b/openbb_terminal/forex/polygon_model.py index 7b661ea2172b..89849e918bb7 100644 --- a/openbb_terminal/forex/polygon_model.py +++ b/openbb_terminal/forex/polygon_model.py @@ -8,6 +8,8 @@ from openbb_terminal.helper_funcs import get_user_agent from openbb_terminal.rich_config import console +# pylint: disable=unsupported-assignment-operation + def get_historical( fx_pair: str, diff --git a/openbb_terminal/stocks/dark_pool_shorts/stockgrid_model.py b/openbb_terminal/stocks/dark_pool_shorts/stockgrid_model.py index eea2cac74211..14cd4268ae05 100644 --- a/openbb_terminal/stocks/dark_pool_shorts/stockgrid_model.py +++ b/openbb_terminal/stocks/dark_pool_shorts/stockgrid_model.py @@ -11,6 +11,7 @@ from openbb_terminal.decorators import log_start_end logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/options/nasdaq_model.py b/openbb_terminal/stocks/options/nasdaq_model.py index 4a4dfe171651..7a65b1a14abf 100644 --- a/openbb_terminal/stocks/options/nasdaq_model.py +++ b/openbb_terminal/stocks/options/nasdaq_model.py @@ -14,6 +14,7 @@ from openbb_terminal.stocks.options.op_helpers import get_dte_from_expiration as get_dte logger = logging.getLogger(__name__) +# pylint: disable=unsupported-assignment-operation @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/stocks_helper.py b/openbb_terminal/stocks/stocks_helper.py index b21910415172..65e52e53cf9e 100644 --- a/openbb_terminal/stocks/stocks_helper.py +++ b/openbb_terminal/stocks/stocks_helper.py @@ -36,6 +36,7 @@ # pylint: disable=no-member,too-many-branches,C0302,R0913 # pylint: disable=inconsistent-return-statements +# pylint: disable=unsupported-assignment-operation INTERVALS = [1, 5, 15, 30, 60] SOURCES = ["YahooFinance", "AlphaVantage", "IEXCloud", "EODHD"] diff --git a/openbb_terminal/stocks/tradinghours/bursa_model.py b/openbb_terminal/stocks/tradinghours/bursa_model.py index 0f84f7f968b6..48ca6cf2ec50 100644 --- a/openbb_terminal/stocks/tradinghours/bursa_model.py +++ b/openbb_terminal/stocks/tradinghours/bursa_model.py @@ -11,6 +11,7 @@ from openbb_terminal.decorators import log_start_end logger = logging.getLogger(__name__) +# pylint: disable=no-member @log_start_end(log=logger) diff --git a/website/content/api/alt/covid/case_slopes/_index.md b/website/content/api/alt/covid/case_slopes/_index.md new file mode 100644 index 000000000000..e005f37b93ad --- /dev/null +++ b/website/content/api/alt/covid/case_slopes/_index.md @@ -0,0 +1,17 @@ +# alt.covid.case_slopes + +## Get underlying data +###alt.covid.case_slopes(days_back: int = 30, threshold: int = 10000) -> pandas.core.frame.DataFrame + +Load cases and find slope over period + + Parameters + ---------- + days_back: int + Number of historical days to consider + threshold: int + Threshold for total number of cases + Returns + ------- + pd.DataFrame + Dataframe containing slopes diff --git a/website/content/api/alt/covid/global_cases/_index.md b/website/content/api/alt/covid/global_cases/_index.md new file mode 100644 index 000000000000..3502257003f5 --- /dev/null +++ b/website/content/api/alt/covid/global_cases/_index.md @@ -0,0 +1,16 @@ +# alt.covid.global_cases + +## Get underlying data +###alt.covid.global_cases(country: str) -> pandas.core.frame.DataFrame + +Get historical cases for given country + + Parameters + ---------- + country: str + Country to search for + + Returns + ------- + pd.DataFrame + Dataframe of historical cases diff --git a/website/content/api/alt/covid/global_deaths/_index.md b/website/content/api/alt/covid/global_deaths/_index.md new file mode 100644 index 000000000000..850450c715f3 --- /dev/null +++ b/website/content/api/alt/covid/global_deaths/_index.md @@ -0,0 +1,16 @@ +# alt.covid.global_deaths + +## Get underlying data +###alt.covid.global_deaths(country: str) -> pandas.core.frame.DataFrame + +Get historical deaths for given country + + Parameters + ---------- + country: str + Country to search for + + Returns + ------- + pd.DataFrame + Dataframe of historical deaths diff --git a/website/content/api/alt/covid/ov/_index.md b/website/content/api/alt/covid/ov/_index.md new file mode 100644 index 000000000000..d4cccdb155b8 --- /dev/null +++ b/website/content/api/alt/covid/ov/_index.md @@ -0,0 +1,33 @@ +# alt.covid.ov + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.covid.ov(country, limit: int = 100) -> pandas.core.frame.DataFrame + +Get historical cases and deaths by country + + Parameters + ---------- + country: str + Country to get data for + limit: int + Number of raw data to show + +## Getting charts +###alt.covid.ov(country, raw: bool = False, limit: int = 10, export: str = '', plot: bool = True, chart=True) -> None + +Show historical cases and deaths by country + + Parameters + ---------- + country: str + Country to get data for + raw: bool + Flag to display raw data + limit: int + Number of raw data to show + export: str + Format to export data + plot: bool + Flag to display historical plot diff --git a/website/content/api/alt/covid/slopes/_index.md b/website/content/api/alt/covid/slopes/_index.md new file mode 100644 index 000000000000..e055d36cce33 --- /dev/null +++ b/website/content/api/alt/covid/slopes/_index.md @@ -0,0 +1,41 @@ +# alt.covid.slopes + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.covid.slopes(days_back: int = 30, limit: int = 50, threshold: int = 10000, ascend: bool = False) -> pandas.core.frame.DataFrame + +Load cases and find slope over period + + Parameters + ---------- + days_back: int + Number of historical days to consider + limit: int + Number of rows to show + threshold: int + Threshold for total number of cases + ascend: bool + Flag to sort in ascending order + Returns + ------- + pd.DataFrame + Dataframe containing slopes + +## Getting charts +###alt.covid.slopes(days_back: int = 30, limit: int = 10, threshold: int = 10000, ascend: bool = False, export: str = '', chart=True) -> None + + + + Parameters + ---------- + days_back: int + Number of historical days to get slope for + limit: int + Number to show in table + ascend: bool + Flag to sort in ascending order + threshold: int + Threshold for total cases over period + export : str + Format to export data diff --git a/website/content/api/alt/covid/stat/_index.md b/website/content/api/alt/covid/stat/_index.md new file mode 100644 index 000000000000..449557fcdc03 --- /dev/null +++ b/website/content/api/alt/covid/stat/_index.md @@ -0,0 +1,37 @@ +# alt.covid.stat + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.covid.stat(country, stat: str = 'cases', limit: int = 10) -> pandas.core.frame.DataFrame + +Show historical cases and deaths by country + + Parameters + ---------- + country: str + Country to get data for + stat: str + Statistic to get. Either "cases", "deaths" or "rates" + limit: int + Number of raw data to show + +## Getting charts +###alt.covid.stat(country, stat: str = 'cases', raw: bool = False, limit: int = 10, export: str = '', plot: bool = True, chart=True) -> None + +Show historical cases and deaths by country + + Parameters + ---------- + country: str + Country to get data for + stat: str + Statistic to get. Either "cases", "deaths" or "rates" + raw: bool + Flag to display raw data + limit: int + Number of raw data to show + export: str + Format to export data + plot : bool + Flag to plot data diff --git a/website/content/api/alt/oss/_make_request/_index.md b/website/content/api/alt/oss/_make_request/_index.md new file mode 100644 index 000000000000..49d746fbaff1 --- /dev/null +++ b/website/content/api/alt/oss/_make_request/_index.md @@ -0,0 +1,15 @@ +# alt.oss._make_request + +## Get underlying data +###alt.oss._make_request(url: str) -> Optional[bs4.BeautifulSoup] + +Helper method to scrap + + Parameters + ---------- + url : str + url to scrape + + Returns + ------- + BeautifulSoup object diff --git a/website/content/api/alt/oss/_retry_session/_index.md b/website/content/api/alt/oss/_retry_session/_index.md new file mode 100644 index 000000000000..dc1ba1e00e1e --- /dev/null +++ b/website/content/api/alt/oss/_retry_session/_index.md @@ -0,0 +1,21 @@ +# alt.oss._retry_session + +## Get underlying data +###alt.oss._retry_session(url: str, retries: int = 3, backoff_factor: float = 1.0) -> requests.sessions.Session + +Helper methods that retries to make request + + + Parameters + ---------- + url: str + Url to mount a session + retries: int + How many retries + backoff_factor: float + Backoff schema - time periods between retry + + Returns + ------- + requests.Session + Mounted session diff --git a/website/content/api/alt/oss/github_data/_index.md b/website/content/api/alt/oss/github_data/_index.md new file mode 100644 index 000000000000..865c4e5ad60e --- /dev/null +++ b/website/content/api/alt/oss/github_data/_index.md @@ -0,0 +1,16 @@ +# alt.oss.github_data + +## Get underlying data +###alt.oss.github_data(url: str, **kwargs) + +Get repository stats + + Parameters + ---------- + url: str + github api endpoint + params: dict + params to pass to api endpoint + Returns + ------- + dict with data diff --git a/website/content/api/alt/oss/history/_index.md b/website/content/api/alt/oss/history/_index.md new file mode 100644 index 000000000000..ef10670982d2 --- /dev/null +++ b/website/content/api/alt/oss/history/_index.md @@ -0,0 +1,31 @@ +# alt.oss.history + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.history(repo: str) + +Get repository star history + + Parameters + ---------- + repo : str + Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal + + Returns + ------- + pd.DataFrame - Columns: Date, Stars + +## Getting charts +###alt.oss.history(repo: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display repo summary [Source: https://api.github.com] + + Parameters + ---------- + repo : str + Repository to display star history. Format: org/repo, e.g., openbb-finance/openbbterminal + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/alt/oss/repo_summary/_index.md b/website/content/api/alt/oss/repo_summary/_index.md new file mode 100644 index 000000000000..a743ff1446bc --- /dev/null +++ b/website/content/api/alt/oss/repo_summary/_index.md @@ -0,0 +1,29 @@ +# alt.oss.repo_summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.repo_summary(repo: str) + +Get repository summary + + Parameters + ---------- + repo : str + Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal + + Returns + ------- + pd.DataFrame - Columns: Metric, Value + +## Getting charts +###alt.oss.repo_summary(repo: str, export: str = '', chart=True) -> None + +Display repo summary [Source: https://api.github.com] + + Parameters + ---------- + repo : str + Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/alt/oss/ross/_index.md b/website/content/api/alt/oss/ross/_index.md new file mode 100644 index 000000000000..f8ed47ee93d7 --- /dev/null +++ b/website/content/api/alt/oss/ross/_index.md @@ -0,0 +1,40 @@ +# alt.oss.ross + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.ross() -> pandas.core.frame.DataFrame + +Get startups from ROSS index [Source: https://runacap.com/] + + Parameters + ---------- + + Returns + ------- + pandas.DataFrame: + list of startups + +## Getting charts +###alt.oss.ross(limit: int = 10, sortby: str = 'Stars AGR [%]', descend: bool = False, show_chart: bool = False, show_growth: bool = True, chart_type: str = 'stars', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display list of startups from ross index [Source: https://runacap.com/] + + Parameters + ---------- + limit: int + Number of startups to search + sortby: str + Key by which to sort data. Default: Stars AGR [%] + descend: bool + Flag to sort data descending + show_chart: bool + Flag to show chart with startups + show_growth: bool + Flag to show growth line chart + chart_type: str + Chart type {stars,forks} + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/alt/oss/search/_index.md b/website/content/api/alt/oss/search/_index.md new file mode 100644 index 000000000000..871f08522751 --- /dev/null +++ b/website/content/api/alt/oss/search/_index.md @@ -0,0 +1,18 @@ +# alt.oss.search + +## Get underlying data +###alt.oss.search(sortby: str = 'stars', page: int = 1, categories: str = '') -> pandas.core.frame.DataFrame + +Get repos sorted by stars or forks. Can be filtered by categories + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + page : int + Page number to get repos + Returns + ------- + pd.DataFrame with list of repos diff --git a/website/content/api/alt/oss/search_repos/_index.md b/website/content/api/alt/oss/search_repos/_index.md new file mode 100644 index 000000000000..80ba1c3d0ba5 --- /dev/null +++ b/website/content/api/alt/oss/search_repos/_index.md @@ -0,0 +1,18 @@ +# alt.oss.search_repos + +## Get underlying data +###alt.oss.search_repos(sortby: str = 'stars', page: int = 1, categories: str = '') -> pandas.core.frame.DataFrame + +Get repos sorted by stars or forks. Can be filtered by categories + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + page : int + Page number to get repos + Returns + ------- + pd.DataFrame with list of repos diff --git a/website/content/api/alt/oss/stars_history/_index.md b/website/content/api/alt/oss/stars_history/_index.md new file mode 100644 index 000000000000..b5373f22e731 --- /dev/null +++ b/website/content/api/alt/oss/stars_history/_index.md @@ -0,0 +1,15 @@ +# alt.oss.stars_history + +## Get underlying data +###alt.oss.stars_history(repo: str) + +Get repository star history + + Parameters + ---------- + repo : str + Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal + + Returns + ------- + pd.DataFrame - Columns: Date, Stars diff --git a/website/content/api/alt/oss/summary/_index.md b/website/content/api/alt/oss/summary/_index.md new file mode 100644 index 000000000000..e0ff6207f7d8 --- /dev/null +++ b/website/content/api/alt/oss/summary/_index.md @@ -0,0 +1,29 @@ +# alt.oss.summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.summary(repo: str) -> pandas.core.frame.DataFrame + +Get repository summary + + Parameters + ---------- + repo : str + Repo to search for Format: org/repo, e.g., openbb-finance/openbbterminal + + Returns + ------- + pd.DataFrame - Columns: Metric, Value + +## Getting charts +###alt.oss.summary(repo: str, export: str = '', chart=True) -> None + +Display repo summary [Source: https://api.github.com] + + Parameters + ---------- + repo : str + Repository to display summary. Format: org/repo, e.g., openbb-finance/openbbterminal + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/alt/oss/top/_index.md b/website/content/api/alt/oss/top/_index.md new file mode 100644 index 000000000000..88089de43e52 --- /dev/null +++ b/website/content/api/alt/oss/top/_index.md @@ -0,0 +1,38 @@ +# alt.oss.top + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.top(sortby: str, limit: int = 50, categories: str = '') -> pandas.core.frame.DataFrame + +Get repos sorted by stars or forks. Can be filtered by categories + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + limit : int + Number of repos to search for + Returns + ------- + pd.DataFrame with list of repos + +## Getting charts +###alt.oss.top(sortby: str, categories: str = '', limit: int = 10, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display repo summary [Source: https://api.github.com] + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + limit : int + Number of repos to look at + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/alt/oss/top_repos/_index.md b/website/content/api/alt/oss/top_repos/_index.md new file mode 100644 index 000000000000..08a7ea700664 --- /dev/null +++ b/website/content/api/alt/oss/top_repos/_index.md @@ -0,0 +1,38 @@ +# alt.oss.top_repos + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###alt.oss.top_repos(sortby: str, top: int, categories: str) -> pandas.core.frame.DataFrame + +Get repos sorted by stars or forks. Can be filtered by categories + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + top : int + Number of repos to search for + Returns + ------- + pd.DataFrame with list of repos + +## Getting charts +###alt.oss.top_repos(sortby: str, categories: str, limit: int, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display repo summary [Source: https://api.github.com] + + Parameters + ---------- + sortby : str + Sort repos by {stars, forks} + categories : str + Check for repo categories. If more than one separate with a comma: e.g., finance,investment. Default: None + limit : int + Number of repos to look at + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/behavioural_analysis/sentiment/_index.md b/website/content/api/common/behavioural_analysis/sentiment/_index.md new file mode 100644 index 000000000000..66a9c9f3685a --- /dev/null +++ b/website/content/api/common/behavioural_analysis/sentiment/_index.md @@ -0,0 +1,38 @@ +# common.behavioural_analysis.sentiment + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.behavioural_analysis.sentiment(post_data: List[str]) -> float + +Find the sentiment of a post and related comments + + Parameters + ---------- + post_data: List[str] + A post and its comments in string form + + Returns + ------- + float + A number in the range [-1, 1] representing sentiment + +## Getting charts +###common.behavioural_analysis.sentiment(symbol: str, n_tweets: int = 15, n_days_past: int = 2, compare: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot sentiments from symbol + + Parameters + ---------- + symbol: str + Stock ticker symbol to get sentiment for + n_tweets: int + Number of tweets to get per hour + n_days_past: int + Number of days to extract tweets for + compare: bool + Show corresponding change in stock price + export: str + Format to export tweet dataframe + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/behavioural_analysis/sentiment_stats/_index.md b/website/content/api/common/behavioural_analysis/sentiment_stats/_index.md new file mode 100644 index 000000000000..690efbc0e296 --- /dev/null +++ b/website/content/api/common/behavioural_analysis/sentiment_stats/_index.md @@ -0,0 +1,32 @@ +# common.behavioural_analysis.sentiment_stats + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.behavioural_analysis.sentiment_stats(ticker: str) -> Dict + +Get sentiment stats [Source: finnhub] + + Parameters + ---------- + ticker : str + Ticker to get sentiment stats + + Returns + ------- + Dict + Get sentiment stats + +## Getting charts +###common.behavioural_analysis.sentiment_stats(ticker: str, export: str = '', chart=True) + + + Sentiment stats which displays buzz, news score, articles last week, articles weekly average, + bullish vs bearish percentages, sector average bullish percentage, and sector average news score + + Parameters + ---------- + ticker : str + Ticker to get sentiment stats + export : str + Format to export data diff --git a/website/content/api/common/news/_index.md b/website/content/api/common/news/_index.md new file mode 100644 index 000000000000..836f25d175c1 --- /dev/null +++ b/website/content/api/common/news/_index.md @@ -0,0 +1,36 @@ +# common.news + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.news(term: str = '', sources: str = 'bloomberg.com') -> pandas.core.frame.DataFrame + +Get news for a given term and source. [Source: Feedparser] + + Parameters + ---------- + term : str + term to search on the news articles + sources: str + sources to exclusively show news from + + Returns + ---------- + articles : dict + term to search on the news articles + +## Getting charts +###common.news(term: str, sources: str = '', limit: int = 5, export: str = '', chart=True) + +Display news for a given term and source. [Source: Feedparser] + + Parameters + ---------- + term : str + term to search on the news articles + sources : str + sources to exclusively show news from + limit : int + number of articles to display + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/common/qa/bw/_index.md b/website/content/api/common/qa/bw/_index.md new file mode 100644 index 000000000000..e9c5ac056399 --- /dev/null +++ b/website/content/api/common/qa/bw/_index.md @@ -0,0 +1,39 @@ +# common.qa.bw + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.bw(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', yearly: bool = True, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) -> None + +Show box and whisker plots + + Parameters + ---------- + symbol : str + Name of dataset + data : pd.DataFrame + Dataframe to look at + target : str + Data column to look at + yearly : bool + Flag to indicate yearly accumulation + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + +## Getting charts +###common.qa.bw(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', yearly: bool = True, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Show box and whisker plots + + Parameters + ---------- + symbol : str + Name of dataset + data : pd.DataFrame + Dataframe to look at + target : str + Data column to look at + yearly : bool + Flag to indicate yearly accumulation + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/qa/calculate_adjusted_var/_index.md b/website/content/api/common/qa/calculate_adjusted_var/_index.md new file mode 100644 index 000000000000..0135cc530a12 --- /dev/null +++ b/website/content/api/common/qa/calculate_adjusted_var/_index.md @@ -0,0 +1,24 @@ +# common.qa.calculate_adjusted_var + +## Get underlying data +###common.qa.calculate_adjusted_var(kurtosis: float, skew: float, ndp: float, std: float, mean: float) -> float + +Calculates VaR, which is adjusted for skew and kurtosis (Cornish-Fischer-Expansion) + + Parameters + ---------- + kurtosis: float + kurtosis of data + skew: float + skew of data + ndp: float + normal distribution percentage number (99% -> -2.326) + std: float + standard deviation of data + mean: float + mean of data + + Returns + ------- + float + Real adjusted VaR diff --git a/website/content/api/common/qa/decompose/_index.md b/website/content/api/common/qa/decompose/_index.md new file mode 100644 index 000000000000..a6281eeecb08 --- /dev/null +++ b/website/content/api/common/qa/decompose/_index.md @@ -0,0 +1,22 @@ +# common.qa.decompose + +## Get underlying data +###common.qa.decompose(data: pandas.core.frame.DataFrame, multiplicative: bool = False) -> Tuple[Any, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Perform seasonal decomposition + + Parameters + ---------- + data : pd.DataFrame + Dataframe of targeted data + multiplicative : bool + Boolean to indicate multiplication instead of addition + + Returns + ------- + result: Any + Result of statsmodels seasonal_decompose + cycle: pd.DataFrame + Filtered cycle + trend: pd.DataFrame + Filtered Trend diff --git a/website/content/api/common/qa/es/_index.md b/website/content/api/common/qa/es/_index.md new file mode 100644 index 000000000000..f538adbe1374 --- /dev/null +++ b/website/content/api/common/qa/es/_index.md @@ -0,0 +1,48 @@ +# common.qa.es + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.es(data: pandas.core.frame.DataFrame, use_mean: bool = False, distribution: str = 'normal', percentile: Union[float, int] = 0.999, portfolio: bool = False) -> pandas.core.frame.DataFrame + +Gets Expected Shortfall for specified stock dataframe + + Parameters + ---------- + data: pd.DataFrame + Data dataframe + use_mean: bool + If one should use the data mean for calculation + distribution: str + Type of distribution, options: laplace, student_t, normal + percentile: Union[float,int] + VaR percentile + portfolio: bool + If the data is a portfolio + + Returns + ------- + list + list of ES + list + list of historical ES + +## Getting charts +###common.qa.es(data: pandas.core.frame.DataFrame, symbol: str = '', use_mean: bool = False, distribution: str = 'normal', percentile: float = 0.999, portfolio: bool = False, chart=True) -> None + +Displays expected shortfall + + Parameters + ---------- + data: pd.DataFrame + Data dataframe + use_mean: + if one should use the data mean return + symbol: str + name of the data + distribution: str + choose distribution to use: logistic, laplace, normal + percentile: int + es percentile + portfolio: bool + If the data is a portfolio diff --git a/website/content/api/common/qa/kurtosis/_index.md b/website/content/api/common/qa/kurtosis/_index.md new file mode 100644 index 000000000000..528a924ce89a --- /dev/null +++ b/website/content/api/common/qa/kurtosis/_index.md @@ -0,0 +1,40 @@ +# common.qa.kurtosis + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.kurtosis(data: pandas.core.frame.DataFrame, window: int = 14) -> pandas.core.frame.DataFrame + +Kurtosis Indicator + + Parameters + ---------- + data: pd.DataFrame + Dataframe of targeted data + window: int + Length of window + + Returns + ------- + df_kurt : pd.DataFrame + Dataframe of rolling kurtosis + +## Getting charts +###common.qa.kurtosis(symbol: str, data: pandas.core.frame.DataFrame, target: str, window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +View rolling kurtosis + + Parameters + ---------- + symbol: str + Ticker + data: pd.DataFrame + Dataframe of stock prices + target: str + Column in data to look at + window: int + Length of window + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/qa/normality/_index.md b/website/content/api/common/qa/normality/_index.md new file mode 100644 index 000000000000..1fae16589f54 --- /dev/null +++ b/website/content/api/common/qa/normality/_index.md @@ -0,0 +1,35 @@ +# common.qa.normality + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.normality(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame + + + Look at the distribution of returns and generate statistics on the relation to the normal curve. + This function calculates skew and kurtosis (the third and fourth moments) and performs both + a Jarque-Bera and Shapiro Wilk test to determine if data is normally distributed. + + Parameters + ---------- + data : pd.DataFrame + Dataframe of targeted data + + Returns + ------- + pd.DataFrame + Dataframe containing statistics of normality + +## Getting charts +###common.qa.normality(data: pandas.core.frame.DataFrame, target: str, export: str = '', chart=True) -> None + +View normality statistics + + Parameters + ---------- + data : pd.DataFrame + DataFrame + target : str + Column in data to look at + export : str + Format to export data diff --git a/website/content/api/common/qa/omega/_index.md b/website/content/api/common/qa/omega/_index.md new file mode 100644 index 000000000000..5d62bad66761 --- /dev/null +++ b/website/content/api/common/qa/omega/_index.md @@ -0,0 +1,29 @@ +# common.qa.omega + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.omega(data: pandas.core.frame.DataFrame, threshold_start: float = 0, threshold_end: float = 1.5) -> pandas.core.frame.DataFrame + +Get the omega series + Parameters + ---------- + data: pd.DataFrame + stock dataframe + threshold_start: float + annualized target return threshold start of plotted threshold range + threshold_end: float + annualized target return threshold end of plotted threshold range + +## Getting charts +###common.qa.omega(data: pandas.core.frame.DataFrame, threshold_start: float = 0, threshold_end: float = 1.5, chart=True) -> None + +Displays the omega ratio + Parameters + ---------- + data: pd.DataFrame + stock dataframe + threshold_start: float + annualized target return threshold start of plotted threshold range + threshold_end: float + annualized target return threshold end of plotted threshold range diff --git a/website/content/api/common/qa/quantile/_index.md b/website/content/api/common/qa/quantile/_index.md new file mode 100644 index 000000000000..9077adc3e835 --- /dev/null +++ b/website/content/api/common/qa/quantile/_index.md @@ -0,0 +1,46 @@ +# common.qa.quantile + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.quantile(data: pandas.core.frame.DataFrame, window: int = 14, quantile_pct: float = 0.5) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Overlay Median & Quantile + + Parameters + ---------- + data: pd.DataFrame + Dataframe of targeted data + window : int + Length of window + quantile_pct: float + Quantile to display + + Returns + ------- + df_med : pd.DataFrame + Dataframe of median prices over window + df_quantile : pd.DataFrame + Dataframe of gievn quantile prices over window + +## Getting charts +###common.qa.quantile(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, quantile: float = 0.5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +View rolling quantile + + Parameters + ---------- + data: pd.DataFrame + Dataframe + target: str + Column in data to look at + symbol : str + Stock ticker + window : int + Length of window + quantile: float + Quantile to get + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/qa/rolling/_index.md b/website/content/api/common/qa/rolling/_index.md new file mode 100644 index 000000000000..ddac7a84f5d3 --- /dev/null +++ b/website/content/api/common/qa/rolling/_index.md @@ -0,0 +1,42 @@ +# common.qa.rolling + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.rolling(data: pandas.core.frame.DataFrame, window: int = 14) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Return rolling mean and standard deviation + + Parameters + ---------- + data: pd.DataFrame + Dataframe of target data + window: int + Length of rolling window + + Returns + ------- + pd.DataFrame: + Dataframe of rolling mean + pd.DataFrame: + Dataframe of rolling standard deviation + +## Getting charts +###common.qa.rolling(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +View mean std deviation + + Parameters + ---------- + data: pd.DataFrame + Dataframe + target: str + Column in data to look at + symbol : str + Stock ticker + window : int + Length of window + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/qa/sharpe/_index.md b/website/content/api/common/qa/sharpe/_index.md new file mode 100644 index 000000000000..a95c36b14200 --- /dev/null +++ b/website/content/api/common/qa/sharpe/_index.md @@ -0,0 +1,34 @@ +# common.qa.sharpe + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.sharpe(data: pandas.core.frame.DataFrame, rfr: float = 0, window: float = 252) -> pandas.core.frame.DataFrame + +Calculates the sharpe ratio + Parameters + ---------- + data: pd.DataFrame + selected dataframe column + rfr: float + risk free rate + window: float + length of the rolling window + + Returns + ------- + sharpe: pd.DataFrame + sharpe ratio + +## Getting charts +###common.qa.sharpe(data: pandas.core.frame.DataFrame, rfr: float = 0, window: float = 252, chart=True) -> None + +Calculates the sharpe ratio + Parameters + ---------- + data: pd.DataFrame + selected dataframe column + rfr: float + risk free rate + window: float + length of the rolling window diff --git a/website/content/api/common/qa/skew/_index.md b/website/content/api/common/qa/skew/_index.md new file mode 100644 index 000000000000..c24d980d8bb8 --- /dev/null +++ b/website/content/api/common/qa/skew/_index.md @@ -0,0 +1,40 @@ +# common.qa.skew + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.skew(data: pandas.core.frame.DataFrame, window: int = 14) -> pandas.core.frame.DataFrame + +Skewness Indicator + + Parameters + ---------- + data: pd.DataFrame + Dataframe of targeted data + window : int + Length of window + + Returns + ------- + data_skew : pd.DataFrame + Dataframe of rolling skew + +## Getting charts +###common.qa.skew(symbol: str, data: pandas.core.frame.DataFrame, target: str, window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +View rolling skew + + Parameters + ---------- + symbol: str + Stock ticker + data: pd.DataFrame + Dataframe + target: str + Column in data to look at + window: int + Length of window + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/qa/sortino/_index.md b/website/content/api/common/qa/sortino/_index.md new file mode 100644 index 000000000000..388f8d65f4c2 --- /dev/null +++ b/website/content/api/common/qa/sortino/_index.md @@ -0,0 +1,38 @@ +# common.qa.sortino + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.sortino(data: pandas.core.frame.DataFrame, target_return: float = 0, window: float = 252, adjusted: bool = False) -> pandas.core.frame.DataFrame + +Calculates the sortino ratio + Parameters + ---------- + data: pd.DataFrame + selected dataframe + target_return: float + target return of the asset + window: float + length of the rolling window + adjusted: bool + adjust the sortino ratio + + Returns + ------- + sortino: pd.DataFrame + sortino ratio + +## Getting charts +###common.qa.sortino(data: pandas.core.frame.DataFrame, target_return: float, window: float, adjusted: bool, chart=True) -> None + +Displays the sortino ratio + Parameters + ---------- + data: pd.DataFrame + selected dataframe + target_return: float + target return of the asset + window: float + length of the rolling window + adjusted: bool + adjust the sortino ratio diff --git a/website/content/api/common/qa/spread/_index.md b/website/content/api/common/qa/spread/_index.md new file mode 100644 index 000000000000..4d4e8fa4c7a6 --- /dev/null +++ b/website/content/api/common/qa/spread/_index.md @@ -0,0 +1,44 @@ +# common.qa.spread + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.spread(data: pandas.core.frame.DataFrame, window: int = 14) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Standard Deviation and Variance + + Parameters + ---------- + data: pd.DataFrame + DataFrame of targeted data + window: int + Length of window + + Returns + ------- + df_sd: pd.DataFrame + Dataframe of rolling standard deviation + df_var: pd.DataFrame + Dataframe of rolling standard deviation + +## Getting charts +###common.qa.spread(data: pandas.core.frame.DataFrame, target: str, symbol: str = '', window: int = 14, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +View rolling spread + + Parameters + ---------- + data: pd.DataFrame + Dataframe + target: str + Column in data to look at + target: str + Column in data to look at + symbol : str + Stock ticker + window : int + Length of window + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/qa/summary/_index.md b/website/content/api/common/qa/summary/_index.md new file mode 100644 index 000000000000..e2391bedc5c5 --- /dev/null +++ b/website/content/api/common/qa/summary/_index.md @@ -0,0 +1,30 @@ +# common.qa.summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.summary(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame + +Print summary statistics + + Parameters + ---------- + data : pd.DataFrame + Dataframe to get summary statistics for + + Returns + ------- + summary : pd.DataFrame + Summary statistics + +## Getting charts +###common.qa.summary(data: pandas.core.frame.DataFrame, export: str = '', chart=True) -> None + +Show summary statistics + + Parameters + ---------- + data : pd.DataFrame + DataFrame to get statistics of + export : str + Format to export data diff --git a/website/content/api/common/qa/unitroot/_index.md b/website/content/api/common/qa/unitroot/_index.md new file mode 100644 index 000000000000..fa8dd5ae3e69 --- /dev/null +++ b/website/content/api/common/qa/unitroot/_index.md @@ -0,0 +1,40 @@ +# common.qa.unitroot + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.unitroot(data: pandas.core.frame.DataFrame, fuller_reg: str = 'c', kpss_reg: str = 'c') -> pandas.core.frame.DataFrame + +Calculate test statistics for unit roots + + Parameters + ---------- + data : pd.DataFrame + DataFrame of target variable + fuller_reg : str + Type of regression of ADF test. Can be ‘c’,’ct’,’ctt’,’nc’ 'c' - Constant and t - trend order + kpss_reg : str + Type of regression for KPSS test. Can be ‘c’,’ct' + + Returns + ------- + pd.DataFrame + Dataframe with results of ADF test and KPSS test + +## Getting charts +###common.qa.unitroot(data: pandas.core.frame.DataFrame, target: str, fuller_reg: str = 'c', kpss_reg: str = 'c', export: str = '', chart=True) + +Show unit root test calculations + + Parameters + ---------- + data : pd.DataFrame + DataFrame + target : str + Column of data to look at + fuller_reg : str + Type of regression of ADF test. Can be ‘c’,’ct’,’ctt’,’nc’ 'c' - Constant and t - trend order + kpss_reg : str + Type of regression for KPSS test. Can be ‘c’,’ct' + export : str + Format for exporting data diff --git a/website/content/api/common/qa/var/_index.md b/website/content/api/common/qa/var/_index.md new file mode 100644 index 000000000000..4387a99d69f6 --- /dev/null +++ b/website/content/api/common/qa/var/_index.md @@ -0,0 +1,54 @@ +# common.qa.var + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.qa.var(data: pandas.core.frame.DataFrame, use_mean: bool = False, adjusted_var: bool = False, student_t: bool = False, percentile: Union[int, float] = 0.999, portfolio: bool = False) -> pandas.core.frame.DataFrame + +Gets value at risk for specified stock dataframe + + Parameters + ---------- + data: pd.DataFrame + Data dataframe + use_mean: bool + If one should use the data mean for calculation + adjusted_var: bool + If one should return VaR adjusted for skew and kurtosis + student_t: bool + If one should use the student-t distribution + percentile: Union[int,float] + VaR percentile + portfolio: bool + If the data is a portfolio + + Returns + ------- + list + list of VaR + list + list of historical VaR + +## Getting charts +###common.qa.var(data: pandas.core.frame.DataFrame, symbol: str = '', use_mean: bool = False, adjusted_var: bool = False, student_t: bool = False, percentile: float = 0.999, data_range: int = 0, portfolio: bool = False, chart=True) -> None + +Displays VaR of dataframe + + Parameters + ---------- + data: pd.Dataframe + Data dataframe + use_mean: bool + if one should use the data mean return + symbol: str + name of the data + adjusted_var: bool + if one should have VaR adjusted for skew and kurtosis (Cornish-Fisher-Expansion) + student_t: bool + If one should use the student-t distribution + percentile: int + var percentile + data_range: int + Number of rows you want to use VaR over + portfolio: bool + If the data is a portfolio diff --git a/website/content/api/common/ta/ad/_index.md b/website/content/api/common/ta/ad/_index.md new file mode 100644 index 000000000000..e9b951313f59 --- /dev/null +++ b/website/content/api/common/ta/ad/_index.md @@ -0,0 +1,38 @@ +# common.ta.ad + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.ad(data: pandas.core.frame.DataFrame, use_open: bool = False) -> pandas.core.frame.DataFrame + +Calculate AD technical indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of prices with OHLC and Volume + use_open : bool + Whether to use open prices + + Returns + ------- + pd.DataFrame + Dataframe with technical indicator + +## Getting charts +###common.ta.ad(data: pandas.core.frame.DataFrame, use_open: bool = False, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot AD technical indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of ohlc prices + use_open : bool + Whether to use open prices in calculation + symbol : str + Ticker symbol + export: str + Format to export data as + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/adosc/_index.md b/website/content/api/common/ta/adosc/_index.md new file mode 100644 index 000000000000..5cfb350c2f38 --- /dev/null +++ b/website/content/api/common/ta/adosc/_index.md @@ -0,0 +1,46 @@ +# common.ta.adosc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.adosc(data: pandas.core.frame.DataFrame, use_open: bool = False, fast: int = 3, slow: int = 10) -> pandas.core.frame.DataFrame + +Calculate AD oscillator technical indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of OHLC prices + use_open : bool + Whether to use open prices + fast: int + Fast value + slow: int + Slow value + + Returns + ------- + pd.DataFrame + Dataframe with technical indicator + +## Getting charts +###common.ta.adosc(data: pandas.core.frame.DataFrame, fast: int = 3, slow: int = 10, use_open: bool = False, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display AD Osc Indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of ohlc prices + use_open : bool + Whether to use open prices in calculation + fast: int + Length of fast window + slow : int + Length of slow window + symbol : str + Stock ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/adx/_index.md b/website/content/api/common/ta/adx/_index.md new file mode 100644 index 000000000000..fea254ef90a2 --- /dev/null +++ b/website/content/api/common/ta/adx/_index.md @@ -0,0 +1,50 @@ +# common.ta.adx + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.adx(high_values: pandas.core.series.Series, low_values: pandas.core.series.Series, close_values: pandas.core.series.Series, window: int = 14, scalar: int = 100, drift: int = 1) + +ADX technical indicator + + Parameters + ---------- + high_values: pd.Series + High prices + low_values: pd.Series + Low prices + close_values: pd.Series + close prices + window: int + Length of window + scalar: int + Scalar variable + drift: int + Drift variable + + Returns + ------- + pd.DataFrame + DataFrame with adx indicator + +## Getting charts +###common.ta.adx(data: pandas.core.frame.DataFrame, window: int = 14, scalar: int = 100, drift: int = 1, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot ADX indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe with OHLC price data + window : int + Length of window + scalar : int + Scalar variable + drift : int + Drift variable + symbol : str + Ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/aroon/_index.md b/website/content/api/common/ta/aroon/_index.md new file mode 100644 index 000000000000..710c422a74bc --- /dev/null +++ b/website/content/api/common/ta/aroon/_index.md @@ -0,0 +1,44 @@ +# common.ta.aroon + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.aroon(high_values: pandas.core.series.Series, low_values: pandas.core.series.Series, window: int = 25, scalar: int = 100) -> pandas.core.frame.DataFrame + +Aroon technical indicator + + Parameters + ---------- + high_values: pd.Series + High prices + low_values: pd.Series + Low prices + window : int + Length of window + scalar : int + Scalar variable + + Returns + ------- + pd.DataFrame + DataFrame with aroon indicator + +## Getting charts +###common.ta.aroon(data: pandas.core.frame.DataFrame, window: int = 25, scalar: int = 100, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot Aroon indicator + + Parameters + ---------- + data: pd.DataFrame + Dataframe with OHLC price data + window: int + Length of window + symbol: str + Ticker + scalar: int + Scalar variable + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/bbands/_index.md b/website/content/api/common/ta/bbands/_index.md new file mode 100644 index 000000000000..04db48522d30 --- /dev/null +++ b/website/content/api/common/ta/bbands/_index.md @@ -0,0 +1,46 @@ +# common.ta.bbands + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.bbands(close_values: pandas.core.series.Series, window: int = 15, n_std: float = 2, mamode: str = 'ema') -> pandas.core.frame.DataFrame + +Calculate Bollinger Bands + + Parameters + ---------- + close_values : pd.DataFrame + DataFrame of sclose prices + window : int + Length of window to calculate BB + n_std : float + Number of standard deviations to show + mamode : str + Method of calculating average + + Returns + ------- + df_ta: pd.DataFrame + Dataframe of bollinger band data + +## Getting charts +###common.ta.bbands(data: pandas.core.frame.DataFrame, symbol: str = '', window: int = 15, n_std: float = 2, mamode: str = 'sma', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Show bollinger bands + + Parameters + ---------- + data : pd.DataFrame + Dataframe of ohlc prices + symbol : str + Ticker symbol + window : int + Length of window to calculate BB + n_std : float + Number of standard deviations to show + mamode : str + Method of calculating average + export : str + Format of export file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/ta/cci/_index.md b/website/content/api/common/ta/cci/_index.md new file mode 100644 index 000000000000..a63d7e919695 --- /dev/null +++ b/website/content/api/common/ta/cci/_index.md @@ -0,0 +1,47 @@ +# common.ta.cci + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.cci(data: pandas.core.frame.DataFrame, window: int = 14, scalar: float = 0.0015) -> pandas.core.frame.DataFrame + +Commodity channel index + + Parameters + ---------- + high_vals: pd.Series + High values + low_values: pd.Series + Low values + close-values: pd.Series + Close values + window: int + Length of window + scalar: float + Scalar variable + + Returns + ---------- + pd.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.cci(data: pandas.core.frame.DataFrame, window: int = 14, scalar: float = 0.0015, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display CCI Indicator + + Parameters + ---------- + + data : pd.DataFrame + Dataframe of OHLC + window : int + Length of window + scalar : float + Scalar variable + symbol : str + Stock ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/cg/_index.md b/website/content/api/common/ta/cg/_index.md new file mode 100644 index 000000000000..319758f5fbc1 --- /dev/null +++ b/website/content/api/common/ta/cg/_index.md @@ -0,0 +1,37 @@ +# common.ta.cg + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.cg(values: pandas.core.series.Series, window: int) -> pandas.core.frame.DataFrame + +Center of gravity + + Parameters + ---------- + values: pd.DataFrame + Data to use with close being titled values + window: int + Length for indicator window + Returns + ---------- + d.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.cg(data: pandas.core.series.Series, window: int = 14, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display center of gravity Indicator + + Parameters + ---------- + data : pd.Series + Series of values + window : int + Length of window + symbol : str + Stock ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/donchian/_index.md b/website/content/api/common/ta/donchian/_index.md new file mode 100644 index 000000000000..60cc8f1db38e --- /dev/null +++ b/website/content/api/common/ta/donchian/_index.md @@ -0,0 +1,44 @@ +# common.ta.donchian + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.donchian(high_prices: pandas.core.series.Series, low_prices: pandas.core.series.Series, upper_length: int = 20, lower_length: int = 20) -> pandas.core.frame.DataFrame + +Calculate Donchian Channels + + Parameters + ---------- + high_prices : pd.DataFrame + High prices + low_prices : pd.DataFrame + Low prices + upper_length : int + Length of window to calculate upper channel + lower_length : int + Length of window to calculate lower channel + + Returns + ------- + pd.DataFrame + Dataframe of upper and lower channels + +## Getting charts +###common.ta.donchian(data: pandas.core.frame.DataFrame, symbol: str = '', upper_length: int = 20, lower_length: int = 20, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Show donchian channels + + Parameters + ---------- + data : pd.DataFrame + Dataframe of ohlc prices + symbol : str + Ticker symbol + upper_length : int + Length of window to calculate upper channel + lower_length : int + Length of window to calculate lower channel + export : str + Format of export file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/ta/ema/_index.md b/website/content/api/common/ta/ema/_index.md new file mode 100644 index 000000000000..b1fad7d3e71d --- /dev/null +++ b/website/content/api/common/ta/ema/_index.md @@ -0,0 +1,20 @@ +# common.ta.ema + +## Get underlying data +###common.ta.ema(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets exponential moving average (EMA) for stock + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + length: int + Length of EMA window + offset: int + Length of offset + + Returns + ---------- + pd.DataFrame + Dataframe containing prices and EMA diff --git a/website/content/api/common/ta/fib/_index.md b/website/content/api/common/ta/fib/_index.md new file mode 100644 index 000000000000..d0b4f83e2287 --- /dev/null +++ b/website/content/api/common/ta/fib/_index.md @@ -0,0 +1,54 @@ +# common.ta.fib + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.fib(data: pandas.core.frame.DataFrame, limit: int = 120, start_date: Any = None, end_date: Any = None) -> Tuple[pandas.core.frame.DataFrame, pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp, float, float] + +Calculate Fibonacci levels + + Parameters + ---------- + data : pd.DataFrame + Dataframe of prices + limit : int + Days to look back for retracement + start_date : Any + Custom start date for retracement + end_date : Any + Custom end date for retracement + + Returns + ------- + df : pd.DataFrame + Dataframe of fib levels + min_date: pd.Timestamp + Date of min point + max_date: pd.Timestamp: + Date of max point + min_pr: float + Price at min point + max_pr: float + Price at max point + +## Getting charts +###common.ta.fib(data: pandas.core.frame.DataFrame, limit: int = 120, start_date: Optional[str] = None, end_date: Optional[str] = None, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Calculate fibonacci retracement levels + + Parameters + ---------- + data: pd.DataFrame + OHLC data + limit: int + Days to lookback + start_date: Optional[str, None] + User picked date for starting retracement + end_date: Optional[str, None] + User picked date for ending retracement + symbol: str + Ticker symbol + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/fisher/_index.md b/website/content/api/common/ta/fisher/_index.md new file mode 100644 index 000000000000..25b4b2248bf0 --- /dev/null +++ b/website/content/api/common/ta/fisher/_index.md @@ -0,0 +1,39 @@ +# common.ta.fisher + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.fisher(high_vals: pandas.core.series.Series, low_vals: pandas.core.series.Series, window: int = 14) -> pandas.core.frame.DataFrame + +Fisher Transform + + Parameters + ---------- + high_vals: pd.Series + High values + low_vals: pd.Series + Low values + window: int + Length for indicator window + Returns + ---------- + df_ta: pd.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.fisher(data: pandas.core.frame.DataFrame, window: int = 14, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display Fisher Indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of OHLC prices + window : int + Length of window + symbol : str + Ticker string + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/hma/_index.md b/website/content/api/common/ta/hma/_index.md new file mode 100644 index 000000000000..239c6d7b1482 --- /dev/null +++ b/website/content/api/common/ta/hma/_index.md @@ -0,0 +1,20 @@ +# common.ta.hma + +## Get underlying data +###common.ta.hma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets hull moving average (HMA) for stock + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + length: int + Length of SMA window + offset: int + Length of offset + + Returns + ---------- + df_ta: pd.DataFrame + Dataframe containing prices and HMA diff --git a/website/content/api/common/ta/kc/_index.md b/website/content/api/common/ta/kc/_index.md new file mode 100644 index 000000000000..3648a40fa95c --- /dev/null +++ b/website/content/api/common/ta/kc/_index.md @@ -0,0 +1,55 @@ +# common.ta.kc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.kc(high_prices: pandas.core.series.Series, low_prices: pandas.core.series.Series, close_prices: pandas.core.series.Series, window: int = 20, scalar: float = 2, mamode: str = 'ema', offset: int = 0) -> pandas.core.frame.DataFrame + +Keltner Channels + + Parameters + ---------- + high_prices : pd.DataFrame + High prices + low_prices : pd.DataFrame + Low prices + close_prices : pd.DataFrame + Close prices + window : int + Length of window + scalar: float + Scalar value + mamode: str + Type of filter + offset : int + Offset value + + Returns + ------- + df_en : pd.DataFrame + Dataframe of rolling kc + +## Getting charts +###common.ta.kc(data: pandas.core.frame.DataFrame, window: int = 20, scalar: float = 2, mamode: str = 'ema', offset: int = 0, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +View Keltner Channels Indicator + + Parameters + ---------- + + data: pd.DataFrame + Dataframe of ohlc prices + window: int + Length of window + scalar: float + Scalar value + mamode: str + Type of filter + offset: int + Offset value + symbol: str + Ticker symbol + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/ma/_index.md b/website/content/api/common/ta/ma/_index.md new file mode 100644 index 000000000000..46dfa56cdc05 --- /dev/null +++ b/website/content/api/common/ta/ma/_index.md @@ -0,0 +1,47 @@ +# common.ta.ma + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.ma(data: pandas.core.series.Series, window: List[int] = None, offset: int = 0, ma_type: str = 'EMA', symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) -> None + +Plots MA technical indicator + + Parameters + ---------- + data: pd.Series + Series of prices + window: List[int] + Length of EMA window + offset: int + Offset variable + ma_type: str + Type of moving average. Either "EMA" "ZLMA" or "SMA" + symbol: str + Ticker + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + +## Getting charts +###common.ta.ma(data: pandas.core.series.Series, window: List[int] = None, offset: int = 0, ma_type: str = 'EMA', symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Plots MA technical indicator + + Parameters + ---------- + data: pd.Series + Series of prices + window: List[int] + Length of EMA window + offset: int + Offset variable + ma_type: str + Type of moving average. Either "EMA" "ZLMA" or "SMA" + symbol: str + Ticker + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/ta/macd/_index.md b/website/content/api/common/ta/macd/_index.md new file mode 100644 index 000000000000..64c5e1c98d61 --- /dev/null +++ b/website/content/api/common/ta/macd/_index.md @@ -0,0 +1,45 @@ +# common.ta.macd + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.macd(values: pandas.core.frame.DataFrame, n_fast: int = 12, n_slow: int = 26, n_signal: int = 9) -> pandas.core.frame.DataFrame + +Moving average convergence divergence + + Parameters + ---------- + values: pd.Series + Values for calculation + n_fast : int + Fast period + n_slow : int + Slow period + n_signal : int + Signal period + Returns + ---------- + pd.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.macd(data: pandas.core.series.Series, n_fast: int = 12, n_slow: int = 26, n_signal: int = 9, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot MACD signal + + Parameters + ---------- + data : pd.Series + Values to input + n_fast : int + Fast period + n_slow : int + Slow period + n_signal : int + Signal period + symbol : str + Stock ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/obv/_index.md b/website/content/api/common/ta/obv/_index.md new file mode 100644 index 000000000000..7cbb6de2142d --- /dev/null +++ b/website/content/api/common/ta/obv/_index.md @@ -0,0 +1,34 @@ +# common.ta.obv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.obv(data: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame + +On Balance Volume + + Parameters + ---------- + data: pd.DataFrame + Dataframe of OHLC prices + + Returns + ------- + pd.DataFrame + Dataframe with technical indicator + +## Getting charts +###common.ta.obv(data: pandas.core.frame.DataFrame, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot OBV technical indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of ohlc prices + symbol : str + Ticker + export: str + Format to export data as + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/common/ta/rsi/_index.md b/website/content/api/common/ta/rsi/_index.md new file mode 100644 index 000000000000..d524f9a0c499 --- /dev/null +++ b/website/content/api/common/ta/rsi/_index.md @@ -0,0 +1,46 @@ +# common.ta.rsi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.rsi(values: pandas.core.series.Series, window: int = 14, scalar: float = 100, drift: int = 1) -> pandas.core.frame.DataFrame + +Relative strength index + + Parameters + ---------- + values: pd.Series + Dataframe of prices + window: int + Length of window + scalar: float + Scalar variable + drift: int + Drift variable + + Returns + ---------- + pd.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.rsi(data: pandas.core.series.Series, window: int = 14, scalar: float = 100.0, drift: int = 1, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display RSI Indicator + + Parameters + ---------- + data : pd.Series + Values to input + window : int + Length of window + scalar : float + Scalar variable + drift : int + Drift variable + symbol : str + Stock ticker + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/sma/_index.md b/website/content/api/common/ta/sma/_index.md new file mode 100644 index 000000000000..06f0096558fc --- /dev/null +++ b/website/content/api/common/ta/sma/_index.md @@ -0,0 +1,20 @@ +# common.ta.sma + +## Get underlying data +###common.ta.sma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets simple moving average (EMA) for stock + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + length: int + Length of SMA window + offset: int + Length of offset + + Returns + ---------- + pd.DataFrame + Dataframe containing prices and SMA diff --git a/website/content/api/common/ta/stoch/_index.md b/website/content/api/common/ta/stoch/_index.md new file mode 100644 index 000000000000..ffe4010181bf --- /dev/null +++ b/website/content/api/common/ta/stoch/_index.md @@ -0,0 +1,49 @@ +# common.ta.stoch + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.stoch(high_vals: pandas.core.series.Series, low_vals: pandas.core.series.Series, close_vals: pandas.core.series.Series, fastkperiod: int = 14, slowdperiod: int = 3, slowkperiod: int = 3) + +Stochastic oscillator + + Parameters + ---------- + high_vals: pd.Series + High values + low_vals: pd.Series + Low values + close-vals: pd.Series + Close values + fastkperiod : int + Fast k period + slowdperiod : int + Slow d period + slowkperiod : int + Slow k period + Returns + ---------- + pd.DataFrame + Dataframe of technical indicator + +## Getting charts +###common.ta.stoch(data: pandas.core.frame.DataFrame, fastkperiod: int = 14, slowdperiod: int = 3, slowkperiod: int = 3, symbol: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Plot stochastic oscillator signal + + Parameters + ---------- + data : pd.DataFrame + Dataframe of OHLC prices + fastkperiod : int + Fast k period + slowdperiod : int + Slow d period + slowkperiod : int + Slow k period + symbol : str + Stock ticker symbol + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/vwap/_index.md b/website/content/api/common/ta/vwap/_index.md new file mode 100644 index 000000000000..d7055e44b001 --- /dev/null +++ b/website/content/api/common/ta/vwap/_index.md @@ -0,0 +1,43 @@ +# common.ta.vwap + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###common.ta.vwap(data: pandas.core.frame.DataFrame, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets volume weighted average price (VWAP) + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + offset: int + Length of offset + Returns + ---------- + df_vwap: pd.DataFrame + Dataframe with VWAP data + +## Getting charts +###common.ta.vwap(data: pandas.core.frame.DataFrame, symbol: str = '', start_date: str = None, end_date: str = None, offset: int = 0, interval: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plots VWMA technical indicator + + Parameters + ---------- + data : pd.DataFrame + Dataframe of OHLC prices + symbol : str + Ticker + offset : int + Offset variable + start_date: datetime + Start date to get data from with + end_date: datetime + End date to get data from with + interval : str + Interval of data + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/common/ta/wma/_index.md b/website/content/api/common/ta/wma/_index.md new file mode 100644 index 000000000000..23e277318eec --- /dev/null +++ b/website/content/api/common/ta/wma/_index.md @@ -0,0 +1,20 @@ +# common.ta.wma + +## Get underlying data +###common.ta.wma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets weighted moving average (WMA) for stock + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + length: int + Length of SMA window + offset: int + Length of offset + + Returns + ---------- + df_ta: pd.DataFrame + Dataframe containing prices and WMA diff --git a/website/content/api/common/ta/zlma/_index.md b/website/content/api/common/ta/zlma/_index.md new file mode 100644 index 000000000000..116a632d47c9 --- /dev/null +++ b/website/content/api/common/ta/zlma/_index.md @@ -0,0 +1,20 @@ +# common.ta.zlma + +## Get underlying data +###common.ta.zlma(data: pandas.core.frame.DataFrame, length: int = 50, offset: int = 0) -> pandas.core.frame.DataFrame + +Gets zero-lagged exponential moving average (ZLEMA) for stock + + Parameters + ---------- + data: pd.DataFrame + Dataframe of dates and prices + length: int + Length of EMA window + offset: int + Length of offset + + Returns + ---------- + df_ta: pd.DataFrame + Dataframe containing prices and EMA diff --git a/website/content/api/crypto/candles/_index.md b/website/content/api/crypto/candles/_index.md new file mode 100644 index 000000000000..a095adc2e634 --- /dev/null +++ b/website/content/api/crypto/candles/_index.md @@ -0,0 +1,19 @@ +# crypto.candles + +## Get underlying data +###crypto.candles(candles_df: 'pd.DataFrame', volume: 'bool' = True, ylabel: 'str' = '', title: 'str' = '', external_axes: 'list[plt.Axes] | None' = None) -> 'None' + +Plot candle chart from dataframe. [Source: Binance] + + Parameters + ---------- + candles_df: pd.DataFrame + Dataframe containing time and OHLCV + volume: bool + If volume data shall be plotted, by default True + ylabel: str + Y-label of the graph, by default "" + title: str + Title of graph, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/chart/_index.md b/website/content/api/crypto/chart/_index.md new file mode 100644 index 000000000000..9fad5b9fee19 --- /dev/null +++ b/website/content/api/crypto/chart/_index.md @@ -0,0 +1,31 @@ +# crypto.chart + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.chart(prices_df: 'pd.DataFrame', symbol: 'str' = '', currency: 'str' = '', source: 'str' = '', exchange: 'str' = '', interval: 'str' = '', external_axes: 'list[plt.Axes] | None' = None) -> 'None' + +Load data for Technical Analysis + + Parameters + ---------- + prices_df: pd.DataFrame + Cryptocurrency + symbol: str + Coin (only used for chart title), by default "" + currency: str + Currency (only used for chart title), by default "" + +## Getting charts +###crypto.chart(prices_df: 'pd.DataFrame', symbol: 'str' = '', currency: 'str' = '', source: 'str' = '', exchange: 'str' = '', interval: 'str' = '', external_axes: 'list[plt.Axes] | None' = None, chart=True) -> 'None' + +Load data for Technical Analysis + + Parameters + ---------- + prices_df: pd.DataFrame + Cryptocurrency + symbol: str + Coin (only used for chart title), by default "" + currency: str + Currency (only used for chart title), by default "" diff --git a/website/content/api/crypto/dd/active/_index.md b/website/content/api/crypto/dd/active/_index.md new file mode 100644 index 000000000000..70a9b151a4bc --- /dev/null +++ b/website/content/api/crypto/dd/active/_index.md @@ -0,0 +1,46 @@ +# crypto.dd.active + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.active(symbol: str, interval: str = '24h', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame + +Returns active addresses of a certain symbol + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Asset to search active addresses (e.g., BTC) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + interval : str + Interval frequency (e.g., 24h) + + Returns + ------- + pd.DataFrame + active addresses over time + +## Getting charts +###crypto.dd.active(symbol: str, start_date: int = 1577836800, end_date: int = 1609459200, interval: str = '24h', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display active addresses of a certain symbol over time + [Source: https://glassnode.org] + + Parameters + ---------- + symbol : str + Asset to search active addresses (e.g., BTC) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + interval : str + Interval frequency (possible values are: 24h, 1w, 1month) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/all_binance_trading_pairs/_index.md b/website/content/api/crypto/dd/all_binance_trading_pairs/_index.md new file mode 100644 index 000000000000..5db8fe410d84 --- /dev/null +++ b/website/content/api/crypto/dd/all_binance_trading_pairs/_index.md @@ -0,0 +1,16 @@ +# crypto.dd.all_binance_trading_pairs + +## Get underlying data +###crypto.dd.all_binance_trading_pairs() -> pandas.core.frame.DataFrame + +Returns all available pairs on Binance in DataFrame format. DataFrame has 3 columns symbol, baseAsset, quoteAsset + example row: ETHBTC | ETH | BTC + [Source: Binance] + + + Returns + ------- + pd.DataFrame + All available pairs on Binance + Columns: symbol, baseAsset, quoteAsset + diff --git a/website/content/api/crypto/dd/balance/_index.md b/website/content/api/crypto/dd/balance/_index.md new file mode 100644 index 000000000000..9b2df0beef5d --- /dev/null +++ b/website/content/api/crypto/dd/balance/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.balance + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.balance(from_symbol: str, to_symbol: str = 'USDT') -> pandas.core.frame.DataFrame + +Get account holdings for asset. [Source: Binance] + + Parameters + ---------- + from_symbol: str + Cryptocurrency + to_symbol: str + Cryptocurrency + + Returns + ------- + pd.DataFrame + Dataframe with account holdings for an asset + +## Getting charts +###crypto.dd.balance(from_symbol: str, to_symbol: str = 'USDT', export: str = '', chart=True) -> None + +Get account holdings for asset. [Source: Binance] + + Parameters + ---------- + from_symbol: str + Cryptocurrency + to_symbol: str + Cryptocurrency + export: str + Export dataframe data to csv,json,xlsx diff --git a/website/content/api/crypto/dd/basic/_index.md b/website/content/api/crypto/dd/basic/_index.md new file mode 100644 index 000000000000..c565f9001b14 --- /dev/null +++ b/website/content/api/crypto/dd/basic/_index.md @@ -0,0 +1,32 @@ +# crypto.dd.basic + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.basic(symbol: str = 'btc-bitcoin') -> pandas.core.frame.DataFrame + +Basic coin information [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Coin id + + Returns + ------- + pd.DataFrame + Metric, Value + +## Getting charts +###crypto.dd.basic(symbol: str = 'BTC', export: str = '', chart=True) -> None + +Get basic information for coin. Like: + name, symbol, rank, type, description, platform, proof_type, contract, tags, parent. + [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Cryptocurrency symbol (e.g. BTC) + export: str + Export dataframe data to csv,json,xlsx diff --git a/website/content/api/crypto/dd/binance_available_quotes_for_each_coin/_index.md b/website/content/api/crypto/dd/binance_available_quotes_for_each_coin/_index.md new file mode 100644 index 000000000000..8c066a172eab --- /dev/null +++ b/website/content/api/crypto/dd/binance_available_quotes_for_each_coin/_index.md @@ -0,0 +1,13 @@ +# crypto.dd.binance_available_quotes_for_each_coin + +## Get underlying data +###crypto.dd.binance_available_quotes_for_each_coin() -> dict + +Helper methods that for every coin available on Binance add all quote assets. [Source: Binance] + + Returns + ------- + dict: + All quote assets for given coin + {'ETH' : ['BTC', 'USDT' ...], 'UNI' : ['ETH', 'BTC','BUSD', ...] + diff --git a/website/content/api/crypto/dd/book/_index.md b/website/content/api/crypto/dd/book/_index.md new file mode 100644 index 000000000000..7787e755eb8c --- /dev/null +++ b/website/content/api/crypto/dd/book/_index.md @@ -0,0 +1,43 @@ +# crypto.dd.book + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.book(from_symbol: str, limit: int = 100, to_symbol: str = 'USDT') -> pandas.core.frame.DataFrame + +Get order book for currency. [Source: Binance] + + Parameters + ---------- + + from_symbol: str + Cryptocurrency symbol + limit: int + Limit parameter. Adjusts the weight + to_symbol: str + Quote currency (what to view coin vs) + + Returns + ------- + + pd.DataFrame + Dataframe containing orderbook + +## Getting charts +###crypto.dd.book(from_symbol: str, limit: int = 100, to_symbol: str = 'USDT', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Get order book for currency. [Source: Binance] + + Parameters + ---------- + + from_symbol: str + Cryptocurrency symbol + limit: int + Limit parameter. Adjusts the weight + to_symbol: str + Quote currency (what to view coin vs) + export: str + Export dataframe data to csv,json,xlsx + external_axes : Optional[List[plt.Axes]] + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/btcrb/_index.md b/website/content/api/crypto/dd/btcrb/_index.md new file mode 100644 index 000000000000..ca8bc1284c5c --- /dev/null +++ b/website/content/api/crypto/dd/btcrb/_index.md @@ -0,0 +1,43 @@ +# crypto.dd.btcrb + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.btcrb(symbol: str, start_date: int = 1262304000, end_date: int = 1663694553, print_errors: bool = True) -> pandas.core.frame.DataFrame + +Returns the price of a cryptocurrency + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Crypto to check close price (BTC or ETH) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_641_227_783_561) + print_errors: bool + Flag to print errors. Default: True + + Returns + ------- + pd.DataFrame + price over time + +## Getting charts +###crypto.dd.btcrb(start_date: int = 1262304000, end_date: int = 1663694553, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Displays bitcoin rainbow chart + [Price data from source: https://glassnode.com] + [Inspired by: https://blockchaincenter.net] + + Parameters + ---------- + start_date : int + Initial date timestamp. Default is initial BTC timestamp: 1_325_376_000 + end_date : int + Final date timestamp. Default is current BTC timestamp + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/candles/_index.md b/website/content/api/crypto/dd/candles/_index.md new file mode 100644 index 000000000000..7d823b4d8a26 --- /dev/null +++ b/website/content/api/crypto/dd/candles/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.candles + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.candles(symbol: str, interval: str = '24h') -> pandas.core.frame.DataFrame + +Get candles for chosen trading pair and time interval. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + interval: str + Time interval. One from 1min, 5min ,15min, 1hour, 6hour, 24hour + + Returns + ------- + pd.DataFrame + Candles for chosen trading pair. + +## Getting charts +###crypto.dd.candles(symbol: str, interval: str = '24h', export: str = '', chart=True) -> None + +Get candles for chosen trading pair and time interval. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + interval: str + Time interval. One from 1m, 5m ,15m, 1h, 6h, 24h + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/cbbook/_index.md b/website/content/api/crypto/dd/cbbook/_index.md new file mode 100644 index 000000000000..2ae713201e59 --- /dev/null +++ b/website/content/api/crypto/dd/cbbook/_index.md @@ -0,0 +1,35 @@ +# crypto.dd.cbbook + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.cbbook(symbol: str) -> Tuple[numpy.ndarray, numpy.ndarray, str, dict] + +Get orders book for chosen trading pair. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + + Returns + ------- + Tuple[np.array, np.array, str, dict] + array with bid prices, order sizes and cumulative order sizes + array with ask prices, order sizes and cumulative order sizes + trading pair + dict with raw data + +## Getting charts +###crypto.dd.cbbook(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays a list of available currency pairs for trading. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/change/_index.md b/website/content/api/crypto/dd/change/_index.md new file mode 100644 index 000000000000..22c73f63ee34 --- /dev/null +++ b/website/content/api/crypto/dd/change/_index.md @@ -0,0 +1,48 @@ +# crypto.dd.change + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.change(symbol: str, exchange: str = 'binance', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame + +Returns 30d change of the supply held in exchange wallets of a certain symbol. + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Asset symbol to search supply (e.g., BTC) + exchange : str + Exchange to check net position change (e.g., binance) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + + Returns + ------- + pd.DataFrame + supply change in exchange wallets of a certain symbol over time + +## Getting charts +###crypto.dd.change(symbol: str, exchange: str = 'binance', start_date: int = 1577836800, end_date: int = 1609459200, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display 30d change of the supply held in exchange wallets. + [Source: https://glassnode.org] + + Parameters + ---------- + symbol : str + Asset to search active addresses (e.g., BTC) + exchange : str + Exchange to check net position change (possible values are: aggregated, binance, + bittrex, coinex, gate.io, gemini, huobi, kucoin, poloniex, bibox, bigone, bitfinex, + hitbtc, kraken, okex, bithumb, zb.com, cobinhood, bitmex, bitstamp, coinbase, coincheck, luno) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/check_valid_binance_str/_index.md b/website/content/api/crypto/dd/check_valid_binance_str/_index.md new file mode 100644 index 000000000000..fcf6ca35d75f --- /dev/null +++ b/website/content/api/crypto/dd/check_valid_binance_str/_index.md @@ -0,0 +1,6 @@ +# crypto.dd.check_valid_binance_str + +## Get underlying data +###crypto.dd.check_valid_binance_str(symbol: str) -> str + +Check if symbol is in defined binance. [Source: Bin diff --git a/website/content/api/crypto/dd/coin/_index.md b/website/content/api/crypto/dd/coin/_index.md new file mode 100644 index 000000000000..cdb781a06114 --- /dev/null +++ b/website/content/api/crypto/dd/coin/_index.md @@ -0,0 +1,15 @@ +# crypto.dd.coin + +## Get underlying data +###crypto.dd.coin(symbol: str = 'eth-ethereum') -> dict + +Get coin by id [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + id of coin from coinpaprika e.g. Ethereum - > 'eth-ethereum' + Returns + ------- + dict + Coin response diff --git a/website/content/api/crypto/dd/coin_market_chart/_index.md b/website/content/api/crypto/dd/coin_market_chart/_index.md new file mode 100644 index 000000000000..8632a7d41d8f --- /dev/null +++ b/website/content/api/crypto/dd/coin_market_chart/_index.md @@ -0,0 +1,20 @@ +# crypto.dd.coin_market_chart + +## Get underlying data +###crypto.dd.coin_market_chart(symbol: str = '', vs_currency: str = 'usd', days: int = 30, **kwargs: Any) -> pandas.core.frame.DataFrame + +Get prices for given coin. [Source: CoinGecko] + + Parameters + ---------- + vs_currency: str + currency vs which display data + days: int + number of days to display the data + kwargs + + Returns + ------- + pandas.DataFrame + Prices for given coin + Columns: time, price, currency diff --git a/website/content/api/crypto/dd/eb/_index.md b/website/content/api/crypto/dd/eb/_index.md new file mode 100644 index 000000000000..3c0b57829f37 --- /dev/null +++ b/website/content/api/crypto/dd/eb/_index.md @@ -0,0 +1,50 @@ +# crypto.dd.eb + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.eb(symbol: str, exchange: str = 'binance', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame + +Returns the total amount of coins held on exchange addresses in units and percentage. + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Asset to search active addresses (e.g., BTC) + exchange : str + Exchange to check net position change (e.g., binance) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + + Returns + ------- + pd.DataFrame + total amount of coins in units/percentage and symbol price over time + +## Getting charts +###crypto.dd.eb(symbol: str, exchange: str = 'binance', start_date: int = 1577836800, end_date: int = 1609459200, percentage: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display total amount of coins held on exchange addresses in units and percentage. + [Source: https://glassnode.org] + + Parameters + ---------- + symbol : str + Asset to search active addresses (e.g., BTC) + exchange : str + Exchange to check net position change (possible values are: aggregated, binance, bittrex, + coinex, gate.io, gemini, huobi, kucoin, poloniex, bibox, bigone, bitfinex, hitbtc, kraken, + okex, bithumb, zb.com, cobinhood, bitmex, bitstamp, coinbase, coincheck, luno) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + percentage : bool + Show percentage instead of stacked value. + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/crypto/dd/events/_index.md b/website/content/api/crypto/dd/events/_index.md new file mode 100644 index 000000000000..4691f2618e2b --- /dev/null +++ b/website/content/api/crypto/dd/events/_index.md @@ -0,0 +1,62 @@ +# crypto.dd.events + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.events(symbol: str = 'eth-ethereum', sortby='date', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get all events related to given coin like conferences, start date of futures trading etc. + [Source: CoinPaprika] + + Example of response from API: + + .. code-block:: json + + { + "id": "17398-cme-april-first-trade", + "date": "2018-04-02T00:00:00Z", + "date_to": "string", + "name": "CME: April First Trade", + "description": "First trade of Bitcoin futures contract for April 2018.", + "is_conference": false, + "link": "http://www.cmegroup.com/trading/equity-index/us-index/bitcoin_product_calendar_futures.html", + "proof_image_link": "https://static.coinpaprika.com/storage/cdn/event_images/16635.jpg" + } + + Parameters + ---------- + symbol: str + id of coin from coinpaprika e.g. Ethereum - > 'eth-ethereum' + sortby: str + Key by which to sort data. Every column name is valid + (see for possible values: + https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1events/get). + ascend: bool + Flag to sort data ascending + Returns + ------- + pandas.DataFrame + Events found for given coin + Columns: id, date , date_to, name, description, is_conference, link, proof_image_link + +## Getting charts +###crypto.dd.events(symbol: str = 'BTC', limit: int = 10, sortby: str = 'date', ascend: bool = False, links: bool = False, export: str = '', chart=True) -> None + +Get all events for given coin id. [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Cryptocurrency symbol (e.g. BTC) + limit: int + Number of records to display + sortby: str + Key by which to sort data. Every column name is valid + (see for possible values: + https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1events/get). + ascend: bool + Flag to sort data ascending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/ex/_index.md b/website/content/api/crypto/dd/ex/_index.md new file mode 100644 index 000000000000..f44f8458d4f2 --- /dev/null +++ b/website/content/api/crypto/dd/ex/_index.md @@ -0,0 +1,43 @@ +# crypto.dd.ex + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.ex(symbol: str = 'eth-ethereum', sortby: str = 'adjusted_volume_24h_share', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get all exchanges for given coin id. [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Identifier of Coin from CoinPaprika + sortby: str + Key by which to sort data. Every column name is valid (see for possible values: + https://api.coinpaprika.com/v1). + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + All exchanges for given coin + Columns: id, name, adjusted_volume_24h_share, fiats + +## Getting charts +###crypto.dd.ex(symbol: str = 'btc', limit: int = 10, sortby: str = 'adjusted_volume_24h_share', ascend: bool = True, export: str = '', chart=True) -> None + +Get all exchanges for given coin id. [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Cryptocurrency symbol (e.g. BTC) + limit: int + Number of records to display + sortby: str + Key by which to sort data. Every column name is valid (see for possible values: + https://api.coinpaprika.com/v1). + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/exchanges/_index.md b/website/content/api/crypto/dd/exchanges/_index.md new file mode 100644 index 000000000000..207aeb43b367 --- /dev/null +++ b/website/content/api/crypto/dd/exchanges/_index.md @@ -0,0 +1,15 @@ +# crypto.dd.exchanges + +## Get underlying data +###crypto.dd.exchanges() + +Helper method to get all the exchanges supported by ccxt + [Source: https://docs.ccxt.com/en/latest/manual.html] + + Parameters + ---------- + + Returns + ------- + List[str] + list of all the exchanges supported by ccxt diff --git a/website/content/api/crypto/dd/fr/_index.md b/website/content/api/crypto/dd/fr/_index.md new file mode 100644 index 000000000000..e5374cef6ce4 --- /dev/null +++ b/website/content/api/crypto/dd/fr/_index.md @@ -0,0 +1,40 @@ +# crypto.dd.fr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.fr(symbol: str) -> Tuple[str, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Returns coin fundraising + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check fundraising + + Returns + ------- + str + launch summary + pd.DataFrame + Sales rounds + pd.DataFrame + Treasury Accounts + pd.DataFrame + Metric Value launch details + +## Getting charts +###crypto.dd.fr(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display coin fundraising + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check coin fundraising + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/get_mt/_index.md b/website/content/api/crypto/dd/get_mt/_index.md new file mode 100644 index 000000000000..fb06bc0987ae --- /dev/null +++ b/website/content/api/crypto/dd/get_mt/_index.md @@ -0,0 +1,36 @@ +# crypto.dd.get_mt + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.get_mt(only_free: bool = True) -> pandas.core.frame.DataFrame + +Returns available messari timeseries + [Source: https://messari.io/] + + Parameters + ---------- + only_free : bool + Display only timeseries available for free + + Returns + ------- + pd.DataFrame + available timeseries + +## Getting charts +###crypto.dd.get_mt(limit: int = 10, query: str = '', only_free: bool = True, export: str = '', chart=True) -> None + +Display messari timeseries list + [Source: https://messari.io/] + + Parameters + ---------- + limit : int + number to show + query : str + Query to search across all messari timeseries + only_free : bool + Display only timeseries available for free + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/gh/_index.md b/website/content/api/crypto/dd/gh/_index.md new file mode 100644 index 000000000000..d1caab548859 --- /dev/null +++ b/website/content/api/crypto/dd/gh/_index.md @@ -0,0 +1,52 @@ +# crypto.dd.gh + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.gh(symbol: str, dev_activity: bool = False, interval: str = '1d', start_date: str = '2021-09-20T18:22:33Z', end_date: str = '2022-09-20T18:22:33Z') -> pandas.core.frame.DataFrame + +Returns a list of developer activity for a given coin and time interval. + + [Source: https://santiment.net/] + + Parameters + ---------- + symbol : str + Crypto symbol to check github activity + dev_activity: bool + Whether to filter only for development activity + start_date : int + Initial date like string (e.g., 2021-10-01) + end_date : int + End date like string (e.g., 2021-10-01) + interval : str + Interval frequency (e.g., 1d) + + Returns + ------- + pd.DataFrame + developer activity over time + +## Getting charts +###crypto.dd.gh(symbol: str, start_date: str = '2021-09-20T18:22:33Z', dev_activity: bool = False, end_date: str = '2022-09-20T18:22:33Z', interval: str = '1d', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Returns a list of github activity for a given coin and time interval. + + [Source: https://santiment.net/] + + Parameters + ---------- + symbol : str + Crypto symbol to check github activity + dev_activity: bool + Whether to filter only for development activity + start_date : int + Initial date like string (e.g., 2021-10-01) + end_date : int + End date like string (e.g., 2021-10-01) + interval : str + Interval frequency (some possible values are: 1h, 1d, 1w) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/gov/_index.md b/website/content/api/crypto/dd/gov/_index.md new file mode 100644 index 000000000000..6601d10a2fd5 --- /dev/null +++ b/website/content/api/crypto/dd/gov/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.gov + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.gov(symbol: str) -> Tuple[str, pandas.core.frame.DataFrame] + +Returns coin governance + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check governance + + Returns + ------- + str + governance summary + pd.DataFrame + Metric Value with governance details + +## Getting charts +###crypto.dd.gov(symbol: str, export: str = '', chart=True) -> None + +Display coin governance + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check coin governance + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/headlines/_index.md b/website/content/api/crypto/dd/headlines/_index.md new file mode 100644 index 000000000000..5cc20e8745e4 --- /dev/null +++ b/website/content/api/crypto/dd/headlines/_index.md @@ -0,0 +1,41 @@ +# crypto.dd.headlines + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.headlines(symbol: str) -> pandas.core.frame.DataFrame + +Gets Sentiment analysis provided by FinBrain's API [Source: finbrain] + + Parameters + ---------- + symbol : str + Ticker symbol to get the sentiment analysis from + + Returns + ------- + DataFrame() + Empty if there was an issue with data retrieval + +## Getting charts +###crypto.dd.headlines(symbol: str, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Sentiment analysis from FinBrain for Cryptocurrencies + + FinBrain collects the news headlines from 15+ major financial news + sources on a daily basis and analyzes them to generate sentiment scores + for more than 4500 US stocks. FinBrain Technologies develops deep learning + algorithms for financial analysis and prediction, which currently serves + traders from more than 150 countries all around the world. + [Source: https://finbrain.tech] + + Parameters + ---------- + symbol: str + Cryptocurrency + raw : False + Display raw table data + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/hr/_index.md b/website/content/api/crypto/dd/hr/_index.md new file mode 100644 index 000000000000..ccd86d3e3aba --- /dev/null +++ b/website/content/api/crypto/dd/hr/_index.md @@ -0,0 +1,46 @@ +# crypto.dd.hr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.hr(symbol: str, interval: str = '24h', start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame + +Returns dataframe with mean hashrate of btc or eth blockchain and symbol price + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Blockchain to check hashrate (BTC or ETH) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + interval : str + Interval frequency (e.g., 24h) + + Returns + ------- + pd.DataFrame + mean hashrate and symbol price over time + +## Getting charts +###crypto.dd.hr(symbol: str, start_date: int = 1632158553, end_date: int = 1663694553, interval: str = '24h', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display dataframe with mean hashrate of btc or eth blockchain and symbol price. + [Source: https://glassnode.org] + + Parameters + ---------- + symbol : str + Blockchain to check mean hashrate (BTC or ETH) + start_date : int + Initial date timestamp (e.g., 1_614_556_800) + end_date : int + End date timestamp (e.g., 1_614_556_800) + interval : str + Interval frequency (possible values are: 24, 1w, 1month) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/crypto/dd/inv/_index.md b/website/content/api/crypto/dd/inv/_index.md new file mode 100644 index 000000000000..73c4fd75137a --- /dev/null +++ b/website/content/api/crypto/dd/inv/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.inv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.inv(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Returns coin investors + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check investors + + Returns + ------- + pd.DataFrame + individuals + pd.DataFrame + organizations + +## Getting charts +###crypto.dd.inv(symbol: str, export: str = '', chart=True) -> None + +Display coin investors + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check coin investors + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/links/_index.md b/website/content/api/crypto/dd/links/_index.md new file mode 100644 index 000000000000..4867e7f9f024 --- /dev/null +++ b/website/content/api/crypto/dd/links/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.links + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.links(symbol: str) -> pandas.core.frame.DataFrame + +Returns asset's links + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check links + + Returns + ------- + pd.DataFrame + asset links + +## Getting charts +###crypto.dd.links(symbol: str, export: str = '', chart=True) -> None + +Display coin links + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check links + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/mcapdom/_index.md b/website/content/api/crypto/dd/mcapdom/_index.md new file mode 100644 index 000000000000..5a45824e5fb8 --- /dev/null +++ b/website/content/api/crypto/dd/mcapdom/_index.md @@ -0,0 +1,46 @@ +# crypto.dd.mcapdom + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.mcapdom(symbol: str, interval: str = '1d', start_date: str = '2021-09-20', end_date: str = '2022-09-20') -> pandas.core.frame.DataFrame + +Returns market dominance of a coin over time + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check market cap dominance + interval : str + Interval frequency (possible values are: 5m, 15m, 30m, 1h, 1d, 1w) + start_date : int + Initial date like string (e.g., 2021-10-01) + end_date : int + End date like string (e.g., 2021-10-01) + + Returns + ------- + pd.DataFrame + market dominance percentage over time + +## Getting charts +###crypto.dd.mcapdom(symbol: str, start_date: str = '2021-09-20', end_date: str = '2022-09-20', interval: str = '1d', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display market dominance of a coin over time + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check market cap dominance + start_date : int + Initial date like string (e.g., 2021-10-01) + end_date : int + End date like string (e.g., 2021-10-01) + interval : str + Interval frequency (possible values are: 5m, 15m, 30m, 1h, 1d, 1w) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/mkt/_index.md b/website/content/api/crypto/dd/mkt/_index.md new file mode 100644 index 000000000000..d9a5b3d01658 --- /dev/null +++ b/website/content/api/crypto/dd/mkt/_index.md @@ -0,0 +1,53 @@ +# crypto.dd.mkt + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.mkt(symbol: str = 'eth-ethereum', quotes: str = 'USD', sortby: str = 'pct_volume_share', ascend: bool = True) -> pandas.core.frame.DataFrame + +All markets for given coin and currency [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Coin Parpika identifier of coin e.g. eth-ethereum + quotes: str + Comma separated list of quotes to return. + Example: quotes=USD,BTC + Allowed values: + BTC, ETH, USD, EUR, PLN, KRW, GBP, CAD, JPY, RUB, TRY, NZD, AUD, CHF, UAH, HKD, SGD, NGN, + PHP, MXN, BRL, THB, CLP, CNY, CZK, DKK, HUF, IDR, ILS, INR, MYR, NOK, PKR, SEK, TWD, ZAR, + VND, BOB, COP, PEN, ARS, ISK + sortby: str + Key by which to sort data. Every column name is valid (see for possible values: + https://api.coinpaprika.com/v1). + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + All markets for given coin and currency + +## Getting charts +###crypto.dd.mkt(from_symbol: str = 'BTC', to_symbol: str = 'USD', limit: int = 20, sortby: str = 'pct_volume_share', ascend: bool = True, links: bool = False, export: str = '', chart=True) -> None + +Get all markets for given coin id. [Source: CoinPaprika] + + Parameters + ---------- + from_symbol: str + Cryptocurrency symbol (e.g. BTC) + to_symbol: str + Quoted currency + limit: int + Number of records to display + sortby: str + Key by which to sort data. Every column name is valid (see for possible values: + https://api.coinpaprika.com/v1). + ascend: bool + Flag to sort data ascending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/mt/_index.md b/website/content/api/crypto/dd/mt/_index.md new file mode 100644 index 000000000000..ae9571443c03 --- /dev/null +++ b/website/content/api/crypto/dd/mt/_index.md @@ -0,0 +1,52 @@ +# crypto.dd.mt + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.mt(symbol: str, timeseries_id: str, interval: str = '1d', start_date: str = '2021-09-20', end_date: str = '2022-09-20') -> Tuple[pandas.core.frame.DataFrame, str] + +Returns messari timeseries + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check messari timeseries + timeseries_id : str + Messari timeserie id + interval : str + Interval frequency (possible values are: 5m, 15m, 30m, 1h, 1d, 1w) + start : int + Initial date like string (e.g., 2021-10-01) + end : int + End date like string (e.g., 2021-10-01) + + Returns + ------- + pd.DataFrame + messari timeserie over time + str + timeserie title + +## Getting charts +###crypto.dd.mt(symbol: str, timeseries_id: str, start_date: str = '2021-09-20', end_date: str = '2022-09-20', interval: str = '1d', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display messari timeseries + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check market cap dominance + timeseries_id: str + Obtained by api.crypto.dd.get_mt command + start_date : int + Initial date like string (e.g., 2021-10-01) + end_date : int + End date like string (e.g., 2021-10-01) + interval : str + Interval frequency (possible values are: 5m, 15m, 30m, 1h, 1d, 1w) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/news/_index.md b/website/content/api/crypto/dd/news/_index.md new file mode 100644 index 000000000000..b8df99f449f9 --- /dev/null +++ b/website/content/api/crypto/dd/news/_index.md @@ -0,0 +1,51 @@ +# crypto.dd.news + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.news(limit: int = 60, post_kind: str = 'news', filter_: Optional[str] = None, region: str = 'en', source: str = 'cp', currency: str = None, sortby: str = 'published_at', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get recent posts from CryptoPanic news aggregator platform. [Source: https://cryptopanic.com/] + + Parameters + ---------- + limit: int + number of news to fetch + post_kind: str + Filter by category of news. Available values: news or media. + filter_: Optional[str] + Filter by kind of news. One from list: rising|hot|bullish|bearish|important|saved|lol + region: str + Filter news by regions. Available regions are: en (English), de (Deutsch), nl (Dutch), + es (Español), fr (Français), it (Italiano), pt (Português), ru (Русский) + sortby: str + Key to sort by. + ascend: bool + Sort in ascend order. + + Returns + ------- + pd.DataFrame + DataFrame with recent news from different sources filtered by provided parameters. + +## Getting charts +###crypto.dd.news(post_kind: str = 'news', region: str = 'en', filter_: Optional[str] = None, source: str = 'cp', currency: Optional[str] = None, limit: int = 25, ascend: bool = True, export: str = '', chart=True) -> None + +Display recent posts from CryptoPanic news aggregator platform. + [Source: https://cryptopanic.com/] + + Parameters + ---------- + limit: int + number of news to display + post_kind: str + Filter by category of news. Available values: news or media. + filter_: Optional[str] + Filter by kind of news. One from list: rising|hot|bullish|bearish|important|saved|lol + region: str + Filter news by regions. Available regions are: en (English), de (Deutsch), nl (Dutch), + es (Español), fr (Français), it (Italiano), pt (Português), ru (Русский) + ascend: bool + Sort in ascending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/nonzero/_index.md b/website/content/api/crypto/dd/nonzero/_index.md new file mode 100644 index 000000000000..a327ab13f43d --- /dev/null +++ b/website/content/api/crypto/dd/nonzero/_index.md @@ -0,0 +1,42 @@ +# crypto.dd.nonzero + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.nonzero(symbol: str, start_date: int = 1262304000, end_date: int = 1663694553) -> pandas.core.frame.DataFrame + +Returns addresses with non-zero balance of a certain symbol + [Source: https://glassnode.com] + + Parameters + ---------- + symbol : str + Asset to search (e.g., BTC) + start_date : int + Initial date timestamp (e.g., 1_577_836_800) + end_date : int + End date timestamp (e.g., 1_609_459_200) + + Returns + ------- + pd.DataFrame + addresses with non-zero balances + +## Getting charts +###crypto.dd.nonzero(symbol: str, start_date: int = 1577836800, end_date: int = 1609459200, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display addresses with non-zero balance of a certain symbol + [Source: https://glassnode.org] + + Parameters + ---------- + symbol : str + Asset to search (e.g., BTC) + start_date : int + Initial date timestamp (e.g., 1_577_836_800) + end_date : int + End date timestamp (e.g., 1_609_459_200) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/ohlc_historical/_index.md b/website/content/api/crypto/dd/ohlc_historical/_index.md new file mode 100644 index 000000000000..401bb0028630 --- /dev/null +++ b/website/content/api/crypto/dd/ohlc_historical/_index.md @@ -0,0 +1,24 @@ +# crypto.dd.ohlc_historical + +## Get underlying data +###crypto.dd.ohlc_historical(symbol: str = 'eth-ethereum', quotes: str = 'USD', days: int = 90) -> pandas.core.frame.DataFrame + + + Open/High/Low/Close values with volume and market_cap. [Source: CoinPaprika] + Request example: https://api.coinpaprika.com/v1/coins/btc-bitcoin/ohlcv/historical?start=2019-01-01&end=2019-01-20 + if the last day is current day it can an change with every request until actual close of the day at 23:59:59 + + + Parameters + ---------- + symbol: str + Paprika coin identifier e.g. eth-ethereum + quotes: str + returned data quote (available values: usd btc) + days: int + time range for chart in days. Maximum 365 + + Returns + ------- + pandas.DataFrame + Open/High/Low/Close values with volume and market_cap. diff --git a/website/content/api/crypto/dd/oi/_index.md b/website/content/api/crypto/dd/oi/_index.md new file mode 100644 index 000000000000..ddb63aa5c92b --- /dev/null +++ b/website/content/api/crypto/dd/oi/_index.md @@ -0,0 +1,36 @@ +# crypto.dd.oi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.oi(symbol: str, interval: int = 0) -> pandas.core.frame.DataFrame + +Returns open interest by exchange for a certain symbol + [Source: https://coinglass.github.io/API-Reference/] + + Parameters + ---------- + symbol : str + Crypto Symbol to search open interest futures (e.g., BTC) + interval : int + Frequency (possible values are: 0 for ALL, 2 for 1H, 1 for 4H, 4 for 12H), by default 0 + + Returns + ------- + pd.DataFrame + open interest by exchange and price + +## Getting charts +###crypto.dd.oi(symbol: str, interval: int = 0, export: str = '', chart=True) -> None + +Displays open interest by exchange for a certain cryptocurrency + [Source: https://coinglass.github.io/API-Reference/] + + Parameters + ---------- + symbol : str + Crypto symbol to search open interest (e.g., BTC) + interval : int + Frequency (possible values are: 0 for ALL, 2 for 1H, 1 for 4H, 4 for 12H), by default 0 + export : str + Export dataframe data to csv,json,xlsx diff --git a/website/content/api/crypto/dd/pi/_index.md b/website/content/api/crypto/dd/pi/_index.md new file mode 100644 index 000000000000..42963a8bad8f --- /dev/null +++ b/website/content/api/crypto/dd/pi/_index.md @@ -0,0 +1,38 @@ +# crypto.dd.pi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.pi(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Returns coin product info + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check product info + + Returns + ------- + pd.DataFrame + Metric, Value with project and technology details + pd.DataFrame + coin public repos + pd.DataFrame + coin audits + pd.DataFrame + coin known exploits/vulns + +## Getting charts +###crypto.dd.pi(symbol: str, export: str = '', chart=True) -> None + +Display project info + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check project info + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/pr/_index.md b/website/content/api/crypto/dd/pr/_index.md new file mode 100644 index 000000000000..eff47e3fb9c9 --- /dev/null +++ b/website/content/api/crypto/dd/pr/_index.md @@ -0,0 +1,43 @@ +# crypto.dd.pr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.pr(main_coin: str, vs: Optional[str] = None, limit: Optional[int] = None, price: Optional[int] = None) -> pandas.core.frame.DataFrame + +Fetch data to calculate potential returns of a certain coin. [Source: CoinGecko] + + Parameters + ---------- + main_coin : str + Coin loaded to check potential returns for (e.g., algorand) + vs : str | None + Coin to compare main_coin with (e.g., bitcoin) + limit : int | None + Number of coins with highest market cap to compare main_coin with (e.g., 5) + price + Target price of main_coin to check potential returns (e.g., 5) + + Returns + ------- + pd.DataFrame + Potential returns data + Columns: Coin, Current Price, Target Coin, Potential Price, Potential Market Cap ($), Change (%) + +## Getting charts +###crypto.dd.pr(to_symbol: str, from_symbol: Optional[str] = None, limit: Optional[int] = None, price: Optional[int] = None, export: str = '', chart=True) -> None + +Displays potential returns of a certain coin. [Source: CoinGecko] + + Parameters + ---------- + to_symbol : str + Coin loaded to check potential returns for (e.g., algorand) + from_symbol : str | None + Coin to compare main_coin with (e.g., bitcoin) + limit : int | None + Number of coins with highest market cap to compare main_coin with (e.g., 5) + price + Target price of main_coin to check potential returns (e.g., 5) + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/ps/_index.md b/website/content/api/crypto/dd/ps/_index.md new file mode 100644 index 000000000000..3bb8eb66bfe4 --- /dev/null +++ b/website/content/api/crypto/dd/ps/_index.md @@ -0,0 +1,72 @@ +# crypto.dd.ps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.ps(symbol: str = 'btc-bitcoin', quotes: str = 'USD') -> pandas.core.frame.DataFrame + +Get all most important ticker related information for given coin id [Source: CoinPaprika] + + .. code-block:: json + + { + "id": "btc-bitcoin", + "name": "Bitcoin", + "symbol": "BTC", + "rank": 1, + "circulating_supply": 17007062, + "total_supply": 17007062, + "max_supply": 21000000, + "beta_value": 0.735327, + "first_data_at": "2010-11-14T07:20:41Z", + "last_updated": "2018-11-14T07:20:41Z", + "quotes": { + "USD": { + "price": 5162.15941296, + "volume_24h": 7304207651.1585, + "volume_24h_change_24h": -2.5, + "market_cap": 91094433242, + "market_cap_change_24h": 1.6, + "percent_change_15m": 0, + "percent_change_30m": 0, + "percent_change_1h": 0, + "percent_change_6h": 0, + "percent_change_12h": -0.09, + "percent_change_24h": 1.59, + "percent_change_7d": 0.28, + "percent_change_30d": 27.39, + "percent_change_1y": -37.99, + "ath_price": 20089, + "ath_date": "2017-12-17T12:19:00Z", + "percent_from_price_ath": -74.3 + } + } + } + + Parameters + ---------- + symbol: str + Id of coin from CoinPaprika + quotes: str + Comma separated quotes to return e.g quotes = USD, BTC + + Returns + ------- + pandas.DataFrame + Most important ticker related information + Columns: Metric, Value + +## Getting charts +###crypto.dd.ps(from_symbol: str = 'BTC', to_symbol: str = 'USD', export: str = '', chart=True) -> None + +Get ticker information for single coin [Source: CoinPaprika] + + Parameters + ---------- + from_symbol: str + Cryptocurrency symbol (e.g. BTC) + to_symbol: str + Quoted currency + export: str + Export dataframe data to csv,json,xlsx + diff --git a/website/content/api/crypto/dd/rm/_index.md b/website/content/api/crypto/dd/rm/_index.md new file mode 100644 index 000000000000..23d3610da958 --- /dev/null +++ b/website/content/api/crypto/dd/rm/_index.md @@ -0,0 +1,40 @@ +# crypto.dd.rm + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.rm(symbol: str, ascend: bool = True) -> pandas.core.frame.DataFrame + +Returns coin roadmap + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check roadmap + ascend: bool + reverse order + + Returns + ------- + pd.DataFrame + roadmap + +## Getting charts +###crypto.dd.rm(symbol: str, ascend: bool = True, limit: int = 5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display coin roadmap + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check roadmap + ascend: bool + reverse order + limit : int + number to show + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/dd/show_available_pairs_for_given_symbol/_index.md b/website/content/api/crypto/dd/show_available_pairs_for_given_symbol/_index.md new file mode 100644 index 000000000000..35042afc1016 --- /dev/null +++ b/website/content/api/crypto/dd/show_available_pairs_for_given_symbol/_index.md @@ -0,0 +1,6 @@ +# crypto.dd.show_available_pairs_for_given_symbol + +## Get underlying data +###crypto.dd.show_available_pairs_for_given_symbol(symbol: str = 'ETH') -> Tuple[str, list] + + diff --git a/website/content/api/crypto/dd/stats/_index.md b/website/content/api/crypto/dd/stats/_index.md new file mode 100644 index 000000000000..08bd6432d869 --- /dev/null +++ b/website/content/api/crypto/dd/stats/_index.md @@ -0,0 +1,32 @@ +# crypto.dd.stats + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.stats(symbol: str) -> pandas.core.frame.DataFrame + +Get 24 hr stats for the product. Volume is in base currency units. + Open, high and low are in quote currency units. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + + Returns + ------- + pd.DataFrame + 24h stats for chosen trading pair + +## Getting charts +###crypto.dd.stats(symbol: str, export: str = '', chart=True) -> None + +Get 24 hr stats for the product. Volume is in base currency units. + Open, high and low are in quote currency units. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/team/_index.md b/website/content/api/crypto/dd/team/_index.md new file mode 100644 index 000000000000..12dda239dd93 --- /dev/null +++ b/website/content/api/crypto/dd/team/_index.md @@ -0,0 +1,34 @@ +# crypto.dd.team + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.team(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Returns coin team + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check team + + Returns + ------- + pd.DataFrame + individuals + pd.DataFrame + organizations + +## Getting charts +###crypto.dd.team(symbol: str, export: str = '', chart=True) -> None + +Display coin team + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check coin team + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/tk/_index.md b/website/content/api/crypto/dd/tk/_index.md new file mode 100644 index 000000000000..0d2b83240183 --- /dev/null +++ b/website/content/api/crypto/dd/tk/_index.md @@ -0,0 +1,37 @@ +# crypto.dd.tk + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.tk(symbol: str, coingecko_id: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Returns coin tokenomics + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check tokenomics + coingecko_id : str + ID from coingecko + Returns + ------- + pd.DataFrame + Metric Value tokenomics + pd.DataFrame + Circulating supply overtime + +## Getting charts +###crypto.dd.tk(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display coin tokenomics + [Source: https://messari.io/] + + Parameters + ---------- + symbol : str + Crypto symbol to check tokenomics + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/crypto/dd/tokenomics/_index.md b/website/content/api/crypto/dd/tokenomics/_index.md new file mode 100644 index 000000000000..86cf75591a84 --- /dev/null +++ b/website/content/api/crypto/dd/tokenomics/_index.md @@ -0,0 +1,16 @@ +# crypto.dd.tokenomics + +## Get underlying data +###crypto.dd.tokenomics(symbol: str = '') -> pandas.core.frame.DataFrame + +Get tokenomics for given coin. [Source: CoinGecko] + + Parameters + ---------- + symbol: str + coin symbol to check tokenomics + + Returns + ------- + pandas.DataFrame + Metric, Value with tokenomics diff --git a/website/content/api/crypto/dd/trades/_index.md b/website/content/api/crypto/dd/trades/_index.md new file mode 100644 index 000000000000..df98f3178f6e --- /dev/null +++ b/website/content/api/crypto/dd/trades/_index.md @@ -0,0 +1,37 @@ +# crypto.dd.trades + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.trades(symbol: str, limit: int = 1000, side: Optional[Any] = None) -> pandas.core.frame.DataFrame + +Get last N trades for chosen trading pair. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + limit: int + Last of trades. Maximum is 1000. + side: str + You can chose either sell or buy side. If side is not set then all trades will be displayed. + Returns + ------- + pd.DataFrame + Last N trades for chosen trading pairs. + +## Getting charts +###crypto.dd.trades(symbol: str, limit: int = 20, side: Optional[str] = None, export: str = '', chart=True) -> None + +Display last N trades for chosen trading pair. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + limit: int + Last of trades. Maximum is 1000. + side: Optional[str] + You can chose either sell or buy side. If side is not set then all trades will be displayed. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/dd/trading_pair_info/_index.md b/website/content/api/crypto/dd/trading_pair_info/_index.md new file mode 100644 index 000000000000..76e99de7ca96 --- /dev/null +++ b/website/content/api/crypto/dd/trading_pair_info/_index.md @@ -0,0 +1,16 @@ +# crypto.dd.trading_pair_info + +## Get underlying data +###crypto.dd.trading_pair_info(symbol: str) -> pandas.core.frame.DataFrame + +Get information about chosen trading pair. [Source: Coinbase] + + Parameters + ---------- + symbol: str + Trading pair of coins on Coinbase e.g ETH-USDT or UNI-ETH + + Returns + ------- + pd.DataFrame + Basic information about given trading pair diff --git a/website/content/api/crypto/dd/trading_pairs/_index.md b/website/content/api/crypto/dd/trading_pairs/_index.md new file mode 100644 index 000000000000..cd2e69a6df7d --- /dev/null +++ b/website/content/api/crypto/dd/trading_pairs/_index.md @@ -0,0 +1,32 @@ +# crypto.dd.trading_pairs + +## Get underlying data +###crypto.dd.trading_pairs() -> List[dict] + +Helper method that return all trading pairs on binance. Methods ause this data for input for e.g + building dataframe with all coins, or to build dict of all trading pairs. [Source: Binance] + + Returns + ------- + List[dict] + list of dictionaries in format: + [ + {'symbol': 'ETHBTC', 'status': 'TRADING', 'baseAsset': 'ETH', 'baseAssetPrecision': 8, + 'quoteAsset': 'BTC', 'quotePrecision': 8, 'quoteAssetPrecision': 8, + 'baseCommissionPrecision': 8, 'quoteCommissionPrecision': 8, + 'orderTypes': ['LIMIT', 'LIMIT_MAKER', 'MARKET', 'STOP_LOSS_LIMIT', 'TAKE_PROFIT_LIMIT'], + 'icebergAllowed': True, + 'ocoAllowed': True, + 'quoteOrderQtyMarketAllowed': True, + 'isSpotTradingAllowed': True, + 'isMarginTradingAllowed': True, + 'filters': [{'filterType': 'PRICE_FILTER', 'minPrice': '0.00000100', + 'maxPrice': '922327.00000000', 'tickSize': '0.00000100'}, + {'filterType': 'PERCENT_PRICE', 'multiplierUp': '5', 'multiplierDown': '0.2', 'avgPriceMins': 5}, + {'filterType': 'LOT_SIZE', 'minQty': '0.00100000', 'maxQty': '100000.00000000', 'stepSize': '0.00100000'}, + {'filterType': 'MIN_NOTIONAL', 'minNotional': '0.00010000', 'applyToMarket': True, 'avgPriceMins': 5}, + {'filterType': 'ICEBERG_PARTS', 'limit': 10}, {'filterType': 'MARKET_LOT_SIZE', 'minQty': '0.00000000', + 'maxQty': '930.49505347', 'stepSize': '0.00000000'}, {'filterType': 'MAX_NUM_ORDERS', 'maxNumOrders': 200}, + {'filterType': 'MAX_NUM_ALGO_ORDERS', 'maxNumAlgoOrders': 5}], 'permissions': ['SPOT', 'MARGIN']}, + ... + ] diff --git a/website/content/api/crypto/dd/twitter/_index.md b/website/content/api/crypto/dd/twitter/_index.md new file mode 100644 index 000000000000..a05371a238d2 --- /dev/null +++ b/website/content/api/crypto/dd/twitter/_index.md @@ -0,0 +1,44 @@ +# crypto.dd.twitter + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.dd.twitter(symbol: str = 'eth-ethereum', sortby: str = 'date', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get twitter timeline for given coin id. Not more than last 50 tweets [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + id of coin from coinpaprika e.g. Ethereum - > 'eth-ethereum' + sortby: str + Key by which to sort data. Every column name is valid + (see for possible values: + https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1twitter/get). + ascend: bool + Flag to sort data descending + Returns + ------- + pandas.DataFrame + Twitter timeline for given coin. + Columns: date, user_name, status, retweet_count, like_count + +## Getting charts +###crypto.dd.twitter(symbol: str = 'BTC', limit: int = 10, sortby: str = 'date', ascend: bool = True, export: str = '', chart=True) -> None + +Get twitter timeline for given coin id. Not more than last 50 tweets [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Cryptocurrency symbol (e.g. BTC) + limit: int + Number of records to display + sortby: str + Key by which to sort data. Every column name is valid + (see for possible values: + https://api.coinpaprika.com/docs#tag/Coins/paths/~1coins~1%7Bcoin_id%7D~1twitter/get). + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/anchor_data/_index.md b/website/content/api/crypto/defi/anchor_data/_index.md new file mode 100644 index 000000000000..f61fd586363e --- /dev/null +++ b/website/content/api/crypto/defi/anchor_data/_index.md @@ -0,0 +1,39 @@ +# crypto.defi.anchor_data + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.anchor_data(address: str = '') -> Tuple[Any, Any, str] + +Returns anchor protocol earnings data of a certain terra address + [Source: https://cryptosaurio.com/] + + Parameters + ---------- + address : str + Terra address. Valid terra addresses start with 'terra' + Returns + ------- + Tuple: + - pandas.DataFrame: Earnings over time in UST + - pandas.DataFrame: History of transactions + - str: Overall statistics + +## Getting charts +###crypto.defi.anchor_data(address: str = '', export: str = '', show_transactions: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays anchor protocol earnings data of a certain terra address + [Source: https://cryptosaurio.com/] + + Parameters + ---------- + asset : str + Terra asset {ust,luna,sdt} + address : str + Terra address. Valid terra addresses start with 'terra' + show_transactions : bool + Flag to show history of transactions in Anchor protocol for address. Default False + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/aterra/_index.md b/website/content/api/crypto/defi/aterra/_index.md new file mode 100644 index 000000000000..6d588c556fd4 --- /dev/null +++ b/website/content/api/crypto/defi/aterra/_index.md @@ -0,0 +1,37 @@ +# crypto.defi.aterra + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.aterra(asset: str = 'ust', address: str = 'terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8') -> pandas.core.frame.DataFrame + +Returns historical data of an asset in a certain terra address + [Source: https://terra.engineer/] + + Parameters + ---------- + asset : str + Terra asset {ust,luna,sdt} + address : str + Terra address. Valid terra addresses start with 'terra' + Returns + ------- + pd.DataFrame + historical data + +## Getting charts +###crypto.defi.aterra(asset: str = '', address: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays the 30-day history of specified asset in terra address + [Source: https://terra.engineer/] + + Parameters + ---------- + asset : str + Terra asset {ust,luna,sdt} + address : str + Terra address. Valid terra addresses start with 'terra' + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/ayr/_index.md b/website/content/api/crypto/defi/ayr/_index.md new file mode 100644 index 000000000000..3e0755601964 --- /dev/null +++ b/website/content/api/crypto/defi/ayr/_index.md @@ -0,0 +1,27 @@ +# crypto.defi.ayr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.ayr() -> pandas.core.frame.DataFrame + +Displays the 30-day history of the Anchor Yield Reserve. + [Source: https://terra.engineer/] + + Returns + ---------- + pd.DataFrame + Dataframe containing historical data + +## Getting charts +###crypto.defi.ayr(export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays the 30-day history of the Anchor Yield Reserve. + [Source: https://terra.engineer/] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file, by default False + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/dpi/_index.md b/website/content/api/crypto/defi/dpi/_index.md new file mode 100644 index 000000000000..6f78d7c6774c --- /dev/null +++ b/website/content/api/crypto/defi/dpi/_index.md @@ -0,0 +1,32 @@ +# crypto.defi.dpi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.dpi(sortby: str = 'TVL', ascend: bool = False) -> pandas.core.frame.DataFrame + +Scrapes data from DeFi Pulse with all DeFi Pulse crypto protocols. + [Source: https://defipulse.com/] + + Returns + ------- + pd.DataFrame + List of DeFi Pulse protocols. + +## Getting charts +###crypto.defi.dpi(top: int = 10, sortby: str = 'TVL', ascend: bool = False, export: str = '', chart=True) -> None + +Displays all DeFi Pulse crypto protocols. + [Source: https://defipulse.com/] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data (Possible values are: "Rank", "Name", "Chain", "Sector", + "TVL", "1 Day (%)"), by default TVL + ascend: bool + Flag to sort data ascending, by default False + export : str + Export dataframe data to csv,json,xlsx file, by default False diff --git a/website/content/api/crypto/defi/dtvl/_index.md b/website/content/api/crypto/defi/dtvl/_index.md new file mode 100644 index 000000000000..8b6742ed85d5 --- /dev/null +++ b/website/content/api/crypto/defi/dtvl/_index.md @@ -0,0 +1,29 @@ +# crypto.defi.dtvl + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.dtvl(protocol: str) -> pandas.core.frame.DataFrame + +Returns information about historical tvl of a defi protocol. + [Source: https://docs.llama.fi/api] + + Returns + ------- + pd.DataFrame + Historical tvl + +## Getting charts +###crypto.defi.dtvl(dapps: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Displays historical TVL of different dApps + [Source: https://docs.llama.fi/api] + + Parameters + ---------- + dapps: str + dApps to search historical TVL. Should be split by , e.g.: anchor,sushiswap,pancakeswap + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/gacc/_index.md b/website/content/api/crypto/defi/gacc/_index.md new file mode 100644 index 000000000000..2080c1076732 --- /dev/null +++ b/website/content/api/crypto/defi/gacc/_index.md @@ -0,0 +1,35 @@ +# crypto.defi.gacc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.gacc(cumulative: bool = True) -> pandas.core.frame.DataFrame + +Get terra blockchain account growth history [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + cumulative: bool + distinguish between periodical and cumulative account growth data + Returns + ------- + pd.DataFrame + historical data of accounts growth + +## Getting charts +###crypto.defi.gacc(kind: str = 'total', cumulative: bool = False, top: int = 90, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display terra blockchain account growth history [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + top: int + Number of records to display + kind: str + display total account count or active account count. One from list [active, total] + cumulative: bool + Flag to show cumulative or discrete values. For active accounts only discrete value are available. + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/gdapps/_index.md b/website/content/api/crypto/defi/gdapps/_index.md new file mode 100644 index 000000000000..14c7f168a097 --- /dev/null +++ b/website/content/api/crypto/defi/gdapps/_index.md @@ -0,0 +1,34 @@ +# crypto.defi.gdapps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.gdapps(limit: int = 50) -> pandas.core.frame.DataFrame + +Display top dApps (in terms of TVL) grouped by chain. + [Source: https://docs.llama.fi/api] + + Parameters + ---------- + num: int + Number of top dApps to display + + Returns + ------- + pd.DataFrame + Information about DeFi protocols grouped by chain + +## Getting charts +###crypto.defi.gdapps(limit: int = 50, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display top dApps (in terms of TVL) grouped by chain. + [Source: https://docs.llama.fi/api] + + Parameters + ---------- + num: int + Number of top dApps to display + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/gov_proposals/_index.md b/website/content/api/crypto/defi/gov_proposals/_index.md new file mode 100644 index 000000000000..2edfd992b966 --- /dev/null +++ b/website/content/api/crypto/defi/gov_proposals/_index.md @@ -0,0 +1,42 @@ +# crypto.defi.gov_proposals + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.gov_proposals(status: str = '', sortby: str = 'id', ascend: bool = True, top: int = 10) -> pandas.core.frame.DataFrame + +Get terra blockchain governance proposals list [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + status: str + status of proposal, one from list: ['Voting','Deposit','Passed','Rejected'] + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + top: int + Number of records to display + + Returns + ------- + pd.DataFrame + Terra blockchain governance proposals list + +## Getting charts +###crypto.defi.gov_proposals(top: int = 10, status: str = 'all', sortby: str = 'id', ascend: bool = True, export: str = '', chart=True) -> None + +Display terra blockchain governance proposals list [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + top: int + Number of records to display + status: str + status of proposal, one from list: ['Voting','Deposit','Passed','Rejected'] + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascend + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/ldapps/_index.md b/website/content/api/crypto/defi/ldapps/_index.md new file mode 100644 index 000000000000..f0a558841ff9 --- /dev/null +++ b/website/content/api/crypto/defi/ldapps/_index.md @@ -0,0 +1,38 @@ +# crypto.defi.ldapps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.ldapps(num: int = 100) -> pandas.core.frame.DataFrame + +Returns information about listed DeFi protocols, their current TVL and changes to it in the last hour/day/week. + [Source: https://docs.llama.fi/api] + + Parameters + ---------- + num: int + The number of dApps to display + + Returns + ------- + pd.DataFrame + Information about DeFi protocols + +## Getting charts +###crypto.defi.ldapps(top: int, sortby: str, ascend: bool = False, description: bool = False, export: str = '', chart=True) -> None + +Display information about listed DeFi protocols, their current TVL and changes to it in + the last hour/day/week. [Source: https://docs.llama.fi/api] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + description: bool + Flag to display description of protocol + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/luna_supply/_index.md b/website/content/api/crypto/defi/luna_supply/_index.md new file mode 100644 index 000000000000..c8a1be39c201 --- /dev/null +++ b/website/content/api/crypto/defi/luna_supply/_index.md @@ -0,0 +1,44 @@ +# crypto.defi.luna_supply + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.luna_supply(supply_type: str = 'lunaSupplyChallengeStats', days: int = 30) -> pandas.core.frame.DataFrame + +Get supply history of the Terra ecosystem + + Source: [Smartstake.io] + + Parameters + ---------- + supply_type: str + Supply type to unpack json + days: int + Day count to fetch data + + Returns + ------- + pd.DataFrame + Dataframe of supply history data + +## Getting charts +###crypto.defi.luna_supply(days: int = 30, export: str = '', supply_type: str = 'lunaSupplyChallengeStats', limit: int = 5, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display Luna circulating supply stats + + Parameters + ---------- + days: int + Number of days + supply_type: str + Supply type to unpack json + export: str + Export type + limit: int + Number of results display on the terminal + Default: 5 + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + Returns + None + ------- diff --git a/website/content/api/crypto/defi/newsletters/_index.md b/website/content/api/crypto/defi/newsletters/_index.md new file mode 100644 index 000000000000..76da25e71e25 --- /dev/null +++ b/website/content/api/crypto/defi/newsletters/_index.md @@ -0,0 +1,27 @@ +# crypto.defi.newsletters + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.newsletters() -> pandas.core.frame.DataFrame + +Scrape all substack newsletters from url list. + [Source: substack.com] + + Returns + ------- + pd.DataFrame + DataFrame with recent news from most popular DeFi related newsletters. + +## Getting charts +###crypto.defi.newsletters(top: int = 10, export: str = '', chart=True) -> None + +Display DeFi related substack newsletters. + [Source: substack.com] + + Parameters + ---------- + top: int + Number of records to display + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/pairs/_index.md b/website/content/api/crypto/defi/pairs/_index.md new file mode 100644 index 000000000000..794a7e51bc09 --- /dev/null +++ b/website/content/api/crypto/defi/pairs/_index.md @@ -0,0 +1,55 @@ +# crypto.defi.pairs + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.pairs(last_days: int = 14, min_volume: int = 100, min_liquidity: int = 0, min_tx: int = 100) -> pandas.core.frame.DataFrame + +Get lastly added trade-able pairs on Uniswap with parameters like: + * number of days the pair has been active, + * minimum trading volume, + * minimum liquidity, + * number of transactions. + + [Source: https://thegraph.com/en/] + + Parameters + ---------- + last_days: int + How many days back to look for added pairs. + min_volume: int + Minimum volume + min_liquidity: int + Minimum liquidity + min_tx: int + Minimum number of transactions done in given pool. + + Returns + ------- + pd.DataFrame + Lastly added pairs on Uniswap DEX. + +## Getting charts +###crypto.defi.pairs(top: int = 20, days: int = 7, min_volume: int = 20, min_liquidity: int = 0, min_tx: int = 100, sortby: str = 'created', descend: bool = False, export: str = '', chart=True) -> None + +Displays Lastly added pairs on Uniswap DEX. + [Source: https://thegraph.com/en/] + + Parameters + ---------- + top: int + Number of records to display + days: int + Number of days the pair has been active, + min_volume: int + Minimum trading volume, + min_liquidity: int + Minimum liquidity + min_tx: int + Minimum number of transactions + sortby: str + Key by which to sort data + descend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/pools/_index.md b/website/content/api/crypto/defi/pools/_index.md new file mode 100644 index 000000000000..c86d55c08df9 --- /dev/null +++ b/website/content/api/crypto/defi/pools/_index.md @@ -0,0 +1,31 @@ +# crypto.defi.pools + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.pools() -> pandas.core.frame.DataFrame + +Get uniswap pools by volume. [Source: https://thegraph.com/en/] + + Returns + ------- + pd.DataFrame + Trade-able pairs listed on Uniswap by top volume. + +## Getting charts +###crypto.defi.pools(top: int = 20, sortby: str = 'volumeUSD', descend: bool = True, export: str = '', chart=True) -> None + +Displays uniswap pools by volume. + [Source: https://thegraph.com/en/] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data. The table can be sorted by every of its columns + (see https://bit.ly/3ORagr1 then press ctrl-enter or execute the query). + descend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/sinfo/_index.md b/website/content/api/crypto/defi/sinfo/_index.md new file mode 100644 index 000000000000..9bb4947b2531 --- /dev/null +++ b/website/content/api/crypto/defi/sinfo/_index.md @@ -0,0 +1,31 @@ +# crypto.defi.sinfo + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.sinfo(address: str = '') -> Tuple[pandas.core.frame.DataFrame, str] + +Get staking info for provided terra account [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + address: str + terra blockchain address e.g. terra1jvwelvs7rdk6j3mqdztq5tya99w8lxk6l9hcqg + Returns + ------- + Tuple[pd.DataFrame, str]: + luna delegations and summary report for given address + +## Getting charts +###crypto.defi.sinfo(address: str = '', top: int = 10, export: str = '', chart=True) -> None + +Display staking info for provided terra account address [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + address: str + terra blockchain address e.g. terra1jvwelvs7rdk6j3mqdztq5tya99w8lxk6l9hcqg + top: int + Number of records to display + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/sratio/_index.md b/website/content/api/crypto/defi/sratio/_index.md new file mode 100644 index 000000000000..699ef1e618d6 --- /dev/null +++ b/website/content/api/crypto/defi/sratio/_index.md @@ -0,0 +1,32 @@ +# crypto.defi.sratio + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.sratio(top: int = 200) + +Get terra blockchain staking ratio history [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + top: int + The number of ratios to show + + Returns + ------- + pd.DataFrame + historical staking ratio + +## Getting charts +###crypto.defi.sratio(top: int = 90, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display terra blockchain staking ratio history [Source: https://fcd.terra.dev/v1] + + Parameters + ---------- + top: int + Number of records to display + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/sreturn/_index.md b/website/content/api/crypto/defi/sreturn/_index.md new file mode 100644 index 000000000000..5f66c1d84a31 --- /dev/null +++ b/website/content/api/crypto/defi/sreturn/_index.md @@ -0,0 +1,33 @@ +# crypto.defi.sreturn + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.sreturn(top: int = 200) + +Get terra blockchain staking returns history [Source: https://fcd.terra.dev/v1] + + Parameters + ---------- + top: int + The number of returns to show + + Returns + ------- + pd.DataFrame + historical staking returns + +## Getting charts +###crypto.defi.sreturn(top: int = 90, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Display terra blockchain staking returns history [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + top: int + Number of records to display + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/crypto/defi/stats/_index.md b/website/content/api/crypto/defi/stats/_index.md new file mode 100644 index 000000000000..b3811eb101b2 --- /dev/null +++ b/website/content/api/crypto/defi/stats/_index.md @@ -0,0 +1,34 @@ +# crypto.defi.stats + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.stats() -> pandas.core.frame.DataFrame + +Get base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] + + uniswapFactory id: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - ethereum address on which Uniswap Factory + smart contract was deployed. The factory contract is deployed once from the off-chain source code, and it contains + functions that make it possible to create exchange contracts for any ERC20 token that does not already have one. + It also functions as a registry of ERC20 tokens that have been added to the system, and the exchange with which they + are associated. More: https://docs.uniswap.org/protocol/V1/guides/connect-to-uniswap + We use 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f address to fetch all smart contracts that were + created with usage of this factory. + + + Returns + ------- + pd.DataFrame + Uniswap DEX statistics like liquidity, volume, number of pairs, number of transactions. + +## Getting charts +###crypto.defi.stats(export: str = '', chart=True) -> None + +Displays base statistics about Uniswap DEX. [Source: https://thegraph.com/en/] + [Source: https://thegraph.com/en/] + + Parameters + ---------- + + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/stvl/_index.md b/website/content/api/crypto/defi/stvl/_index.md new file mode 100644 index 000000000000..564738d5c75e --- /dev/null +++ b/website/content/api/crypto/defi/stvl/_index.md @@ -0,0 +1,29 @@ +# crypto.defi.stvl + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.stvl() -> pandas.core.frame.DataFrame + +Returns historical values of the total sum of TVLs from all listed protocols. + [Source: https://docs.llama.fi/api] + + Returns + ------- + pd.DataFrame + Historical values of total sum of Total Value Locked from all listed protocols. + +## Getting charts +###crypto.defi.stvl(top: int = 5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays historical values of the total sum of TVLs from all listed protocols. + [Source: https://docs.llama.fi/api] + + Parameters + ---------- + top: int + Number of records to display, by default 5 + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/defi/swaps/_index.md b/website/content/api/crypto/defi/swaps/_index.md new file mode 100644 index 000000000000..ce6e39a8db6d --- /dev/null +++ b/website/content/api/crypto/defi/swaps/_index.md @@ -0,0 +1,35 @@ +# crypto.defi.swaps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.swaps(limit: int = 100) -> pandas.core.frame.DataFrame + +Get the last 100 swaps done on Uniswap [Source: https://thegraph.com/en/] + + Parameters + ------- + limit: int + Number of swaps to return. Maximum possible number: 1000. + Returns + ------- + pd.DataFrame + Last 100 swaps on Uniswap + +## Getting charts +###crypto.defi.swaps(top: int = 10, sortby: str = 'timestamp', descend: bool = False, export: str = '', chart=True) -> None + +Displays last swaps done on Uniswap + [Source: https://thegraph.com/en/] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data. The table can be sorted by every of its columns + (see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). + descend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/tokens/_index.md b/website/content/api/crypto/defi/tokens/_index.md new file mode 100644 index 000000000000..09612914c5de --- /dev/null +++ b/website/content/api/crypto/defi/tokens/_index.md @@ -0,0 +1,43 @@ +# crypto.defi.tokens + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.tokens(skip: int = 0, limit: int = 100, sortby: str = 'index', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get list of tokens trade-able on Uniswap DEX. [Source: https://thegraph.com/en/] + + Parameters + ---------- + skip: int + Skip n number of records. + limit: int + Show n number of records. + sortby: str + The column to sort by + ascend: bool + Whether to sort in ascending order + + Returns + ------- + pd.DataFrame + Uniswap tokens with trading volume, transaction count, liquidity. + +## Getting charts +###crypto.defi.tokens(skip: int = 0, limit: int = 20, sortby: str = 'index', ascend: bool = False, export: str = '', chart=True) -> None + +Displays tokens trade-able on Uniswap DEX. + [Source: https://thegraph.com/en/] + + Parameters + ---------- + skip: int + Number of records to skip + limit: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/validators/_index.md b/website/content/api/crypto/defi/validators/_index.md new file mode 100644 index 000000000000..d7ad176f19d5 --- /dev/null +++ b/website/content/api/crypto/defi/validators/_index.md @@ -0,0 +1,38 @@ +# crypto.defi.validators + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.validators(sortby: str = 'votingPower', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get information about terra validators [Source: https://fcd.terra.dev/swagger] + + Parameters + ----------- + sortby: str + Key by which to sort data. Choose from: + validatorName, tokensAmount, votingPower, commissionRate, status, uptime + ascend: bool + Flag to sort data descending + + Returns + ------- + pd.DataFrame + terra validators details + +## Getting charts +###crypto.defi.validators(top: int = 10, sortby: str = 'votingPower', ascend: bool = True, export: str = '', chart=True) -> None + +Display information about terra validators [Source: https://fcd.terra.dev/swagger] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data. Choose from: + validatorName, tokensAmount, votingPower, commissionRate, status, uptime + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/defi/vaults/_index.md b/website/content/api/crypto/defi/vaults/_index.md new file mode 100644 index 000000000000..468a9a7f195c --- /dev/null +++ b/website/content/api/crypto/defi/vaults/_index.md @@ -0,0 +1,66 @@ +# crypto.defi.vaults + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.defi.vaults(chain: Optional[str] = None, protocol: Optional[str] = None, kind: Optional[str] = None, ascend: bool = True, sortby: str = 'apy') -> pandas.core.frame.DataFrame + +Get DeFi Vaults Information. DeFi Vaults are pools of funds with an assigned strategy which main goal is to + maximize returns of its crypto assets. [Source: https://coindix.com/] + + Parameters + ---------- + chain: str + Blockchain - one from list [ + 'ethereum', 'polygon', 'avalanche', 'bsc', 'terra', 'fantom', + 'moonriver', 'celo', 'heco', 'okex', 'cronos', 'arbitrum', 'eth', + 'harmony', 'fuse', 'defichain', 'solana', 'optimism' + ] + protocol: str + DeFi protocol - one from list: [ + 'aave', 'acryptos', 'alpaca', 'anchor', 'autofarm', 'balancer', 'bancor', + 'beefy', 'belt', 'compound', 'convex', 'cream', 'curve', 'defichain', 'geist', + 'lido', 'liquity', 'mirror', 'pancakeswap', 'raydium', 'sushi', 'tarot', 'traderjoe', + 'tulip', 'ubeswap', 'uniswap', 'venus', 'yearn' + ] + kind: str + Kind/type of vault - one from list: ['lp','single','noimploss','stable'] + + Returns + ------- + pd.DataFrame + Top 100 DeFi Vaults for given chain/protocol sorted by APY. + +## Getting charts +###crypto.defi.vaults(chain: Optional[str] = None, protocol: Optional[str] = None, kind: Optional[str] = None, top: int = 10, sortby: str = 'apy', ascend: bool = True, link: bool = False, export: str = '', chart=True) -> None + +Display Top DeFi Vaults - pools of funds with an assigned strategy which main goal is to + maximize returns of its crypto assets. [Source: https://coindix.com/] + + Parameters + ---------- + chain: str + Blockchain - one from list [ + 'ethereum', 'polygon', 'avalanche', 'bsc', 'terra', 'fantom', + 'moonriver', 'celo', 'heco', 'okex', 'cronos', 'arbitrum', 'eth', + 'harmony', 'fuse', 'defichain', 'solana', 'optimism' + ] + protocol: str + DeFi protocol - one from list: [ + 'aave', 'acryptos', 'alpaca', 'anchor', 'autofarm', 'balancer', 'bancor', + 'beefy', 'belt', 'compound', 'convex', 'cream', 'curve', 'defichain', 'geist', + 'lido', 'liquity', 'mirror', 'pancakeswap', 'raydium', 'sushi', 'tarot', 'traderjoe', + 'tulip', 'ubeswap', 'uniswap', 'venus', 'yearn' + ] + kind: str + Kind/type of vault - one from list: ['lp','single','noimploss','stable'] + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + link: bool + Flag to show links + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/categories_keys/_index.md b/website/content/api/crypto/disc/categories_keys/_index.md new file mode 100644 index 000000000000..906b5bf0a952 --- /dev/null +++ b/website/content/api/crypto/disc/categories_keys/_index.md @@ -0,0 +1,6 @@ +# crypto.disc.categories_keys + +## Get underlying data +###crypto.disc.categories_keys() -> List[str] + + diff --git a/website/content/api/crypto/disc/cmctop/_index.md b/website/content/api/crypto/disc/cmctop/_index.md new file mode 100644 index 000000000000..5e87ca0e6afb --- /dev/null +++ b/website/content/api/crypto/disc/cmctop/_index.md @@ -0,0 +1,42 @@ +# crypto.disc.cmctop + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.cmctop(sortby: str = 'CMC_Rank', ascend: bool = True) -> pandas.core.frame.DataFrame + +Shows top n coins. [Source: CoinMarketCap] + + Parameters + ---------- + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + Coin Market Cap:s API documentation, see: + https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest + ascend: bool + Whether to sort ascending or descending + + Returns + ------- + pd.DataFrame + Top coin on CoinMarketCap + + +## Getting charts +###crypto.disc.cmctop(top: int = 15, sortby: str = 'CMC_Rank', ascend: bool = True, export: str = '', chart=True) -> None + +Shows top n coins. [Source: CoinMarketCap] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + Coin Market Cap:s API documentation, see: + https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + diff --git a/website/content/api/crypto/disc/coin_list/_index.md b/website/content/api/crypto/disc/coin_list/_index.md new file mode 100644 index 000000000000..e86ac710a66e --- /dev/null +++ b/website/content/api/crypto/disc/coin_list/_index.md @@ -0,0 +1,12 @@ +# crypto.disc.coin_list + +## Get underlying data +###crypto.disc.coin_list() -> pandas.core.frame.DataFrame + +Get list of coins available on CoinGecko [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Coins available on CoinGecko + Columns: id, symbol, name diff --git a/website/content/api/crypto/disc/coins/_index.md b/website/content/api/crypto/disc/coins/_index.md new file mode 100644 index 000000000000..bf8271dd6770 --- /dev/null +++ b/website/content/api/crypto/disc/coins/_index.md @@ -0,0 +1,36 @@ +# crypto.disc.coins + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.coins(limit: int = 250, category: str = '', sortby='Symbol') -> pandas.core.frame.DataFrame + +Get N coins from CoinGecko [Source: CoinGecko] + + Parameters + ---------- + limit: int + Number of top coins to grab from CoinGecko + sortby: str + Key to sort data + + Returns + ------- + pandas.DataFrame + N coins + +## Getting charts +###crypto.disc.coins(category: str, limit: int = 250, sortby: str = 'Symbol', export: str = '', chart=True) -> None + +Display top coins [Source: CoinGecko] + + Parameters + ---------- + category: str + If no category is passed it will search for all coins. (E.g., smart-contract-platform) + limit: int + Number of records to display + sortby: str + Key to sort data + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/coins_for_given_exchange/_index.md b/website/content/api/crypto/disc/coins_for_given_exchange/_index.md new file mode 100644 index 000000000000..8f7a9d0bfde6 --- /dev/null +++ b/website/content/api/crypto/disc/coins_for_given_exchange/_index.md @@ -0,0 +1,18 @@ +# crypto.disc.coins_for_given_exchange + +## Get underlying data +###crypto.disc.coins_for_given_exchange(exchange_id: str = 'binance', page: int = 1) -> dict + +Helper method to get all coins available on binance exchange [Source: CoinGecko] + + Parameters + ---------- + exchange_id: str + id of exchange + page: int + number of page. One page contains 100 records + + Returns + ------- + dict + dictionary with all trading pairs on binance diff --git a/website/content/api/crypto/disc/cpsearch/_index.md b/website/content/api/crypto/disc/cpsearch/_index.md new file mode 100644 index 000000000000..92b6bd39b845 --- /dev/null +++ b/website/content/api/crypto/disc/cpsearch/_index.md @@ -0,0 +1,52 @@ +# crypto.disc.cpsearch + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.cpsearch(query: str, category: Optional[Any] = None, modifier: Optional[Any] = None, sortby: str = 'id', ascend: bool = True) -> pandas.core.frame.DataFrame + +Search CoinPaprika. [Source: CoinPaprika] + + Parameters + ---------- + query: str + phrase for search + category: Optional[Any] + one or more categories (comma separated) to search. + Available options: currencies|exchanges|icos|people|tags + Default: currencies,exchanges,icos,people,tags + modifier: Optional[Any] + set modifier for search results. Available options: symbol_search - + search only by symbol (works for currencies only) + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see https://api.coinpaprika.com/docs#tag/Tools/paths/~1search/get) + ascend: bool + Flag to sort data descending + + Returns + ------- + pandas.DataFrame + Search Results + Columns: Metric, Value + +## Getting charts +###crypto.disc.cpsearch(query: str, category: str = 'all', top: int = 10, sortby: str = 'id', ascend: bool = True, export: str = '', chart=True) -> None + +Search over CoinPaprika. [Source: CoinPaprika] + + Parameters + ---------- + query: str + Search query + category: str + Categories to search: currencies|exchanges|icos|people|tags|all. Default: all + top: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see https://api.coinpaprika.com/docs#tag/Tools/paths/~1search/get) + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/gainers/_index.md b/website/content/api/crypto/disc/gainers/_index.md new file mode 100644 index 000000000000..caa3f9c45669 --- /dev/null +++ b/website/content/api/crypto/disc/gainers/_index.md @@ -0,0 +1,41 @@ +# crypto.disc.gainers + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.gainers(interval: str = '1h', limit: int = 50, sortby: str = 'market_cap_rank') -> pandas.core.frame.DataFrame + +Shows Largest Gainers - coins which gain the most in given period. [Source: CoinGecko] + + Parameters + ---------- + interval: str + Time interval by which data is displayed. One from [1h, 24h, 7d, 14d, 30d, 60d, 1y] + limit: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see /coins/markets in https://www.coingecko.com/en/api/documentation) + + Returns + ------- + pd.DataFrame + Top Gainers - coins which gain most in price in given period of time. + Columns: Symbol, Name, Volume, Price, %Change_{interval}, Url + +## Getting charts +###crypto.disc.gainers(interval: str = '1h', limit: int = 20, sortby: str = 'market_cap_rank', export: str = '', chart=True) -> None + +Shows Largest Gainers - coins which gain the most in given period. [Source: CoinGecko] + + Parameters + ---------- + interval: str + Time period by which data is displayed. One from [1h, 24h, 7d, 14d, 30d, 60d, 1y] + limit: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see /coins/markets in https://www.coingecko.com/en/api/documentation) + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/gainers_or_losers/_index.md b/website/content/api/crypto/disc/gainers_or_losers/_index.md new file mode 100644 index 000000000000..c76a81fb0bb5 --- /dev/null +++ b/website/content/api/crypto/disc/gainers_or_losers/_index.md @@ -0,0 +1,24 @@ +# crypto.disc.gainers_or_losers + +## Get underlying data +###crypto.disc.gainers_or_losers(limit: int = 20, interval: str = '1h', typ: str = 'gainers', sortby: str = 'market_cap') -> pandas.core.frame.DataFrame + +Returns data about top gainers - coins which gain the most in given period and + top losers - coins that lost the most in given period of time. [Source: CoinGecko] + + Parameters + ---------- + top: int + Num of coins to get + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see /coins/markets in https://www.coingecko.com/en/api/documentation) + interval: str + One from {14d,1h,1y,200d,24h,30d,7d} + typ: str + Either "gainers" or "losers" + Returns + ------- + pandas.DataFrame + Top Gainers / Top Losers - coins which gain/lost most in price in given period of time. + Columns: Symbol, Name, Volume, Price, %Change_{interval}, Url diff --git a/website/content/api/crypto/disc/losers/_index.md b/website/content/api/crypto/disc/losers/_index.md new file mode 100644 index 000000000000..dc297dbc2c1b --- /dev/null +++ b/website/content/api/crypto/disc/losers/_index.md @@ -0,0 +1,41 @@ +# crypto.disc.losers + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.losers(interval: str = '1h', limit: int = 50, sortby: str = 'market_cap_rank') -> pandas.core.frame.DataFrame + +Shows Largest Losers - coins which lose the most in given period. [Source: CoinGecko] + + Parameters + ---------- + interval: str + Time interval by which data is displayed. One from [1h, 24h, 7d, 14d, 30d, 60d, 1y] + limit: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see /coins/markets in https://www.coingecko.com/en/api/documentation) + + Returns + ------- + pd.DataFrame + Top Losers - coins which lost most in price in given period of time. + Columns: Symbol, Name, Volume, Price, %Change_{interval}, Url + +## Getting charts +###crypto.disc.losers(interval: str = '1h', limit: int = 20, export: str = '', sortby: str = 'Market Cap Rank', chart=True) -> None + +Shows Largest Losers - coins which lost the most in given period of time. [Source: CoinGecko] + + Parameters + ---------- + interval: str + Time period by which data is displayed. One from [1h, 24h, 7d, 14d, 30d, 60d, 1y] + limit: int + Number of records to display + sortby: str + Key to sort data. The table can be sorted by every of its columns. Refer to + API documentation (see /coins/markets in https://www.coingecko.com/en/api/documentation) + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/top_dapps/_index.md b/website/content/api/crypto/disc/top_dapps/_index.md new file mode 100644 index 000000000000..ee948bbb42c6 --- /dev/null +++ b/website/content/api/crypto/disc/top_dapps/_index.md @@ -0,0 +1,33 @@ +# crypto.disc.top_dapps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.top_dapps(sortby: str = '', limit: int = 10) -> pandas.core.frame.DataFrame + +Get top decentralized applications by daily volume and users [Source: https://dappradar.com/] + + Parameters + ---------- + sortby: str + Key by which to sort data + + Returns + ------- + pd.DataFrame + Top decentralized exchanges. + Columns: Name, Category, Protocols, Daily Users, Daily Volume [$] + +## Getting charts +###crypto.disc.top_dapps(limit: int = 10, export: str = '', sortby: str = '', chart=True) -> None + +Displays top decentralized exchanges [Source: https://dappradar.com/] + + Parameters + ---------- + limit: int + Number of records to display + sortby: str + Key by which to sort data + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/top_dexes/_index.md b/website/content/api/crypto/disc/top_dexes/_index.md new file mode 100644 index 000000000000..37abb5bf04d7 --- /dev/null +++ b/website/content/api/crypto/disc/top_dexes/_index.md @@ -0,0 +1,32 @@ +# crypto.disc.top_dexes + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.top_dexes(sortby: str = '', limit: int = 10) -> pandas.core.frame.DataFrame + +Get top dexes by daily volume and users [Source: https://dappradar.com/] + + Parameters + ---------- + sortby: str + Key by which to sort data + + Returns + ------- + pd.DataFrame + Top decentralized exchanges. Columns: Name, Daily Users, Daily Volume [$] + +## Getting charts +###crypto.disc.top_dexes(limit: int = 10, export: str = '', sortby: str = '', chart=True) -> None + +Displays top decentralized exchanges [Source: https://dappradar.com/] + + Parameters + ---------- + limit: int + Number of records to display + sortby: str + Key by which to sort data + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/top_games/_index.md b/website/content/api/crypto/disc/top_games/_index.md new file mode 100644 index 000000000000..cc8c5b83aa11 --- /dev/null +++ b/website/content/api/crypto/disc/top_games/_index.md @@ -0,0 +1,33 @@ +# crypto.disc.top_games + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.top_games(sortby: str = '', limit: int = 10) -> pandas.core.frame.DataFrame + +Get top blockchain games by daily volume and users [Source: https://dappradar.com/] + + Parameters + ---------- + limit: int + Number of records to display + sortby: str + Key by which to sort data + Returns + ------- + pd.DataFrame + Top blockchain games. Columns: Name, Daily Users, Daily Volume [$] + +## Getting charts +###crypto.disc.top_games(limit: int = 10, export: str = '', sortby: str = '', chart=True) -> None + +Displays top blockchain games [Source: https://dappradar.com/] + + Parameters + ---------- + limit: int + Number of records to display + sortby: str + Key by which to sort data + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/top_nfts/_index.md b/website/content/api/crypto/disc/top_nfts/_index.md new file mode 100644 index 000000000000..ebfa1e989179 --- /dev/null +++ b/website/content/api/crypto/disc/top_nfts/_index.md @@ -0,0 +1,32 @@ +# crypto.disc.top_nfts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.top_nfts(sortby: str = '', limit: int = 10) -> pandas.core.frame.DataFrame + +Get top nft collections [Source: https://dappradar.com/] + + Parameters + ---------- + sortby: str + Key by which to sort data + + Returns + ------- + pd.DataFrame + NFTs Columns: Name, Protocols, Floor Price [$], Avg Price [$], Market Cap [$], Volume [$] + +## Getting charts +###crypto.disc.top_nfts(limit: int = 10, sortby: str = '', export: str = '', chart=True) -> None + +Displays top nft collections [Source: https://dappradar.com/] + + Parameters + ---------- + limit: int + Number of records to display + sortby: str + Key by which to sort data + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/disc/trending/_index.md b/website/content/api/crypto/disc/trending/_index.md new file mode 100644 index 000000000000..583e73b63d88 --- /dev/null +++ b/website/content/api/crypto/disc/trending/_index.md @@ -0,0 +1,26 @@ +# crypto.disc.trending + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.disc.trending() -> pandas.core.frame.DataFrame + +Returns trending coins [Source: CoinGecko] + + Parameters + ---------- + + Returns + ------- + pandas.DataFrame: + Trending Coins + +## Getting charts +###crypto.disc.trending(export: str = '', chart=True) -> None + +Display trending coins [Source: CoinGecko] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/find/_index.md b/website/content/api/crypto/find/_index.md new file mode 100644 index 000000000000..66f8e94c76d3 --- /dev/null +++ b/website/content/api/crypto/find/_index.md @@ -0,0 +1,28 @@ +# crypto.find + +## Get underlying data +###crypto.find(query: 'str', source: 'str' = 'CoinGecko', key: 'str' = 'symbol', limit: 'int' = 10, export: 'str' = '') -> 'None' + +Find similar coin by coin name,symbol or id. + + If you don't know exact name or id of the Coin at CoinGecko CoinPaprika, Binance or Coinbase + you use this command to display coins with similar name, symbol or id to your search query. + Example: coin name is something like "polka". So I can try: find -c polka -k name -t 25 + It will search for coin that has similar name to polka and display top 25 matches. + + -c, --coin stands for coin - you provide here your search query + -k, --key it's a searching key. You can search by symbol, id or name of coin + -t, --top it displays top N number of records. + + Parameters + ---------- + query: str + Cryptocurrency + source: str + Data source of coins. CoinGecko (cg) or CoinPaprika (cp) or Binance (bin), Coinbase (cb) + key: str + Searching key (symbol, id, name) + limit: int + Number of records to display + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/load/_index.md b/website/content/api/crypto/load/_index.md new file mode 100644 index 000000000000..ab7d599770c9 --- /dev/null +++ b/website/content/api/crypto/load/_index.md @@ -0,0 +1,21 @@ +# crypto.load + +## Get underlying data +###crypto.load(symbol: 'str', start_date: 'datetime' = datetime.datetime(2019, 9, 16, 18, 22, 32, 850276), interval: 'str' = '1440', exchange: 'str' = 'binance', vs_currency: 'str' = 'usdt', end_date: 'datetime' = datetime.datetime(2022, 9, 20, 18, 22, 32, 850282), source: 'str' = 'ccxt') + +Load crypto currency to perform analysis on CoinGecko is used as source for price and + YahooFinance for volume. + + Parameters + ---------- + symbol: str + Coin to get + vs: str + Quote Currency (usd or eur), by default usd + days: int + Data up to number of days ago, by default 365 + + Returns + ------- + pd.DataFrame + Dataframe consisting of price and volume data diff --git a/website/content/api/crypto/nft/stats/_index.md b/website/content/api/crypto/nft/stats/_index.md new file mode 100644 index 000000000000..2c2d33d3a249 --- /dev/null +++ b/website/content/api/crypto/nft/stats/_index.md @@ -0,0 +1,31 @@ +# crypto.nft.stats + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.nft.stats(slug: str) -> pandas.core.frame.DataFrame + +Get stats of a nft collection [Source: opensea.io] + + Parameters + ------- + slug : str + Opensea collection slug. If the name of the collection is Mutant Ape Yacht Club the slug is mutant-ape-yacht-club + + Returns + ------- + pd.DataFrame + collection stats + +## Getting charts +###crypto.nft.stats(slug: str, export: str, chart=True) + +Display collection stats. [Source: opensea.io] + + Parameters + ---------- + slug: str + Opensea collection slug. + If the name of the collection is Mutant Ape Yacht Club the slug is mutant-ape-yacht-club + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/baas/_index.md b/website/content/api/crypto/onchain/baas/_index.md new file mode 100644 index 000000000000..bfa4adb60819 --- /dev/null +++ b/website/content/api/crypto/onchain/baas/_index.md @@ -0,0 +1,53 @@ +# crypto.onchain.baas + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.baas(symbol: str = 'WETH', vs: str = 'USDT', limit: int = 30, sortby: str = 'tradeAmount', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get an average bid and ask prices, average spread for given crypto pair for chosen time period. + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + limit: int + Last n days to query data + symbol: str + ERC20 token symbol + vs: str + Quoted currency. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Average bid and ask prices, spread for given crypto pair for chosen time period + +## Getting charts +###crypto.onchain.baas(symbol='ETH', vs='USDC', days: int = 10, sortby: str = 'date', ascend: bool = True, export: str = '', chart=True) -> None + +Display an average bid and ask prices, average spread for given crypto pair for chosen + time period. [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + days: int + Last n days to query data + symbol: str + ERC20 token symbol + vs: str + Quoted currency. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + + Returns + ------- + pd.DataFrame + Average bid and ask prices, spread for given crypto pair for chosen time period diff --git a/website/content/api/crypto/onchain/balance/_index.md b/website/content/api/crypto/onchain/balance/_index.md new file mode 100644 index 000000000000..6f67848f58a8 --- /dev/null +++ b/website/content/api/crypto/onchain/balance/_index.md @@ -0,0 +1,42 @@ +# crypto.onchain.balance + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.balance(address: str, sortby: str = 'index', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get info about tokens on you ethereum blockchain balance. Eth balance, balance of all tokens which + have name and symbol. [Source: Ethplorer] + + Parameters + ---------- + address: str + Blockchain balance e.g. 0x3cD751E6b0078Be393132286c442345e5DC49699 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + + Returns + ------- + pd.DataFrame: + DataFrame with list of tokens and their balances. + +## Getting charts +###crypto.onchain.balance(address: str, top: int = 15, sortby: str = 'index', ascend: bool = False, export: str = '', chart=True) -> None + +Display info about tokens for given ethereum blockchain balance e.g. ETH balance, + balance of all tokens with name and symbol. [Source: Ethplorer] + + Parameters + ---------- + address: str + Ethereum balance. + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/btc_supply/_index.md b/website/content/api/crypto/onchain/btc_supply/_index.md new file mode 100644 index 000000000000..6164b82db873 --- /dev/null +++ b/website/content/api/crypto/onchain/btc_supply/_index.md @@ -0,0 +1,29 @@ +# crypto.onchain.btc_supply + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.btc_supply() -> pandas.core.frame.DataFrame + +Returns BTC circulating supply [Source: https://api.blockchain.info/] + + Returns + ------- + pd.DataFrame + BTC circulating supply + +## Getting charts +###crypto.onchain.btc_supply(since: int = 1262304000, until: int = 1663694553, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Returns BTC circulating supply [Source: https://api.blockchain.info/] + + Parameters + ---------- + since : int + Initial date timestamp (e.g., 1_609_459_200) + until : int + End date timestamp (e.g., 1_641_588_030) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/onchain/btc_transac/_index.md b/website/content/api/crypto/onchain/btc_transac/_index.md new file mode 100644 index 000000000000..4b126329bd1e --- /dev/null +++ b/website/content/api/crypto/onchain/btc_transac/_index.md @@ -0,0 +1,29 @@ +# crypto.onchain.btc_transac + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.btc_transac() -> pandas.core.frame.DataFrame + +Returns BTC confirmed transactions [Source: https://api.blockchain.info/] + + Returns + ------- + pd.DataFrame + BTC confirmed transactions + +## Getting charts +###crypto.onchain.btc_transac(since: int = 1262304000, until: int = 1663694553, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Returns BTC confirmed transactions [Source: https://api.blockchain.info/] + + Parameters + ---------- + since : int + Initial date timestamp (e.g., 1_609_459_200) + until : int + End date timestamp (e.g., 1_641_588_030) + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/onchain/dex_trades_monthly/_index.md b/website/content/api/crypto/onchain/dex_trades_monthly/_index.md new file mode 100644 index 000000000000..1553500fe5ce --- /dev/null +++ b/website/content/api/crypto/onchain/dex_trades_monthly/_index.md @@ -0,0 +1,22 @@ +# crypto.onchain.dex_trades_monthly + +## Get underlying data +###crypto.onchain.dex_trades_monthly(trade_amount_currency: str = 'USD', limit: int = 90, ascend: bool = True) -> pandas.core.frame.DataFrame + +Get list of trades on Decentralized Exchanges monthly aggregated. + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + trade_amount_currency: str + Currency of displayed trade amount. Default: USD + limit: int + Last n days to query data. Maximum 365 (bigger numbers can cause timeouts + on server side) + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Trades on Decentralized Exchanges monthly aggregated diff --git a/website/content/api/crypto/onchain/dvcp/_index.md b/website/content/api/crypto/onchain/dvcp/_index.md new file mode 100644 index 000000000000..c38eea83ed47 --- /dev/null +++ b/website/content/api/crypto/onchain/dvcp/_index.md @@ -0,0 +1,52 @@ +# crypto.onchain.dvcp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.dvcp(limit: int = 100, symbol: str = 'UNI', vs: str = 'USDT', sortby: str = 'date', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get daily volume for given pair [Source: https://graphql.bitquery.io/] + + Parameters + ------- + limit: int + Last n days to query data + symbol: str + ERC20 token symbol + vs: str + Quote currency. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Daily volume for given pair + +## Getting charts +###crypto.onchain.dvcp(symbol: str = 'WBTC', vs: str = 'USDT', top: int = 20, sortby: str = 'date', ascend: bool = True, export: str = '', chart=True) -> None + +Display daily volume for given pair + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + symbol: str + ERC20 token symbol or address + vs: str + Quote currency. + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + + Returns + ------- + pd.DataFrame + Token volume on different decentralized exchanges diff --git a/website/content/api/crypto/onchain/erc20_tokens/_index.md b/website/content/api/crypto/onchain/erc20_tokens/_index.md new file mode 100644 index 000000000000..3397f89802fe --- /dev/null +++ b/website/content/api/crypto/onchain/erc20_tokens/_index.md @@ -0,0 +1,12 @@ +# crypto.onchain.erc20_tokens + +## Get underlying data +###crypto.onchain.erc20_tokens() -> pandas.core.frame.DataFrame + +Helper method that loads ~1500 most traded erc20 token. + [Source: json file] + + Returns + ------- + pd.DataFrame + ERC20 tokens with address, symbol and name diff --git a/website/content/api/crypto/onchain/gwei/_index.md b/website/content/api/crypto/onchain/gwei/_index.md new file mode 100644 index 000000000000..570c199ee03f --- /dev/null +++ b/website/content/api/crypto/onchain/gwei/_index.md @@ -0,0 +1,31 @@ +# crypto.onchain.gwei + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.gwei() -> pandas.core.frame.DataFrame + +Returns the most recent Ethereum gas fees in gwei + [Source: https://ethgasstation.info] + + Parameters + ---------- + + Returns + ------- + pd.DataFrame + four gas fees and durations + (fees for slow, average, fast and + fastest transactions in gwei and + its average durations in seconds) + +## Getting charts +###crypto.onchain.gwei(export: str = '', chart=True) -> None + +Current gwei fees + [Source: https://ethgasstation.info] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/hist/_index.md b/website/content/api/crypto/onchain/hist/_index.md new file mode 100644 index 000000000000..cc2c82f07bc6 --- /dev/null +++ b/website/content/api/crypto/onchain/hist/_index.md @@ -0,0 +1,40 @@ +# crypto.onchain.hist + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.hist(address, sortby: str = 'timestamp', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get information about balance historical transactions. [Source: Ethplorer] + + Parameters + ---------- + address: str + Blockchain balance e.g. 0x3cD751E6b0078Be393132286c442345e5DC49699 + sortby: str + Key to sort by. + ascend: str + Sort in ascending order. + + Returns + ------- + pd.DataFrame: + DataFrame with balance historical transactions (last 100) + +## Getting charts +###crypto.onchain.hist(address: str, top: int = 10, sortby: str = 'timestamp', ascend: bool = True, export: str = '', chart=True) -> None + +Display information about balance historical transactions. [Source: Ethplorer] + + Parameters + ---------- + address: str + Ethereum blockchain balance e.g. 0x3cD751E6b0078Be393132286c442345e5DC49699 + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in ascending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/holders/_index.md b/website/content/api/crypto/onchain/holders/_index.md new file mode 100644 index 000000000000..168f67d22437 --- /dev/null +++ b/website/content/api/crypto/onchain/holders/_index.md @@ -0,0 +1,40 @@ +# crypto.onchain.holders + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.holders(address, sortby: str = 'balance', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get info about top token holders. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + + Returns + ------- + pd.DataFrame: + DataFrame with list of top token holders. + +## Getting charts +###crypto.onchain.holders(address: str, top: int = 10, sortby: str = 'balance', ascend: bool = True, export: str = '', chart=True) -> None + +Display info about top ERC20 token holders. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/info/_index.md b/website/content/api/crypto/onchain/info/_index.md new file mode 100644 index 000000000000..d3af6a009474 --- /dev/null +++ b/website/content/api/crypto/onchain/info/_index.md @@ -0,0 +1,32 @@ +# crypto.onchain.info + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.info(address) -> pandas.core.frame.DataFrame + +Get info about ERC20 token. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + + Returns + ------- + pd.DataFrame: + DataFrame with information about provided ERC20 token. + +## Getting charts +###crypto.onchain.info(address: str, social: bool = False, export: str = '', chart=True) -> None + +Display info about ERC20 token. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + social: bool + Flag to display social media links + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/lt/_index.md b/website/content/api/crypto/onchain/lt/_index.md new file mode 100644 index 000000000000..621ced8e776e --- /dev/null +++ b/website/content/api/crypto/onchain/lt/_index.md @@ -0,0 +1,49 @@ +# crypto.onchain.lt + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.lt(trade_amount_currency: str = 'USD', limit: int = 90, sortby: str = 'tradeAmount', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get trades on Decentralized Exchanges aggregated by DEX [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + trade_amount_currency: str + Currency of displayed trade amount. Default: USD + limit: int + Last n days to query data. Maximum 365 (bigger numbers can cause timeouts + on server side) + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Trades on Decentralized Exchanges aggregated by DEX + +## Getting charts +###crypto.onchain.lt(trade_amount_currency: str = 'USD', kind: str = 'dex', top: int = 20, days: int = 90, sortby: str = 'tradeAmount', ascend: bool = True, export: str = '', chart=True) -> None + +Trades on Decentralized Exchanges aggregated by DEX or Month + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + kind: str + Aggregate trades by dex or time + trade_amount_currency: str + Currency of displayed trade amount. Default: USD + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + days: int + Last n days to query data. Maximum 365 (bigger numbers can cause timeouts + on server side) + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/prices/_index.md b/website/content/api/crypto/onchain/prices/_index.md new file mode 100644 index 000000000000..33b0ca990119 --- /dev/null +++ b/website/content/api/crypto/onchain/prices/_index.md @@ -0,0 +1,41 @@ +# crypto.onchain.prices + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.prices(address, sortby: str = 'date', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get token historical prices with volume and market cap, and average price. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token e.g. 0xf3db5fa2c66b7af3eb0c0b782510816cbe4813b8 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + + Returns + ------- + pd.DataFrame: + DataFrame with token historical prices. + +## Getting charts +###crypto.onchain.prices(address: str, top: int = 30, sortby: str = 'date', ascend: bool = False, export: str = '', chart=True) -> None + +Display token historical prices with volume and market cap, and average price. + [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/query_graph/_index.md b/website/content/api/crypto/onchain/query_graph/_index.md new file mode 100644 index 000000000000..8b863de081c6 --- /dev/null +++ b/website/content/api/crypto/onchain/query_graph/_index.md @@ -0,0 +1,18 @@ +# crypto.onchain.query_graph + +## Get underlying data +###crypto.onchain.query_graph(url: str, query: str) -> dict + +Helper methods for querying graphql api. [Source: https://bitquery.io/] + + Parameters + ---------- + url: str + Endpoint url + query: str + Graphql query + + Returns + ------- + dict: + Dictionary with response data diff --git a/website/content/api/crypto/onchain/th/_index.md b/website/content/api/crypto/onchain/th/_index.md new file mode 100644 index 000000000000..8c9e7aeb01cc --- /dev/null +++ b/website/content/api/crypto/onchain/th/_index.md @@ -0,0 +1,42 @@ +# crypto.onchain.th + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.th(address, sortby: str = 'timestamp', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get info about token historical transactions. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token e.g. 0xf3db5fa2c66b7af3eb0c0b782510816cbe4813b8 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + + Returns + ------- + pd.DataFrame: + DataFrame with token historical transactions. + +## Getting charts +###crypto.onchain.th(address: str, top: int = 10, sortby: str = 'timestamp', ascend: bool = False, hash_: bool = False, export: str = '', chart=True) -> None + +Display info about token history. [Source: Ethplorer] + + Parameters + ---------- + address: str + Token balance e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + hash_: bool, + Flag to show transaction hash. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/token_decimals/_index.md b/website/content/api/crypto/onchain/token_decimals/_index.md new file mode 100644 index 000000000000..5d1a4c5386dd --- /dev/null +++ b/website/content/api/crypto/onchain/token_decimals/_index.md @@ -0,0 +1,16 @@ +# crypto.onchain.token_decimals + +## Get underlying data +###crypto.onchain.token_decimals(address: str) -> Optional[int] + +Helper methods that gets token decimals number. [Source: Ethplorer] + + Parameters + ---------- + address: str + Blockchain balance e.g. 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 + + Returns + ------- + pd.DataFrame: + DataFrame with list of tokens and their balances. diff --git a/website/content/api/crypto/onchain/top/_index.md b/website/content/api/crypto/onchain/top/_index.md new file mode 100644 index 000000000000..562cb735d796 --- /dev/null +++ b/website/content/api/crypto/onchain/top/_index.md @@ -0,0 +1,29 @@ +# crypto.onchain.top + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.top(sortby: str = 'rank', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get top 50 tokens. [Source: Ethplorer] + + Returns + ------- + pd.DataFrame: + DataFrame with list of top 50 tokens. + +## Getting charts +###crypto.onchain.top(top: int = 15, sortby: str = 'rank', ascend: bool = True, export: str = '', chart=True) -> None + +Display top ERC20 tokens [Source: Ethplorer] + + Parameters + ---------- + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in descending order. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/ttcp/_index.md b/website/content/api/crypto/onchain/ttcp/_index.md new file mode 100644 index 000000000000..fd1ce184bdc7 --- /dev/null +++ b/website/content/api/crypto/onchain/ttcp/_index.md @@ -0,0 +1,49 @@ +# crypto.onchain.ttcp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.ttcp(network: str = 'ethereum', exchange: str = 'Uniswap', limit: int = 90, sortby: str = 'tradeAmount', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get most traded crypto pairs on given decentralized exchange in chosen time period. + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + network: str + EVM network. One from list: bsc (binance smart chain), ethereum or matic + exchange: + Decentralized exchange name + limit: + Number of days taken into calculation account. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + + +## Getting charts +###crypto.onchain.ttcp(exchange='Uniswap', days: int = 10, top: int = 10, sortby: str = 'tradeAmount', ascend: bool = True, export: str = '', chart=True) -> None + +Display most traded crypto pairs on given decentralized exchange in chosen time period. + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + exchange: + Decentralized exchange name + days: + Number of days taken into calculation account. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + Returns + ------- + pd.DataFrame + Most traded crypto pairs on given decentralized exchange in chosen time period. diff --git a/website/content/api/crypto/onchain/tv/_index.md b/website/content/api/crypto/onchain/tv/_index.md new file mode 100644 index 000000000000..6e0db710cd15 --- /dev/null +++ b/website/content/api/crypto/onchain/tv/_index.md @@ -0,0 +1,49 @@ +# crypto.onchain.tv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.tv(symbol: str = 'UNI', trade_amount_currency: str = 'USD', sortby: str = 'tradeAmount', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get token volume on different Decentralized Exchanges. [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + symbol: str + ERC20 token symbol. + trade_amount_currency: str + Currency to display trade amount in. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Token volume on Decentralized Exchanges + +## Getting charts +###crypto.onchain.tv(symbol: str = 'WBTC', trade_amount_currency: str = 'USD', top: int = 10, sortby: str = 'tradeAmount', ascend: bool = True, export: str = '', chart=True) -> None + +Display token volume on different Decentralized Exchanges. + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + symbol: str + ERC20 token symbol or address + trade_amount_currency: str + Currency of displayed trade amount. Default: USD + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + Returns + ------- + pd.DataFrame + Token volume on different decentralized exchanges diff --git a/website/content/api/crypto/onchain/tx/_index.md b/website/content/api/crypto/onchain/tx/_index.md new file mode 100644 index 000000000000..ce60a688b26e --- /dev/null +++ b/website/content/api/crypto/onchain/tx/_index.md @@ -0,0 +1,30 @@ +# crypto.onchain.tx + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.tx(tx_hash) -> pandas.core.frame.DataFrame + +Get info about transaction. [Source: Ethplorer] + + Parameters + ---------- + tx_hash: str + Transaction hash e.g. 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6 + + Returns + ------- + pd.DataFrame: + DataFrame with information about ERC20 token transaction. + +## Getting charts +###crypto.onchain.tx(tx_hash: str, export: str = '', chart=True) -> None + +Display info about transaction. [Source: Ethplorer] + + Parameters + ---------- + tx_hash: str + Transaction hash e.g. 0x9dc7b43ad4288c624fdd236b2ecb9f2b81c93e706b2ffd1d19b112c1df7849e6 + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/onchain/ueat/_index.md b/website/content/api/crypto/onchain/ueat/_index.md new file mode 100644 index 000000000000..736cceb23e95 --- /dev/null +++ b/website/content/api/crypto/onchain/ueat/_index.md @@ -0,0 +1,51 @@ +# crypto.onchain.ueat + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.ueat(interval: str = 'day', limit: int = 90, sortby: str = 'tradeAmount', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get number of unique ethereum addresses which made a transaction in given time interval. + + Parameters + ---------- + interval: str + Time interval in which count unique ethereum addresses which made transaction. day, + month or week. + limit: int + Number of records for data query. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pd.DataFrame + Unique ethereum addresses which made a transaction + +## Getting charts +###crypto.onchain.ueat(interval: str = 'days', limit: int = 10, sortby: str = 'date', ascend: bool = True, export: str = '', chart=True) -> None + +Display number of unique ethereum addresses which made a transaction in given time interval + [Source: https://graphql.bitquery.io/] + + Parameters + ---------- + interval: str + Time interval in which ethereum address made transaction. month, week or day + limit: int + Number of records to display. It's calculated base on provided interval. + If interval is month then calculation is made in the way: limit * 30 = time period, + in case if interval is set to week, then time period is calculated as limit * 7. + For better user experience maximum time period in days is equal to 90. + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + Returns + ------- + pd.DataFrame + Number of unique ethereum addresses which made a transaction in given time interval diff --git a/website/content/api/crypto/onchain/whales/_index.md b/website/content/api/crypto/onchain/whales/_index.md new file mode 100644 index 000000000000..2111457df6e1 --- /dev/null +++ b/website/content/api/crypto/onchain/whales/_index.md @@ -0,0 +1,45 @@ +# crypto.onchain.whales + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.onchain.whales(min_value: int = 800000, limit: int = 100, sortby: str = 'date', ascend: bool = False) -> pandas.core.frame.DataFrame + +Whale Alert's API allows you to retrieve live and historical transaction data from major blockchains. + Supported blockchain: Bitcoin, Ethereum, Ripple, NEO, EOS, Stellar and Tron. [Source: https://docs.whale-alert.io/] + + Parameters + ---------- + min_value: int + Minimum value of trade to track. + limit: int + Limit of transactions. Max 100 + sortby: str + Key to sort by. + ascend: str + Sort in ascending order. + + Returns + ------- + pd.DataFrame + Crypto wales transactions + +## Getting charts +###crypto.onchain.whales(min_value: int = 800000, top: int = 100, sortby: str = 'date', ascend: bool = False, show_address: bool = False, export: str = '', chart=True) -> None + +Display huge value transactions from major blockchains. [Source: https://docs.whale-alert.io/] + + Parameters + ---------- + min_value: int + Minimum value of trade to track. + top: int + Limit of transactions. Maximum 100 + sortby: str + Key to sort by. + ascend: str + Sort in ascending order. + show_address: bool + Flag to show addresses of transactions. + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/altindex/_index.md b/website/content/api/crypto/ov/altindex/_index.md new file mode 100644 index 000000000000..2e1707cda429 --- /dev/null +++ b/website/content/api/crypto/ov/altindex/_index.md @@ -0,0 +1,46 @@ +# crypto.ov.altindex + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.altindex(period: int = 30, since: int = 1262304000, until: int = 1663694553) -> pandas.core.frame.DataFrame + +Get altcoin index overtime + [Source: https://blockchaincenter.net] + + Parameters + ---------- + period: int + Number of days {30,90,365} to check performance of coins and calculate the altcoin index. + E.g., 365 checks yearly performance, 90 will check seasonal performance (90 days), + 30 will check monthly performance (30 days). + since : int + Initial date timestamp (e.g., 1_609_459_200) + until : int + End date timestamp (e.g., 1_641_588_030) + + Returns + ------- + pandas.DataFrame: + Date, Value (Altcoin Index) + +## Getting charts +###crypto.ov.altindex(period: int = 365, since: int = 1262304000, until: int = 1663694553, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays altcoin index overtime + [Source: https://blockchaincenter.net] + + Parameters + ---------- + since : int + Initial date timestamp (e.g., 1_609_459_200) + until : int + End date timestamp (e.g., 1_641_588_030) + period: int + Number of days to check the performance of coins and calculate the altcoin index. + E.g., 365 will check yearly performance , 90 will check seasonal performance (90 days), + 30 will check monthly performance (30 days). + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/ov/cbpairs/_index.md b/website/content/api/crypto/ov/cbpairs/_index.md new file mode 100644 index 000000000000..70cc8e28a4a4 --- /dev/null +++ b/website/content/api/crypto/ov/cbpairs/_index.md @@ -0,0 +1,43 @@ +# crypto.ov.cbpairs + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cbpairs(top: int = 50, sortby: str = 'quote_increment', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get a list of available currency pairs for trading. [Source: Coinbase] + + base_min_size - min order size + base_max_size - max order size + min_market_funds - min funds allowed in a market order. + max_market_funds - max funds allowed in a market order. + + Parameters + ---------- + top: int + Top n of pairs + sortby: str + Key to sortby data + ascend: bool + Sort descending flag + + Returns + ------- + pd.DataFrame + Available trading pairs on Coinbase + +## Getting charts +###crypto.ov.cbpairs(top: int = 20, sortby: str = 'quote_increment', ascend: bool = True, export: str = '', chart=True) -> None + +Displays a list of available currency pairs for trading. [Source: Coinbase] + + Parameters + ---------- + top: int + Top n of pairs + sortby: str + Key to sortby data + ascend: bool + Sort ascending flag + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgcategories/_index.md b/website/content/api/crypto/ov/cgcategories/_index.md new file mode 100644 index 000000000000..66de1f014076 --- /dev/null +++ b/website/content/api/crypto/ov/cgcategories/_index.md @@ -0,0 +1,31 @@ +# crypto.ov.cgcategories + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgcategories(sort_filter: str = 'market_cap_desc') -> pandas.core.frame.DataFrame + +Returns top crypto categories [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Rank, Name, Change_1h, Change_7d, Market_Cap, Volume_24h,Coins, Url + +## Getting charts +###crypto.ov.cgcategories(sortby: str = 'market_cap_desc', top: int = 15, export: str = '', pie: bool = False, chart=True) -> None + +Shows top cryptocurrency categories by market capitalization + + The cryptocurrency category ranking is based on market capitalization. [Source: CoinGecko] + + Parameters + ---------- + sortby: str + Key by which to sort data + top: int + Number of records to display + export: str + Export dataframe data to csv,json,xlsx file + pie: bool + Whether to show the pie chart diff --git a/website/content/api/crypto/ov/cgdefi/_index.md b/website/content/api/crypto/ov/cgdefi/_index.md new file mode 100644 index 000000000000..552a0f7883d1 --- /dev/null +++ b/website/content/api/crypto/ov/cgdefi/_index.md @@ -0,0 +1,23 @@ +# crypto.ov.cgdefi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgdefi() -> pandas.core.frame.DataFrame + +Get global statistics about Decentralized Finances [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Metric, Value + +## Getting charts +###crypto.ov.cgdefi(export: str = '', chart=True) -> None + +Shows global statistics about Decentralized Finances. [Source: CoinGecko] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgderivatives/_index.md b/website/content/api/crypto/ov/cgderivatives/_index.md new file mode 100644 index 000000000000..129da5b63156 --- /dev/null +++ b/website/content/api/crypto/ov/cgderivatives/_index.md @@ -0,0 +1,37 @@ +# crypto.ov.cgderivatives + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgderivatives(sortby: str = 'Rank', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get list of crypto derivatives from CoinGecko API [Source: CoinGecko] + + Parameters + ---------- + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + + Returns + ------- + pandas.DataFrame + Rank, Market, Symbol, Price, Pct_Change_24h, Contract_Type, Basis, Spread, + Funding_Rate, Volume_24h, + +## Getting charts +###crypto.ov.cgderivatives(sortby: str = 'Rank', ascend: bool = False, top: int = 15, export: str = '', chart=True) -> None + +Shows list of crypto derivatives. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgexrates/_index.md b/website/content/api/crypto/ov/cgexrates/_index.md new file mode 100644 index 000000000000..be72027763fc --- /dev/null +++ b/website/content/api/crypto/ov/cgexrates/_index.md @@ -0,0 +1,36 @@ +# crypto.ov.cgexrates + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgexrates(sortby: str = 'Name', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get list of crypto, fiats, commodity exchange rates from CoinGecko API [Source: CoinGecko] + + Parameters + ---------- + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + Index, Name, Unit, Value, Type + +## Getting charts +###crypto.ov.cgexrates(sortby: str = 'Name', ascend: bool = False, top: int = 15, export: str = '', chart=True) -> None + +Shows list of crypto, fiats, commodity exchange rates. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgglobal/_index.md b/website/content/api/crypto/ov/cgglobal/_index.md new file mode 100644 index 000000000000..33fbb807733f --- /dev/null +++ b/website/content/api/crypto/ov/cgglobal/_index.md @@ -0,0 +1,33 @@ +# crypto.ov.cgglobal + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgglobal() -> pandas.core.frame.DataFrame + +Get global statistics about crypto markets from CoinGecko API like: + Market_Cap, Volume, Market_Cap_Percentage + + [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Market_Cap, Volume, Market_Cap_Percentage + +## Getting charts +###crypto.ov.cgglobal(pie: bool = False, export: str = '', chart=True) -> None + +Shows global statistics about crypto. [Source: CoinGecko] + - market cap change + - number of markets + - icos + - number of active crypto + - market_cap_pct + + Parameters + ---------- + pie: bool + Whether to show a pie chart + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cghm/_index.md b/website/content/api/crypto/ov/cghm/_index.md new file mode 100644 index 000000000000..66c3e8af9d2c --- /dev/null +++ b/website/content/api/crypto/ov/cghm/_index.md @@ -0,0 +1,36 @@ +# crypto.ov.cghm + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cghm(limit: int = 250, category: str = '', sortby='Symbol') -> pandas.core.frame.DataFrame + +Get N coins from CoinGecko [Source: CoinGecko] + + Parameters + ---------- + limit: int + Number of top coins to grab from CoinGecko + sortby: str + Key to sort data + + Returns + ------- + pandas.DataFrame + N coins + +## Getting charts +###crypto.ov.cghm(category: str = '', top: int = 15, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Shows cryptocurrencies heatmap [Source: CoinGecko] + + Parameters + ---------- + caterogy: str + Category (e.g., stablecoins). Empty for no category (default: ) + top: int + Number of top cryptocurrencies to display + export: str + Export dataframe data to csv,json,xlsx + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/crypto/ov/cghold/_index.md b/website/content/api/crypto/ov/cghold/_index.md new file mode 100644 index 000000000000..7c65bf0f23af --- /dev/null +++ b/website/content/api/crypto/ov/cghold/_index.md @@ -0,0 +1,35 @@ +# crypto.ov.cghold + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cghold(endpoint: str = 'bitcoin') -> List[Any] + +Returns public companies that holds ethereum or bitcoin [Source: CoinGecko] + + Parameters + ---------- + endpoint : str + "bitcoin" or "ethereum" + + Returns + ------- + List: + - str: Overall statistics + - pandas.DataFrame: Companies holding crypto + +## Getting charts +###crypto.ov.cghold(symbol: str, show_bar: bool = False, export: str = '', top: int = 15, chart=True) -> None + +Shows overview of public companies that holds ethereum or bitcoin. [Source: CoinGecko] + + Parameters + ---------- + symbol: str + Cryptocurrency: ethereum or bitcoin + show_bar : bool + Whether to show a bar graph for the data + export: str + Export dataframe data to csv,json,xlsx + top: int + The number of rows to show diff --git a/website/content/api/crypto/ov/cgindexes/_index.md b/website/content/api/crypto/ov/cgindexes/_index.md new file mode 100644 index 000000000000..01e6af6ea2fd --- /dev/null +++ b/website/content/api/crypto/ov/cgindexes/_index.md @@ -0,0 +1,33 @@ +# crypto.ov.cgindexes + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgindexes(sortby: str = 'Name', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get list of crypto indexes from CoinGecko API [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Name, Id, Market, Last, MultiAsset + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + +## Getting charts +###crypto.ov.cgindexes(sortby: str = 'Name', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +Shows list of crypto indexes. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgproducts/_index.md b/website/content/api/crypto/ov/cgproducts/_index.md new file mode 100644 index 000000000000..1e5929232ab1 --- /dev/null +++ b/website/content/api/crypto/ov/cgproducts/_index.md @@ -0,0 +1,36 @@ +# crypto.ov.cgproducts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgproducts(sortby: str = 'Name', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get list of financial products from CoinGecko API + + Parameters + ---------- + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + Rank, Platform, Identifier, Supply_Rate, Borrow_Rate + +## Getting charts +###crypto.ov.cgproducts(sortby: str = 'Platform', ascend: bool = False, top: int = 15, export: str = '', chart=True) -> None + +Shows list of financial products. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cgstables/_index.md b/website/content/api/crypto/ov/cgstables/_index.md new file mode 100644 index 000000000000..4b8ca9444942 --- /dev/null +++ b/website/content/api/crypto/ov/cgstables/_index.md @@ -0,0 +1,40 @@ +# crypto.ov.cgstables + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cgstables(top: int = 20, sortby: str = 'rank', ascend: bool = False) -> pandas.core.frame.DataFrame + +Returns top stable coins [Source: CoinGecko] + + Parameters + ---------- + top: int + How many rows to show + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + Rank, Name, Symbol, Price, Change_24h, Exchanges, Market_Cap, Change_30d, Url + +## Getting charts +###crypto.ov.cgstables(top: int = 15, export: str = '', sortby: str = 'rank', ascend: bool = False, pie: bool = False, chart=True) -> None + +Shows stablecoins data [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file + pie : bool + Whether to show a pie chart diff --git a/website/content/api/crypto/ov/cpcontracts/_index.md b/website/content/api/crypto/ov/cpcontracts/_index.md new file mode 100644 index 000000000000..bc943c0b5b0a --- /dev/null +++ b/website/content/api/crypto/ov/cpcontracts/_index.md @@ -0,0 +1,39 @@ +# crypto.ov.cpcontracts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpcontracts(platform_id: str = 'eth-ethereum', sortby: str = 'active', ascend: bool = True) -> pandas.core.frame.DataFrame + +Gets all contract addresses for given platform [Source: CoinPaprika] + Parameters + ---------- + platform_id: str + Blockchain platform like eth-ethereum + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascend + + Returns + ------- + pandas.DataFrame + id, type, active + +## Getting charts +###crypto.ov.cpcontracts(symbol: str, sortby: str = 'active', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +Gets all contract addresses for given platform. [Source: CoinPaprika] + + Parameters + ---------- + platform: str + Blockchain platform like eth-ethereum + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cpexchanges/_index.md b/website/content/api/crypto/ov/cpexchanges/_index.md new file mode 100644 index 000000000000..63f326a19fae --- /dev/null +++ b/website/content/api/crypto/ov/cpexchanges/_index.md @@ -0,0 +1,45 @@ +# crypto.ov.cpexchanges + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpexchanges(symbols: str = 'USD', sortby: str = 'rank', ascend: bool = True) -> pandas.core.frame.DataFrame + + + List exchanges from CoinPaprika API [Source: CoinPaprika] + + Parameters + ---------- + symbols: str + Comma separated quotes to return e.g quotes=USD,BTC + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascend + + Returns + ------- + pandas.DataFrame + rank, name, currencies, markets, fiats, confidence_score, reported_volume_24h, + reported_volume_7d ,reported_volume_30d, sessions_per_month, + +## Getting charts +###crypto.ov.cpexchanges(symbol: str, sortby: str = 'rank', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +List exchanges from CoinPaprika API. [Source: CoinPaprika] + + Parameters + ---------- + currency: str + Quoted currency + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file + diff --git a/website/content/api/crypto/ov/cpexmarkets/_index.md b/website/content/api/crypto/ov/cpexmarkets/_index.md new file mode 100644 index 000000000000..1e83ce146705 --- /dev/null +++ b/website/content/api/crypto/ov/cpexmarkets/_index.md @@ -0,0 +1,45 @@ +# crypto.ov.cpexmarkets + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpexmarkets(exchange_id: str = 'binance', symbols: str = 'USD', sortby: str = 'pair', ascend: bool = True) -> pandas.core.frame.DataFrame + +List markets by exchange ID [Source: CoinPaprika] + + Parameters + ---------- + exchange_id: str + identifier of exchange e.g for Binance Exchange -> binance + symbols: str + Comma separated quotes to return e.g quotes=USD,BTC + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + pair, base_currency_name, quote_currency_name, market_url, + category, reported_volume_24h_share, trust_score, + +## Getting charts +###crypto.ov.cpexmarkets(exchange: str = 'binance', sortby: str = 'pair', ascend: bool = True, top: int = 15, links: bool = False, export: str = '', chart=True) -> None + +Get all markets for given exchange [Source: CoinPaprika] + + Parameters + ---------- + exchange: str + Exchange identifier e.g Binance + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cpglobal/_index.md b/website/content/api/crypto/ov/cpglobal/_index.md new file mode 100644 index 000000000000..737f90427abd --- /dev/null +++ b/website/content/api/crypto/ov/cpglobal/_index.md @@ -0,0 +1,30 @@ +# crypto.ov.cpglobal + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpglobal() -> pandas.core.frame.DataFrame + +Return data frame with most important global crypto statistics like: + market_cap_usd, volume_24h_usd, bitcoin_dominance_percentage, cryptocurrencies_number, + market_cap_ath_value, market_cap_ath_date, volume_24h_ath_value, volume_24h_ath_date, + market_cap_change_24h, volume_24h_change_24h, last_updated. [Source: CoinPaprika] + + Returns + ------- + pandas.DataFrame + Most important global crypto statistics + Metric, Value + +## Getting charts +###crypto.ov.cpglobal(export: str = '', chart=True) -> None + +Return data frame with most important global crypto statistics like: + market_cap_usd, volume_24h_usd, bitcoin_dominance_percentage, cryptocurrencies_number, + market_cap_ath_value, market_cap_ath_date, volume_24h_ath_value, volume_24h_ath_date, + market_cap_change_24h, volume_24h_change_24h, last_updated [Source: CoinPaprika] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cpinfo/_index.md b/website/content/api/crypto/ov/cpinfo/_index.md new file mode 100644 index 000000000000..6130d08a31db --- /dev/null +++ b/website/content/api/crypto/ov/cpinfo/_index.md @@ -0,0 +1,43 @@ +# crypto.ov.cpinfo + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpinfo(symbols: str = 'USD', sortby: str = 'rank', ascend: bool = True) -> pandas.core.frame.DataFrame + +Returns basic coin information for all coins from CoinPaprika API [Source: CoinPaprika] + + Parameters + ---------- + symbols: str + Comma separated quotes to return e.g quotes=USD,BTC + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + + Returns + ------- + pandas.DataFrame + rank, name, symbol, price, volume_24h, circulating_supply, total_supply, + max_supply, market_cap, beta_value, ath_price, + +## Getting charts +###crypto.ov.cpinfo(symbol: str, sortby: str = 'rank', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +Displays basic coin information for all coins from CoinPaprika API. [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Quoted currency + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cpmarkets/_index.md b/website/content/api/crypto/ov/cpmarkets/_index.md new file mode 100644 index 000000000000..ee3d70023483 --- /dev/null +++ b/website/content/api/crypto/ov/cpmarkets/_index.md @@ -0,0 +1,43 @@ +# crypto.ov.cpmarkets + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpmarkets(symbols: str = 'USD', sortby: str = 'rank', ascend: bool = True) -> pandas.core.frame.DataFrame + +Returns basic coin information for all coins from CoinPaprika API [Source: CoinPaprika] + + Parameters + ---------- + symbols: str + Comma separated quotes to return e.g quotes=USD,BTC + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascend + + Returns + ------- + pandas.DataFrame + rank, name, symbol, price, volume_24h, mcap_change_24h, + pct_change_1h, pct_change_24h, ath_price, pct_from_ath, + +## Getting charts +###crypto.ov.cpmarkets(symbol: str, sortby: str = 'rank', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +Displays basic market information for all coins from CoinPaprika API. [Source: CoinPaprika] + + Parameters + ---------- + symbol: str + Quoted currency + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cpplatforms/_index.md b/website/content/api/crypto/ov/cpplatforms/_index.md new file mode 100644 index 000000000000..090246cae4ad --- /dev/null +++ b/website/content/api/crypto/ov/cpplatforms/_index.md @@ -0,0 +1,24 @@ +# crypto.ov.cpplatforms + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cpplatforms() -> pandas.core.frame.DataFrame + +List all smart contract platforms like ethereum, solana, cosmos, polkadot, kusama ... [Source: CoinPaprika] + + Returns + ------- + pandas.DataFrame + index, platform_id + +## Getting charts +###crypto.ov.cpplatforms(export: str, chart=True) -> None + +List all smart contract platforms like ethereum, solana, cosmos, polkadot, kusama. + [Source: CoinPaprika] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/cr/_index.md b/website/content/api/crypto/ov/cr/_index.md new file mode 100644 index 000000000000..10fbf6d2292f --- /dev/null +++ b/website/content/api/crypto/ov/cr/_index.md @@ -0,0 +1,36 @@ +# crypto.ov.cr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.cr(rate_type: str = 'borrow') -> pandas.core.frame.DataFrame + +Returns crypto {borrow,supply} interest rates for cryptocurrencies across several platforms + [Source: https://loanscan.io/] + + Parameters + ---------- + rate_type : str + Interest rate type: {borrow, supply}. Default: supply + Returns + ------- + pandas.DataFrame: crypto interest rates per platform + +## Getting charts +###crypto.ov.cr(symbols: str, platforms: str, rate_type: str = 'borrow', limit: int = 10, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Displays crypto {borrow,supply} interest rates for cryptocurrencies across several platforms + [Source: https://loanscan.io/] + + Parameters + ---------- + rate_type: str + Interest rate type: {borrow, supply}. Default: supply + symbols: str + Crypto separated by commas. Default: BTC,ETH,USDT,USDC + platforms: str + Platforms separated by commas. Default: BlockFi,Ledn,SwissBorg,Youhodler + limit: int + Number of records to show + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/crypto_hack/_index.md b/website/content/api/crypto/ov/crypto_hack/_index.md new file mode 100644 index 000000000000..7623c9eb990d --- /dev/null +++ b/website/content/api/crypto/ov/crypto_hack/_index.md @@ -0,0 +1,17 @@ +# crypto.ov.crypto_hack + +## Get underlying data +###crypto.ov.crypto_hack(slug: str) -> Optional[str] + +Get crypto hack + [Source: https://rekt.news] + + Parameters + ---------- + slug: str + slug of crypto hack + + Returns + ------- + pandas.DataFrame: + Hacks with columns {Platform,Date,Amount [$],Audited,URL} diff --git a/website/content/api/crypto/ov/crypto_hack_slugs/_index.md b/website/content/api/crypto/ov/crypto_hack_slugs/_index.md new file mode 100644 index 000000000000..10f1decf40a6 --- /dev/null +++ b/website/content/api/crypto/ov/crypto_hack_slugs/_index.md @@ -0,0 +1,11 @@ +# crypto.ov.crypto_hack_slugs + +## Get underlying data +###crypto.ov.crypto_hack_slugs() -> List[str] + +Get all crypto hack slugs + [Source: https://rekt.news] + Returns + ------- + List[str]: + List with slugs diff --git a/website/content/api/crypto/ov/crypto_hacks/_index.md b/website/content/api/crypto/ov/crypto_hacks/_index.md new file mode 100644 index 000000000000..2c7f97b98da2 --- /dev/null +++ b/website/content/api/crypto/ov/crypto_hacks/_index.md @@ -0,0 +1,41 @@ +# crypto.ov.crypto_hacks + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.crypto_hacks(sortby: str = 'Platform', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get major crypto-related hacks + [Source: https://rekt.news] + + Parameters + ---------- + sortby: str + Key by which to sort data {Platform,Date,Amount [$],Audit,Slug,URL} + ascend + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame: + Hacks with columns {Platform,Date,Amount [$],Audited,Slug,URL} + +## Getting charts +###crypto.ov.crypto_hacks(top: int = 15, sortby: str = 'Platform', ascend: bool = False, slug: str = 'polyntwork-rekt', export: str = '', chart=True) -> None + +Display list of major crypto-related hacks. If slug is passed + individual crypto hack is displayed instead of list of crypto hacks + [Source: https://rekt.news] + + Parameters + ---------- + slug: str + Crypto hack slug to check (e.g., polynetwork-rekt) + top: int + Number of hacks to search + sortby: str + Key by which to sort data {Platform,Date,Amount [$],Audit,Slug,URL} + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/ewf/_index.md b/website/content/api/crypto/ov/ewf/_index.md new file mode 100644 index 000000000000..ee5b07228451 --- /dev/null +++ b/website/content/api/crypto/ov/ewf/_index.md @@ -0,0 +1,28 @@ +# crypto.ov.ewf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.ewf() -> pandas.core.frame.DataFrame + +Scrapes exchange withdrawal fees + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + + Returns + ------- + pandas.DataFrame: + Exchange, Coins, Lowest, Average, Median, Highest + +## Getting charts +###crypto.ov.ewf(export: str = '', chart=True) -> None + +Exchange withdrawal fees + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/exchanges/_index.md b/website/content/api/crypto/ov/exchanges/_index.md new file mode 100644 index 000000000000..176341e9b228 --- /dev/null +++ b/website/content/api/crypto/ov/exchanges/_index.md @@ -0,0 +1,38 @@ +# crypto.ov.exchanges + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.exchanges(sortby: str = 'name', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get list of top exchanges from CoinGecko API [Source: CoinGecko] + + Parameters + ---------- + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + + Returns + ------- + pandas.DataFrame + Trust_Score, Id, Name, Country, Year_Established, Trade_Volume_24h_BTC, Url + +## Getting charts +###crypto.ov.exchanges(sortby: str = 'name', ascend: bool = False, top: int = 15, links: bool = False, export: str = '', chart=True) -> None + +Shows list of top exchanges from CoinGecko. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data descending + links: bool + Flag to display urls + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/global_info/_index.md b/website/content/api/crypto/ov/global_info/_index.md new file mode 100644 index 000000000000..579c58d929cc --- /dev/null +++ b/website/content/api/crypto/ov/global_info/_index.md @@ -0,0 +1,17 @@ +# crypto.ov.global_info + +## Get underlying data +###crypto.ov.global_info() -> pandas.core.frame.DataFrame + +Get global statistics about crypto from CoinGecko API like: + - market cap change + - number of markets + - icos + - number of active crypto + + [Source: CoinGecko] + + Returns + ------- + pandas.DataFrame + Metric, Value diff --git a/website/content/api/crypto/ov/list_of_coins/_index.md b/website/content/api/crypto/ov/list_of_coins/_index.md new file mode 100644 index 000000000000..bea64f6628ac --- /dev/null +++ b/website/content/api/crypto/ov/list_of_coins/_index.md @@ -0,0 +1,12 @@ +# crypto.ov.list_of_coins + +## Get underlying data +###crypto.ov.list_of_coins() -> pandas.core.frame.DataFrame + +Get list of all available coins on CoinPaprika [Source: CoinPaprika] + + Returns + ------- + pandas.DataFrame + Available coins on CoinPaprika + rank, id, name, symbol, type diff --git a/website/content/api/crypto/ov/news/_index.md b/website/content/api/crypto/ov/news/_index.md new file mode 100644 index 000000000000..8dd2545dae96 --- /dev/null +++ b/website/content/api/crypto/ov/news/_index.md @@ -0,0 +1,55 @@ +# crypto.ov.news + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.news(limit: int = 60, post_kind: str = 'news', filter_: Optional[str] = None, region: str = 'en', source: str = 'cp', currency: str = None, sortby: str = 'published_at', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get recent posts from CryptoPanic news aggregator platform. [Source: https://cryptopanic.com/] + + Parameters + ---------- + limit: int + number of news to fetch + post_kind: str + Filter by category of news. Available values: news or media. + filter_: Optional[str] + Filter by kind of news. One from list: rising|hot|bullish|bearish|important|saved|lol + region: str + Filter news by regions. Available regions are: en (English), de (Deutsch), nl (Dutch), + es (Español), fr (Français), it (Italiano), pt (Português), ru (Русский) + sortby: str + Key to sort by. + ascend: bool + Sort in ascend order. + + Returns + ------- + pd.DataFrame + DataFrame with recent news from different sources filtered by provided parameters. + +## Getting charts +###crypto.ov.news(post_kind: str = 'news', region: str = 'en', filter_: Optional[str] = None, top: int = 25, sortby: str = 'published_at', ascend: bool = False, links: bool = False, export: str = '', chart=True) -> None + +Display recent posts from CryptoPanic news aggregator platform. + [Source: https://cryptopanic.com/] + + Parameters + ---------- + top: int + number of news to display + post_kind: str + Filter by category of news. Available values: news or media. + filter_: Optional[str] + Filter by kind of news. One from list: rising|hot|bullish|bearish|important|saved|lol + region: str + Filter news by regions. Available regions are: en (English), de (Deutsch), nl (Dutch), + es (Español), fr (Français), it (Italiano), pt (Português), ru (Русский) + sortby: str + Key to sort by. + ascend: bool + Sort in ascending order. + links: bool + Show urls for news + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/platforms/_index.md b/website/content/api/crypto/ov/platforms/_index.md new file mode 100644 index 000000000000..072e7ab0ea0e --- /dev/null +++ b/website/content/api/crypto/ov/platforms/_index.md @@ -0,0 +1,36 @@ +# crypto.ov.platforms + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.platforms(sortby: str = 'Name', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get list of financial platforms from CoinGecko API [Source: CoinGecko] + + Parameter + ---------- + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + + Returns + ------- + pandas.DataFrame + Rank, Name, Category, Centralized, Url + +## Getting charts +###crypto.ov.platforms(sortby: str = 'Name', ascend: bool = True, top: int = 15, export: str = '', chart=True) -> None + +Shows list of financial platforms. [Source: CoinGecko] + + Parameters + ---------- + top: int + Number of records to display + sortby: str + Key by which to sort data + ascend: bool + Flag to sort data ascending + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/wf/_index.md b/website/content/api/crypto/ov/wf/_index.md new file mode 100644 index 000000000000..8876f8d7f6a8 --- /dev/null +++ b/website/content/api/crypto/ov/wf/_index.md @@ -0,0 +1,31 @@ +# crypto.ov.wf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.wf(top: int = 100) -> pandas.core.frame.DataFrame + +Scrapes top coins withdrawal fees + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + top: int + Number of coins to search, by default n=100, one page has 100 coins, so 1 page is scraped. + Returns + ------- + pandas.DataFrame: + Coin, Lowest, Average, Median, Highest, Exchanges Compared + +## Getting charts +###crypto.ov.wf(top: int = 15, export: str = '', chart=True) -> None + +Top coins withdrawal fees + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + top: int + Number of coins to search + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/ov/wfpe/_index.md b/website/content/api/crypto/ov/wfpe/_index.md new file mode 100644 index 000000000000..cfd17f0ff1e8 --- /dev/null +++ b/website/content/api/crypto/ov/wfpe/_index.md @@ -0,0 +1,32 @@ +# crypto.ov.wfpe + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.ov.wfpe(symbol: str) -> List[Any] + +Scrapes coin withdrawal fees per exchange + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + symbol: str + Coin to check withdrawal fees. By default bitcoin + Returns + ------- + List: + - str: Overall statistics (exchanges, lowest, average and median) + - pandas.DataFrame: Exchange, Withdrawal Fee, Minimum Withdrawal Amount + +## Getting charts +###crypto.ov.wfpe(symbol: str, export: str = '', chart=True) -> None + +Coin withdrawal fees per exchange + [Source: https://withdrawalfees.com/] + + Parameters + ---------- + symbol: str + Coin to check withdrawal fees + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/crypto/tools/apy/_index.md b/website/content/api/crypto/tools/apy/_index.md new file mode 100644 index 000000000000..d413550412ec --- /dev/null +++ b/website/content/api/crypto/tools/apy/_index.md @@ -0,0 +1,40 @@ +# crypto.tools.apy + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.tools.apy(apr: float, compounding_times: int) -> Tuple[pandas.core.frame.DataFrame, str] + +Converts apr into apy + + Parameters + ---------- + apr: float + value in percentage + compounding_times: int + number of compounded periods in a year + + Returns + ------- + Tuple: + - pd.DataFrame: dataframe with results + - str: narrative version of results + +## Getting charts +###crypto.tools.apy(apr: float, compounding_times: int, narrative: bool = False, export: str = '', chart=True) + +Displays APY value converted from APR + + Parameters + ---------- + apr: float + value in percentage + compounding_times: int + number of compounded periods in a year + narrative: str + display narrative version instead of dataframe + export : str + Export dataframe data to csv,json,xlsx file + + Returns + ------- diff --git a/website/content/api/crypto/tools/il/_index.md b/website/content/api/crypto/tools/il/_index.md new file mode 100644 index 000000000000..85017a13a876 --- /dev/null +++ b/website/content/api/crypto/tools/il/_index.md @@ -0,0 +1,48 @@ +# crypto.tools.il + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###crypto.tools.il(price_changeA: float, price_changeB: float, proportion: float, initial_pool_value: float) -> Tuple[pandas.core.frame.DataFrame, str] + +Calculates Impermanent Loss in a custom liquidity pool + + Parameters + ---------- + price_changeA: float + price change of crypto A in percentage + price_changeB: float + price change of crypto B in percentage + proportion: float + percentage of first token in pool + initial_pool_value: float + initial value that pool contains + + Returns + ------- + Tuple: + - pd.DataFrame: dataframe with results + - str: narrative version of results + +## Getting charts +###crypto.tools.il(price_changeA: int, price_changeB: int, proportion: int, initial_pool_value: int, narrative: bool = False, export: str = '', chart=True) + +Displays Impermanent Loss in a custom liquidity pool + + Parameters + ---------- + price_changeA: float + price change of crypto A in percentage + price_changeB: float + price change of crypto B in percentage + proportion: float + percentage of first token in pool + initial_pool_value: float + initial value that pool contains + narrative: str + display narrative version instead of dataframe + export : str + Export dataframe data to csv,json,xlsx file + + Returns + ------- diff --git a/website/content/api/econometrics/bgod/_index.md b/website/content/api/econometrics/bgod/_index.md new file mode 100644 index 000000000000..5fa666329938 --- /dev/null +++ b/website/content/api/econometrics/bgod/_index.md @@ -0,0 +1,33 @@ +# econometrics.bgod + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.bgod(model: pandas.core.frame.DataFrame, lags: int = 3) -> tuple + +Calculate test statistics for autocorrelation + + Parameters + ---------- + model : OLS Model + Model containing residual values. + lags : int + The amount of lags. + + Returns + ------- + Test results from the Breusch-Godfrey Test + +## Getting charts +###econometrics.bgod(model: pandas.core.frame.DataFrame, lags: int = 3, export: str = '', chart=True) + +Show Breusch-Godfrey autocorrelation test + + Parameters + ---------- + model : OLS Model + Model containing residual values. + lags : int + The amount of lags included. + export : str + Format to export data diff --git a/website/content/api/econometrics/bols/_index.md b/website/content/api/econometrics/bols/_index.md new file mode 100644 index 000000000000..cb4a4596325a --- /dev/null +++ b/website/content/api/econometrics/bols/_index.md @@ -0,0 +1,21 @@ +# econometrics.bols + +## Get underlying data +###econometrics.bols(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame]) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +The between estimator is an alternative, usually less efficient estimator, can can be used to + estimate model parameters. It is particular simple since it first computes the time averages of + y and x and then runs a simple regression using these averages. [Source: LinearModels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the Between OLS model. diff --git a/website/content/api/econometrics/bpag/_index.md b/website/content/api/econometrics/bpag/_index.md new file mode 100644 index 000000000000..6eccc46b49fc --- /dev/null +++ b/website/content/api/econometrics/bpag/_index.md @@ -0,0 +1,29 @@ +# econometrics.bpag + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.bpag(model: pandas.core.frame.DataFrame) -> tuple + +Calculate test statistics for heteroscedasticity + + Parameters + ---------- + model : OLS Model + Model containing residual values. + + Returns + ------- + Test results from the Breusch-Pagan Test + +## Getting charts +###econometrics.bpag(model: pandas.core.frame.DataFrame, export: str = '', chart=True) + +Show Breusch-Pagan heteroscedasticity test + + Parameters + ---------- + model : OLS Model + Model containing residual values. + export : str + Format to export data diff --git a/website/content/api/econometrics/clean/_index.md b/website/content/api/econometrics/clean/_index.md new file mode 100644 index 000000000000..476b97cb256c --- /dev/null +++ b/website/content/api/econometrics/clean/_index.md @@ -0,0 +1,24 @@ +# econometrics.clean + +## Get underlying data +###econometrics.clean(dataset: pandas.core.frame.DataFrame, fill: str = '', drop: str = '', limit: Optional[int] = None) -> pandas.core.frame.DataFrame + +Clean up NaNs from the dataset + + Parameters + ---------- + dataset : pd.DataFrame + The dataset you wish to clean + fill : str + The method of filling NaNs. Choose from: + rfill, cfill, rbfill, cbfill, rffill, cffill + drop : str + The method of dropping NaNs. Choose from: + rdrop, cdrop + limit : int + The maximum limit you wish to apply that can be forward or backward filled + + Returns + ------- + pd.DataFrame: + Dataframe with cleaned up data diff --git a/website/content/api/econometrics/coint/_index.md b/website/content/api/econometrics/coint/_index.md new file mode 100644 index 000000000000..71622588dcdb --- /dev/null +++ b/website/content/api/econometrics/coint/_index.md @@ -0,0 +1,91 @@ +# econometrics.coint + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.coint(dependent_series, independent_series) + +Estimates long-run and short-run cointegration relationship for series y and x and apply + the two-step Engle & Granger test for cointegration. + + Uses a 2-step process to first estimate coefficients for the long-run relationship + y_t = c + gamma * x_t + z_t + + and then the short-term relationship, + y_t - y_(t-1) = alpha * z_(t-1) + epsilon_t, + + with z the found residuals of the first equation. + + Then tests cointegration by Dickey-Fuller phi=1 vs phi < 1 in + z_t = phi * z_(t-1) + eta_t + + If this implies phi < 1, the z series is stationary is concluded to be + stationary, and thus the series y and x are concluded to be cointegrated. + + Parameters + ---------- + dependent_series : pd.Series + The first time series of the pair to analyse. + + independent_series : pd.Series + The second time series of the pair to analyse. + + Returns + ------- + c : float + The constant term in the long-run relationship y_t = c + gamma * x_t + z_t. This + describes the static shift of y with respect to gamma * x. + + gamma : float + The gamma term in the long-run relationship y_t = c + gamma * x_t + z_t. This + describes the ratio between the const-shifted y and x. + + alpha : float + The alpha term in the short-run relationship y_t - y_(t-1) = alpha * z_(t-1) + epsilon. This + gives an indication of the strength of the error correction toward the long-run mean. + + z : pd.Series + Series of residuals z_t from the long-run relationship y_t = c + gamma * x_t + z_t, representing + the value of the error correction term. + + dfstat : float + The Dickey Fuller test-statistic for phi = 1 vs phi < 1 in the second equation. A more + negative value implies the existence of stronger cointegration. + + pvalue : float + The p-value corresponding to the Dickey Fuller test-statistic. A lower value implies + stronger rejection of no-cointegration, thus stronger evidence of cointegration. + + +## Getting charts +###econometrics.coint(datasets: Union[pandas.core.frame.DataFrame, Dict[str, pandas.core.series.Series]], significant: bool = False, plot: bool = False, export: str = '', external_axes: Optional[List[axes]] = None, chart=True) + +Estimates long-run and short-run cointegration relationship for series y and x and apply + the two-step Engle & Granger test for cointegration. + + Uses a 2-step process to first estimate coefficients for the long-run relationship + y_t = c + gamma * x_t + z_t + + and then the short-term relationship, + y_t - y_(t-1) = alpha * z_(t-1) + epsilon_t, + + with z the found residuals of the first equation. + + Then tests co-integration with the Dickey-Fuller phi=1 vs phi < 1 in + z_t = phi * z_(t-1) + eta_t + + If this implies phi < 1, the z series is stationary is concluded to be + stationary, and thus the series y and x are concluded to be cointegrated. + + Parameters + ---------- + datasets: Union[pd.DataFrame, Dict[str, pd.Series]] + All time series to perform co-integration tests on. + significant: float + Show only companies that have p-values lower than this percentage + plot: bool + Whether you wish to plot the z-values of all pairs. + export : str + Format to export data + external_axes:Optional[List[plt.axes]] + External axes to plot on diff --git a/website/content/api/econometrics/comparison/_index.md b/website/content/api/econometrics/comparison/_index.md new file mode 100644 index 000000000000..8f2f826f60bb --- /dev/null +++ b/website/content/api/econometrics/comparison/_index.md @@ -0,0 +1,17 @@ +# econometrics.comparison + +## Get underlying data +###econometrics.comparison(regressions, export: str = '') + +Compare regression results between Panel Data regressions. + + Parameters + ---------- + regressions : Dict + Dictionary with regression results. + export : str + Format to export data + + Returns + ------- + Returns a PanelModelComparison which shows an overview of the different regression results. diff --git a/website/content/api/econometrics/dwat/_index.md b/website/content/api/econometrics/dwat/_index.md new file mode 100644 index 000000000000..f999d8824bfd --- /dev/null +++ b/website/content/api/econometrics/dwat/_index.md @@ -0,0 +1,35 @@ +# econometrics.dwat + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.dwat(residual: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame + +Calculate test statistics for Durbing Watson autocorrelation + + Parameters + ---------- + residual : OLS Model + Model containing residual values. + + Returns + ------- + Test statistic of the Durbin Watson test. + +## Getting charts +###econometrics.dwat(dependent_variable: pandas.core.series.Series, residual: pandas.core.frame.DataFrame, plot: bool = False, export: str = '', external_axes: Optional[List[axes]] = None, chart=True) + +Show Durbin-Watson autocorrelation tests + + Parameters + ---------- + dependent_variable : pd.Series + The dependent variable. + residual : OLS Model + The residual of an OLS model. + plot : bool + Whether to plot the residuals + export : str + Format to export data + external_axes: Optional[List[plt.axes]] + External axes to plot on diff --git a/website/content/api/econometrics/fdols/_index.md b/website/content/api/econometrics/fdols/_index.md new file mode 100644 index 000000000000..eb0670e5edba --- /dev/null +++ b/website/content/api/econometrics/fdols/_index.md @@ -0,0 +1,23 @@ +# econometrics.fdols + +## Get underlying data +###econometrics.fdols(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame]) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +First differencing is an alternative to using fixed effects when there might be correlation. + When using first differences, time-invariant variables must be excluded. Additionally, + only one linear time-trending variable can be included since this will look like a constant. + This variable will soak up all time-trends in the data, and so interpretations of + these variable can be challenging. [Source: LinearModels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the OLS model. diff --git a/website/content/api/econometrics/fe/_index.md b/website/content/api/econometrics/fe/_index.md new file mode 100644 index 000000000000..769265acbf96 --- /dev/null +++ b/website/content/api/econometrics/fe/_index.md @@ -0,0 +1,25 @@ +# econometrics.fe + +## Get underlying data +###econometrics.fe(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame], entity_effects: bool = False, time_effects: bool = False) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +When effects are correlated with the regressors the RE and BE estimators are not consistent. + The usual solution is to use Fixed Effects which are called entity_effects when applied to + entities and time_effects when applied to the time dimension. [Source: LinearModels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + entity_effects : bool + Whether to include entity effects + time_effects : bool + Whether to include time effects + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the OLS model. diff --git a/website/content/api/econometrics/get_regression_data/_index.md b/website/content/api/econometrics/get_regression_data/_index.md new file mode 100644 index 000000000000..678bec813975 --- /dev/null +++ b/website/content/api/econometrics/get_regression_data/_index.md @@ -0,0 +1,22 @@ +# econometrics.get_regression_data + +## Get underlying data +###econometrics.get_regression_data(regression_variables: List[tuple], data: Dict[str, pandas.core.frame.DataFrame], regression_type: str = '') -> Tuple[pandas.core.frame.DataFrame, Any, List[Any]] + +This function creates a DataFrame with the required regression data as + well sets up the dependent and independent variables. + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + regression_type: str + The type of regression that is executed. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the OLS model. diff --git a/website/content/api/econometrics/granger/_index.md b/website/content/api/econometrics/granger/_index.md new file mode 100644 index 000000000000..1114e1ef5cda --- /dev/null +++ b/website/content/api/econometrics/granger/_index.md @@ -0,0 +1,35 @@ +# econometrics.granger + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.granger(dependent_series, independent_series, lags) + +Calculate granger tests + + Parameters + ---------- + dependent_series: Series + The series you want to test Granger Causality for. + independent_series: Series + The series that you want to test whether it Granger-causes time_series_y + lags : int + The amount of lags for the Granger test. By default, this is set to 3. + +## Getting charts +###econometrics.granger(dependent_series: pandas.core.series.Series, independent_series: pandas.core.series.Series, lags: int = 3, confidence_level: float = 0.05, export: str = '', chart=True) + +Show granger tests + + Parameters + ---------- + dependent_series: Series + The series you want to test Granger Causality for. + independent_series: Series + The series that you want to test whether it Granger-causes dependent_series + lags : int + The amount of lags for the Granger test. By default, this is set to 3. + confidence_level: float + The confidence level you wish to use. By default, this is set to 0.05. + export : str + Format to export data diff --git a/website/content/api/econometrics/load/_index.md b/website/content/api/econometrics/load/_index.md new file mode 100644 index 000000000000..1b6dd4c029fa --- /dev/null +++ b/website/content/api/econometrics/load/_index.md @@ -0,0 +1,22 @@ +# econometrics.load + +## Get underlying data +###econometrics.load(file: str, file_types: Optional[List[str]] = None, data_files: Optional[Dict[Any, Any]] = None, data_examples: Optional[Dict[Any, Any]] = None) -> pandas.core.frame.DataFrame + +Load custom file into dataframe. + + Parameters + ---------- + file: str + Path to file + file_types: list + Supported file types + data_files: dict + Contains all available data files within the Export folder + data_examples: dict + Contains all available examples from Statsmodels + + Returns + ------- + pd.DataFrame: + Dataframe with custom data diff --git a/website/content/api/econometrics/norm/_index.md b/website/content/api/econometrics/norm/_index.md new file mode 100644 index 000000000000..8ee923ac2ea6 --- /dev/null +++ b/website/content/api/econometrics/norm/_index.md @@ -0,0 +1,41 @@ +# econometrics.norm + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.norm(data: pandas.core.series.Series) -> pandas.core.frame.DataFrame + + + The distribution of returns and generate statistics on the relation to the normal curve. + This function calculates skew and kurtosis (the third and fourth moments) and performs both + a Jarque-Bera and Shapiro Wilk test to determine if data is normally distributed. + + Parameters + ---------- + data : pd.Series + A series or column of a DataFrame to test normality for + + Returns + ------- + pd.DataFrame + Dataframe containing statistics of normality + +## Getting charts +###econometrics.norm(data: pandas.core.series.Series, dataset: str = '', column: str = '', plot: bool = False, export: str = '', external_axes: Optional[List[axes]] = None, chart=True) + +Determine the normality of a timeseries. + + Parameters + ---------- + data: pd.Series + Series of custom data + dataset: str + Dataset name + column: str + Column for y data + plot : bool + Whether you wish to plot a histogram + export: str + Format to export data. + external_axes: Optional[List[plt.axes]] + External axes to plot on diff --git a/website/content/api/econometrics/ols/_index.md b/website/content/api/econometrics/ols/_index.md new file mode 100644 index 000000000000..bfab6a142428 --- /dev/null +++ b/website/content/api/econometrics/ols/_index.md @@ -0,0 +1,23 @@ +# econometrics.ols + +## Get underlying data +###econometrics.ols(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame], show_regression: bool = True, export: str = '') -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +Performs an OLS regression on timeseries data. [Source: Statsmodels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + show_regression: bool + Whether to show the regression results table. + export: str + Format to export data + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the OLS model. diff --git a/website/content/api/econometrics/options/_index.md b/website/content/api/econometrics/options/_index.md new file mode 100644 index 000000000000..3df75b6b6ef5 --- /dev/null +++ b/website/content/api/econometrics/options/_index.md @@ -0,0 +1,35 @@ +# econometrics.options + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.options(datasets: Dict[str, pandas.core.frame.DataFrame], dataset_name: str = '') -> Dict[Union[str, Any], pandas.core.frame.DataFrame] + +Obtain columns-dataset combinations from loaded in datasets that can be used in other commands + + Parameters + ---------- + datasets: dict + The available datasets. + dataset_name: str + The dataset you wish to show the options for. + + Returns + ------- + option_tables: dict + A dictionary with a DataFrame for each option. With dataset_name set, only shows one + options table. + +## Getting charts +###econometrics.options(datasets: Dict[str, pandas.core.frame.DataFrame], dataset_name: str = None, export: str = '', chart=True) + +Plot custom data + + Parameters + ---------- + datasets: dict + The loaded in datasets + dataset_name: str + The name of the dataset you wish to show options for + export: str + Format to export image diff --git a/website/content/api/econometrics/panel/_index.md b/website/content/api/econometrics/panel/_index.md new file mode 100644 index 000000000000..0ddf0467e8f6 --- /dev/null +++ b/website/content/api/econometrics/panel/_index.md @@ -0,0 +1,55 @@ +# econometrics.panel + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.panel(regression_type: str, regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame], entity_effects: bool = False, time_effects: bool = False) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +Based on the regression type, this function decides what regression to run. + + Parameters + ---------- + regression_type: str + The type of regression you wish to execute. + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + entity_effects: bool + Whether to apply Fixed Effects on entities. + time_effects: bool + Whether to apply Fixed Effects on time. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the regression model. + +## Getting charts +###econometrics.panel(data: Dict[str, pandas.core.frame.DataFrame], regression_variables: List[Tuple], regression_type: str = 'OLS', entity_effects: bool = False, time_effects: bool = False, export: str = '', chart=True) + +Based on the regression type, this function decides what regression to run. + + Parameters + ---------- + data : dict + A dictionary containing the datasets. + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + each column/dataset combination. + regression_type: str + The type of regression you wish to execute. Choose from: + OLS, POLS, RE, BOLS, FE + entity_effects: bool + Whether to apply Fixed Effects on entities. + time_effects: bool + Whether to apply Fixed Effects on time. + export : str + Format to export data + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the regression model. diff --git a/website/content/api/econometrics/pols/_index.md b/website/content/api/econometrics/pols/_index.md new file mode 100644 index 000000000000..b4225f3e6133 --- /dev/null +++ b/website/content/api/econometrics/pols/_index.md @@ -0,0 +1,20 @@ +# econometrics.pols + +## Get underlying data +###econometrics.pols(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame]) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +PooledOLS is just plain OLS that understands that various panel data structures. + It is useful as a base model. [Source: LinearModels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the Pooled OLS model. diff --git a/website/content/api/econometrics/re/_index.md b/website/content/api/econometrics/re/_index.md new file mode 100644 index 000000000000..b907bcac62e4 --- /dev/null +++ b/website/content/api/econometrics/re/_index.md @@ -0,0 +1,21 @@ +# econometrics.re + +## Get underlying data +###econometrics.re(regression_variables: List[Tuple], data: Dict[str, pandas.core.frame.DataFrame]) -> Tuple[pandas.core.frame.DataFrame, Any, List[Any], Any] + +The random effects model is virtually identical to the pooled OLS model except that is accounts for the + structure of the model and so is more efficient. Random effects uses a quasi-demeaning strategy which + subtracts the time average of the within entity values to account for the common shock. [Source: LinearModels] + + Parameters + ---------- + regression_variables : list + The regressions variables entered where the first variable is + the dependent variable. + data : dict + A dictionary containing the datasets. + + Returns + ------- + The dataset used, the dependent variable, the independent variable and + the RandomEffects model. diff --git a/website/content/api/econometrics/root/_index.md b/website/content/api/econometrics/root/_index.md new file mode 100644 index 000000000000..ae420e91e00b --- /dev/null +++ b/website/content/api/econometrics/root/_index.md @@ -0,0 +1,42 @@ +# econometrics.root + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###econometrics.root(df: pandas.core.series.Series, fuller_reg: str = 'c', kpss_reg: str = 'c') -> pandas.core.frame.DataFrame + +Calculate test statistics for unit roots + + Parameters + ---------- + df : pd.Series + Series or column of DataFrame of target variable + fuller_reg : str + Type of regression of ADF test + kpss_reg : str + Type of regression for KPSS test + + Returns + ------- + pd.DataFrame + Dataframe with results of ADF test and KPSS test + +## Getting charts +###econometrics.root(df: pandas.core.series.Series, dataset: str = '', column: str = '', fuller_reg: str = 'c', kpss_reg: str = 'c', export: str = '', chart=True) + +Determine the normality of a timeseries. + + Parameters + ---------- + df : pd.Series + Series of target variable + dataset: str + Name of the dataset + column: str + Name of the column + fuller_reg : str + Type of regression of ADF test. Choose c, ct, ctt, or nc + kpss_reg : str + Type of regression for KPSS test. Choose c or ct + export: str + Format to export data. diff --git a/website/content/api/economy/available_indices/_index.md b/website/content/api/economy/available_indices/_index.md new file mode 100644 index 000000000000..bce606e2a85b --- /dev/null +++ b/website/content/api/economy/available_indices/_index.md @@ -0,0 +1,9 @@ +# economy.available_indices + +## Get underlying data +###economy.available_indices() -> dict + +Get available indices + + Returns: + dict: dictionary with available indices and respective detail diff --git a/website/content/api/economy/bigmac/_index.md b/website/content/api/economy/bigmac/_index.md new file mode 100644 index 000000000000..56a9cbf3e86c --- /dev/null +++ b/website/content/api/economy/bigmac/_index.md @@ -0,0 +1,34 @@ +# economy.bigmac + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.bigmac(country_codes: List[str]) -> pandas.core.frame.DataFrame + +Display Big Mac Index for given countries + + Parameters + ---------- + country_codes : List[str] + List of country codes (ISO-3 letter country code). Codes available through economy.country_codes(). + + Returns + ------- + pd.DataFrame + Dataframe with Big Mac indices converted to USD equivalent. + +## Getting charts +###economy.bigmac(country_codes: List[str], raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display Big Mac Index for given countries + + Parameters + ---------- + country_codes : List[str] + List of country codes (ISO-3 letter country code). Codes available through economy.country_codes(). + raw : bool, optional + Flag to display raw data, by default False + export : str, optional + Format data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/country_codes/_index.md b/website/content/api/economy/country_codes/_index.md new file mode 100644 index 000000000000..5f7a418b0464 --- /dev/null +++ b/website/content/api/economy/country_codes/_index.md @@ -0,0 +1,11 @@ +# economy.country_codes + +## Get underlying data +###economy.country_codes() -> List[str] + +Get available country codes for Bigmac index + + Returns + ------- + List[str] + List of ISO-3 letter country codes. diff --git a/website/content/api/economy/cpi/_index.md b/website/content/api/economy/cpi/_index.md new file mode 100644 index 000000000000..693fc2d9b2be --- /dev/null +++ b/website/content/api/economy/cpi/_index.md @@ -0,0 +1,38 @@ +# economy.cpi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.cpi(interval: str = 'm', start_year: int = 2010) -> pandas.core.frame.DataFrame + +Get Consumer Price Index from Alpha Vantage + + Parameters + ---------- + interval : str + Interval for data. Either "m" or "s" for monthly or semiannual + start_year : int, optional + Start year for plot, by default 2010 + + Returns + ------- + pd.DataFrame + Dataframe of CPI + +## Getting charts +###economy.cpi(interval: str = 'm', start_year: int = 2010, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display US consumer price index (CPI) from AlphaVantage + + Parameters + ---------- + interval : str + Interval for GDP. Either "m" or "s" + start_year : int, optional + Start year for plot, by default 2010 + raw : bool, optional + Flag to show raw data, by default False + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/currencies/_index.md b/website/content/api/economy/currencies/_index.md new file mode 100644 index 000000000000..b226f1b8ee6a --- /dev/null +++ b/website/content/api/economy/currencies/_index.md @@ -0,0 +1,11 @@ +# economy.currencies + +## Get underlying data +###economy.currencies() -> pandas.core.frame.DataFrame + +Scrape data for global currencies + + Returns + ------- + currencies: pd.DataFrame + Dataframe containing name, price, net change and percent change diff --git a/website/content/api/economy/events/_index.md b/website/content/api/economy/events/_index.md new file mode 100644 index 000000000000..ff7667078840 --- /dev/null +++ b/website/content/api/economy/events/_index.md @@ -0,0 +1,24 @@ +# economy.events + +## Get underlying data +###economy.events(country: str = 'all', importance: str = '', category: str = '', start_date: str = '', end_date: str = '', limit=100) -> Tuple[pandas.core.frame.DataFrame, str] + +Get economic calendar [Source: Investing.com] + + Parameters + ---------- + country: str + Country selected. List of available countries is accessible through get_events_countries(). + importance: str + Importance selected from high, medium, low or all + category: str + Event category. List of available categories is accessible through get_events_categories(). + start_date: datetime.date + First date to get events. + end_date: datetime.date + Last date to get events. + + Returns + ------- + Tuple[pd.DataFrame, str] + Economic calendar Dataframe and detail string about country/time zone. diff --git a/website/content/api/economy/fred_ids/_index.md b/website/content/api/economy/fred_ids/_index.md new file mode 100644 index 000000000000..cf6492a8a0d4 --- /dev/null +++ b/website/content/api/economy/fred_ids/_index.md @@ -0,0 +1,16 @@ +# economy.fred_ids + +## Get underlying data +###economy.fred_ids(search_query: str, limit: int = -1) -> pandas.core.frame.DataFrame + +Get Series IDs. [Source: FRED] + Parameters + ---------- + search_query : str + Text query to search on fred series notes database + limit : int + Maximum number of series IDs to output + Returns + ---------- + pd.Dataframe + Dataframe with series IDs and titles diff --git a/website/content/api/economy/fred_notes/_index.md b/website/content/api/economy/fred_notes/_index.md new file mode 100644 index 000000000000..e18d65e93ba7 --- /dev/null +++ b/website/content/api/economy/fred_notes/_index.md @@ -0,0 +1,16 @@ +# economy.fred_notes + +## Get underlying data +###economy.fred_notes(search_query: str, limit: int = -1) -> pandas.core.frame.DataFrame + +Get series notes. [Source: FRED] + Parameters + ---------- + search_query : str + Text query to search on fred series notes database + limit : int + Maximum number of series notes to display + Returns + ---------- + pd.DataFrame + DataFrame of matched series diff --git a/website/content/api/economy/fred_series/_index.md b/website/content/api/economy/fred_series/_index.md new file mode 100644 index 000000000000..cba13fe80c2d --- /dev/null +++ b/website/content/api/economy/fred_series/_index.md @@ -0,0 +1,43 @@ +# economy.fred_series + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.fred_series(series_ids: List[str], start_date: str = None, end_date: str = None) -> pandas.core.frame.DataFrame + +Get Series data. [Source: FRED] + Parameters + ---------- + series_ids : List[str] + Series ID to get data from + start_date : str + Start date to get data from, format yyyy-mm-dd + end_date : str + End data to get from, format yyyy-mm-dd + + Returns + ---------- + pd.DataFrame + Series data + +## Getting charts +###economy.fred_series(series_ids: List[str], start_date: str = None, end_date: str = None, limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display (multiple) series from https://fred.stlouisfed.org. [Source: FRED] + + Parameters + ---------- + series_ids : List[str] + FRED Series ID from https://fred.stlouisfed.org. For multiple series use: series1,series2,series3 + start_date : str + Starting date (YYYY-MM-DD) of data + end_date : str + Ending date (YYYY-MM-DD) of data + limit : int + Number of data points to display. + raw : bool + Output only raw data + export : str + Export data to csv,json,xlsx or png,jpg,pdf,svg file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/fred_yield_curve/_index.md b/website/content/api/economy/fred_yield_curve/_index.md new file mode 100644 index 000000000000..f3169912bc12 --- /dev/null +++ b/website/content/api/economy/fred_yield_curve/_index.md @@ -0,0 +1,32 @@ +# economy.fred_yield_curve + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.fred_yield_curve(date: datetime.datetime = None) -> Tuple[pandas.core.frame.DataFrame, str] + +Gets yield curve data from FRED + + Parameters + ---------- + date: datetime + Date to get curve for. If None, gets most recent date + + Returns + ------- + pd.DataFrame: + Dataframe of yields and maturities + str + Date for which the yield curve is obtained + +## Getting charts +###economy.fred_yield_curve(date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 33, 227304, chart=True), external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, raw: bool = False, export: str = '') + +Display yield curve based on US Treasury rates for a specified date. + + Parameters + ---------- + date: datetime + Date to get yield curve for + external_axes: Optional[List[plt.Axes]] + External axes to plot data on diff --git a/website/content/api/economy/future/_index.md b/website/content/api/economy/future/_index.md new file mode 100644 index 000000000000..d5307c4d2cbf --- /dev/null +++ b/website/content/api/economy/future/_index.md @@ -0,0 +1,20 @@ +# economy.future + +## Get underlying data +###economy.future(future_type: str = 'Indices', sortby: str = 'ticker', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get futures data. [Source: Finviz] + + Parameters + ---------- + future_type : str + From the following: Indices, Energy, Metals, Meats, Grains, Softs, Bonds, Currencies + sortby : str + Column to sort by + ascend : bool + Flag to sort in ascending order + + Returns + ---------- + pd.Dataframe + Indices, Energy, Metals, Meats, Grains, Softs, Bonds, Currencies diff --git a/website/content/api/economy/futures/_index.md b/website/content/api/economy/futures/_index.md new file mode 100644 index 000000000000..b92e96cfff37 --- /dev/null +++ b/website/content/api/economy/futures/_index.md @@ -0,0 +1,11 @@ +# economy.futures + +## Get underlying data +###economy.futures() -> pandas.core.frame.DataFrame + +Scrape data for top commodities + + Returns + ------- + commodities: pd.DataFrame + Dataframe containing name, price, net change and percent change diff --git a/website/content/api/economy/gdp/_index.md b/website/content/api/economy/gdp/_index.md new file mode 100644 index 000000000000..b3a7ec63e564 --- /dev/null +++ b/website/content/api/economy/gdp/_index.md @@ -0,0 +1,37 @@ +# economy.gdp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.gdp(interval: str = 'q', start_year: int = 2010) -> pandas.core.frame.DataFrame + +Get annual or quarterly Real GDP for US + + Parameters + ---------- + interval : str, optional + Interval for GDP, by default "a" for annual, by default "q" + start_year : int, optional + Start year for plot, by default 2010 + Returns + ------- + pd.DataFrame + Dataframe of GDP + +## Getting charts +###economy.gdp(interval: str = 'q', start_year: int = 2010, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display US GDP from AlphaVantage + + Parameters + ---------- + interval : str + Interval for GDP. Either "a" or "q", by default "q" + start_year : int, optional + Start year for plot, by default 2010 + raw : bool, optional + Flag to show raw data, by default False + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/gdpc/_index.md b/website/content/api/economy/gdpc/_index.md new file mode 100644 index 000000000000..022abe8d2e37 --- /dev/null +++ b/website/content/api/economy/gdpc/_index.md @@ -0,0 +1,34 @@ +# economy.gdpc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.gdpc(start_year: int = 2010) -> pandas.core.frame.DataFrame + +Real GDP per Capita for United States + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + + Returns + ------- + pd.DataFrame + DataFrame of GDP per Capita + +## Getting charts +###economy.gdpc(start_year: int = 2010, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display US GDP per Capita from AlphaVantage + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + raw : bool, optional + Flag to show raw data, by default False + export : str, optional + Format to export data, by default + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/glbonds/_index.md b/website/content/api/economy/glbonds/_index.md new file mode 100644 index 000000000000..e44c3d085052 --- /dev/null +++ b/website/content/api/economy/glbonds/_index.md @@ -0,0 +1,11 @@ +# economy.glbonds + +## Get underlying data +###economy.glbonds() -> pandas.core.frame.DataFrame + +Scrape data for global bonds + + Returns + ------- + bonds: pd.DataFrame + Dataframe containing name, coupon rate, yield and change in yield diff --git a/website/content/api/economy/index/_index.md b/website/content/api/economy/index/_index.md new file mode 100644 index 000000000000..e574d796faf3 --- /dev/null +++ b/website/content/api/economy/index/_index.md @@ -0,0 +1,57 @@ +# economy.index + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.index(indices: list, interval: str = '1d', start_date: int = None, end_date: int = None, column: str = 'Adj Close', returns: bool = False) -> pandas.core.frame.DataFrame + +Get data on selected indices over time [Source: Yahoo Finance] + Parameters + ---------- + indices: list + A list of indices to get data. Available indices can be accessed through economy.available_indices(). + interval: str + Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo + Intraday data cannot extend last 60 days + start_date : str + The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + column : str + Which column to load in, by default this is the Adjusted Close. + returns: bool + Flag to show cumulative returns on index + Returns + ---------- + pd.Dataframe + Dataframe with historical data on selected indices. + +## Getting charts +###economy.index(indices: list, interval: str = '1d', start_date: int = None, end_date: int = None, column: str = 'Adj Close', returns: bool = False, raw: bool = False, external_axes: Optional[List[axes]] = None, export: str = '', chart=True) + +Load (and show) the selected indices over time [Source: Yahoo Finance] + Parameters + ---------- + indices: list + A list of indices you wish to load (and plot). + Available indices can be accessed through economy.available_indices(). + interval: str + Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo + Intraday data cannot extend last 60 days + start_date : str + The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + column : str + Which column to load in, by default this is the Adjusted Close. + returns: bool + Flag to show cumulative returns on index + raw : bool + Whether to display the raw output. + external_axes: Optional[List[plt.axes]] + External axes to plot on + export : str + Export data to csv,json,xlsx or png,jpg,pdf,svg file + Returns + ---------- + Plots the Series. diff --git a/website/content/api/economy/indices/_index.md b/website/content/api/economy/indices/_index.md new file mode 100644 index 000000000000..50a4c734f8e4 --- /dev/null +++ b/website/content/api/economy/indices/_index.md @@ -0,0 +1,11 @@ +# economy.indices + +## Get underlying data +###economy.indices() -> pandas.core.frame.DataFrame + +Get the top US indices + + Returns + ------- + indices: pd.DataFrame + Dataframe containing name, price, net change and percent change diff --git a/website/content/api/economy/inf/_index.md b/website/content/api/economy/inf/_index.md new file mode 100644 index 000000000000..4ddb512953ff --- /dev/null +++ b/website/content/api/economy/inf/_index.md @@ -0,0 +1,34 @@ +# economy.inf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.inf(start_year: int = 2010) -> pandas.core.frame.DataFrame + +Get historical Inflation for United States from AlphaVantage + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + + Returns + ------- + pd.DataFrame + DataFrame of inflation rates + +## Getting charts +###economy.inf(start_year: int = 2010, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display US Inflation from AlphaVantage + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + raw : bool, optional + Flag to show raw data, by default False + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/macro/_index.md b/website/content/api/economy/macro/_index.md new file mode 100644 index 000000000000..13ecabe08516 --- /dev/null +++ b/website/content/api/economy/macro/_index.md @@ -0,0 +1,68 @@ +# economy.macro + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.macro(parameters: list = None, countries: list = None, transform: str = '', start_date: str = '1900-01-01', end_date=datetime.date(2022, 9, 20), currency: str = '') -> Tuple[Any, Dict[Any, Dict[Any, Any]], str] + +This functions groups the data queried from the EconDB database [Source: EconDB] + + Parameters + ---------- + parameters: list + The type of data you wish to download. Available parameters can be accessed through economy.macro_parameters(). + countries : list + The selected country or countries. Available countries can be accessed through economy.macro_countries(). + transform : str + The selected transform. Available transforms can be accessed through get_macro_transform(). + start_date : str + The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + currency : str + In what currency you wish to convert all values. + + Returns + ---------- + pd.DataFrame + A DataFrame with the requested macro data of all chosen countries + Dictionary + A dictionary containing the units of each country's parameter (e.g. EUR) + str + Denomination which can be Trillions, Billions, Millions, Thousands + +## Getting charts +###economy.macro(parameters: list = None, countries: list = None, transform: str = '', start_date: str = '1900-01-01', end_date: str = '2022-09-20', currency: str = '', raw: bool = False, external_axes: Optional[List[axes]] = None, export: str = '', chart=True) + +Show the received macro data about a company [Source: EconDB] + + Parameters + ---------- + parameters: list + The type of data you wish to display. Available parameters can be accessed through get_macro_parameters(). + countries : list + The selected country or countries. Available countries can be accessed through get_macro_countries(). + transform : str + select data transformation from: + '' - no transformation + 'TPOP' - total percentage change on period, + 'TOYA' - total percentage since 1 year ago, + 'TUSD' - level USD, + 'TPGP' - Percentage of GDP, + 'TNOR' - Start = 100 + start_date : str + The starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + The end date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + currency : str + In what currency you wish to convert all values. + raw : bool + Whether to display the raw output. + external_axes: Optional[List[plt.axes]] + External axes to plot on + export : str + Export data to csv,json,xlsx or png,jpg,pdf,svg file + + Returns + ---------- + Plots the Series. diff --git a/website/content/api/economy/macro_countries/_index.md b/website/content/api/economy/macro_countries/_index.md new file mode 100644 index 000000000000..b458b7b30a18 --- /dev/null +++ b/website/content/api/economy/macro_countries/_index.md @@ -0,0 +1,11 @@ +# economy.macro_countries + +## Get underlying data +###economy.macro_countries() -> Dict[str, str] + +This function returns the available countries and respective currencies. + + Returns + ---------- + Dict[str, str] + A dictionary with the available countries and respective currencies. diff --git a/website/content/api/economy/macro_parameters/_index.md b/website/content/api/economy/macro_parameters/_index.md new file mode 100644 index 000000000000..6ab5fa074621 --- /dev/null +++ b/website/content/api/economy/macro_parameters/_index.md @@ -0,0 +1,11 @@ +# economy.macro_parameters + +## Get underlying data +###economy.macro_parameters() -> Dict[str, Dict[str, str]] + +This function returns the available macro parameters with detail. + + Returns + ---------- + Dict[str, Dict[str, str]] + A dictionary with the available macro parameters. diff --git a/website/content/api/economy/overview/_index.md b/website/content/api/economy/overview/_index.md new file mode 100644 index 000000000000..b1cf62e381e3 --- /dev/null +++ b/website/content/api/economy/overview/_index.md @@ -0,0 +1,11 @@ +# economy.overview + +## Get underlying data +###economy.overview() -> pandas.core.frame.DataFrame + +Scrape data for market overview + + Returns + ------- + overview: pd.DataFrame + Dataframe containing name, price, net change and percent change diff --git a/website/content/api/economy/perfmap/_index.md b/website/content/api/economy/perfmap/_index.md new file mode 100644 index 000000000000..df1493d6ff18 --- /dev/null +++ b/website/content/api/economy/perfmap/_index.md @@ -0,0 +1,13 @@ +# economy.perfmap + +## Get underlying data +###economy.perfmap(period: str = '1d', map_filter: str = 'sp500') + +Opens Finviz map website in a browser. [Source: Finviz] + + Parameters + ---------- + period : str + Performance period. Available periods are 1d, 1w, 1m, 3m, 6m, 1y. + scope : str + Map filter. Available map filters are sp500, world, full, etf. diff --git a/website/content/api/economy/performance/_index.md b/website/content/api/economy/performance/_index.md new file mode 100644 index 000000000000..a1dbeaf08934 --- /dev/null +++ b/website/content/api/economy/performance/_index.md @@ -0,0 +1,20 @@ +# economy.performance + +## Get underlying data +###economy.performance(group: str = 'sector', sortby: str = 'Name', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get group (sectors, industry or country) performance data. [Source: Finviz] + + Parameters + ---------- + group : str + Group by category. Available groups can be accessed through get_groups(). + sortby : str + Column to sort by + ascend : bool + Flag to sort in ascending order + + Returns + ---------- + pd.DataFrame + dataframe with performance data diff --git a/website/content/api/economy/rtps/_index.md b/website/content/api/economy/rtps/_index.md new file mode 100644 index 000000000000..a8e10b56214e --- /dev/null +++ b/website/content/api/economy/rtps/_index.md @@ -0,0 +1,27 @@ +# economy.rtps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.rtps() -> pandas.core.frame.DataFrame + +Get real-time performance sector data + + Returns + ---------- + df_sectors : pd.Dataframe + Real-time performance data + +## Getting charts +###economy.rtps(raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display Real-Time Performance sector. [Source: AlphaVantage] + + Parameters + ---------- + raw : bool + Output only raw data + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/search_index/_index.md b/website/content/api/economy/search_index/_index.md new file mode 100644 index 000000000000..0f7e2203bf0b --- /dev/null +++ b/website/content/api/economy/search_index/_index.md @@ -0,0 +1,16 @@ +# economy.search_index + +## Get underlying data +###economy.search_index(keyword: list, limit: int = 10) -> pandas.core.frame.DataFrame + +Search indices by keyword. [Source: FinanceDatabase] + Parameters + ---------- + keyword: list + The keyword you wish to search for. This can include spaces. + limit: int + The amount of views you want to show, by default this is set to 10. + Returns + ---------- + pd.Dataframe + Dataframe with the available options. diff --git a/website/content/api/economy/spectrum/_index.md b/website/content/api/economy/spectrum/_index.md new file mode 100644 index 000000000000..b687d60cfb63 --- /dev/null +++ b/website/content/api/economy/spectrum/_index.md @@ -0,0 +1,25 @@ +# economy.spectrum + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.spectrum(group: str = 'sector') + +Get group (sectors, industry or country) valuation/performance data. [Source: Finviz] + + Parameters + ---------- + group : str + Group by category. Available groups can be accessed through get_groups(). + +## Getting charts +###economy.spectrum(group: str = 'sector', export: str = '', chart=True) + +Display finviz spectrum in system viewer [Source: Finviz] + + Parameters + ---------- + group: str + Group by category. Available groups can be accessed through get_groups(). + export: str + Format to export data diff --git a/website/content/api/economy/treasury/_index.md b/website/content/api/economy/treasury/_index.md new file mode 100644 index 000000000000..555818e56113 --- /dev/null +++ b/website/content/api/economy/treasury/_index.md @@ -0,0 +1,56 @@ +# economy.treasury + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.treasury(instruments: list = None, maturities: list = None, frequency: str = 'monthly', start_date: str = '1900-01-01', end_date: str = '2022-09-20') -> pandas.core.frame.DataFrame + +Get U.S. Treasury rates [Source: EconDB] + + Parameters + ---------- + instruments: list + Type(s) of treasuries, nominal, inflation-adjusted (long term average) or secondary market. + Available options can be accessed through economy.treasury_maturities(). + maturities : list + Treasury maturities to get. Available options can be accessed through economy.treasury_maturities(). + frequency : str + Frequency of the data, this can be annually, monthly, weekly or daily. + start_date : str + Starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + End date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + + Returns + ---------- + treasury_data: pd.Dataframe + Holds data of the selected types and maturities + +## Getting charts +###economy.treasury(instruments: list = None, maturities: list = None, frequency: str = 'monthly', start_date: str = '1900-01-01', end_date: str = '2022-09-20', raw: bool = False, external_axes: Optional[List[axes]] = None, export: str = '', chart=True) + +Display U.S. Treasury rates [Source: EconDB] + + Parameters + ---------- + instruments: list + Type(s) of treasuries, nominal, inflation-adjusted or secondary market. + Available options can be accessed through economy.treasury_maturities(). + maturities : list + Treasury maturities to display. Available options can be accessed through economy.treasury_maturities(). + frequency : str + Frequency of the data, this can be daily, weekly, monthly or annually + start_date : str + Starting date, format "YEAR-MONTH-DAY", i.e. 2010-12-31. + end_date : str + End date, format "YEAR-MONTH-DAY", i.e. 2020-06-05. + raw : bool + Whether to display the raw output. + external_axes: Optional[List[plt.axes]] + External axes to plot on + export : str + Export data to csv,json,xlsx or png,jpg,pdf,svg file + + Returns + ---------- + Plots the Treasury Series. diff --git a/website/content/api/economy/treasury_maturities/_index.md b/website/content/api/economy/treasury_maturities/_index.md new file mode 100644 index 000000000000..a0c86b731e2d --- /dev/null +++ b/website/content/api/economy/treasury_maturities/_index.md @@ -0,0 +1,11 @@ +# economy.treasury_maturities + +## Get underlying data +###economy.treasury_maturities() -> pandas.core.frame.DataFrame + +Get treasury maturity options [Source: EconDB] + + Returns + ---------- + df: pd.DataFrame + Contains the name of the instruments and a string containing all options. diff --git a/website/content/api/economy/tyld/_index.md b/website/content/api/economy/tyld/_index.md new file mode 100644 index 000000000000..2b9e9671c36e --- /dev/null +++ b/website/content/api/economy/tyld/_index.md @@ -0,0 +1,42 @@ +# economy.tyld + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.tyld(interval: str = 'm', maturity: str = '10y', start_date: str = '2010-01-01') -> pandas.core.frame.DataFrame + +Get historical yield for a given maturity + + Parameters + ---------- + interval : str + Interval for data. Can be "d","w","m" for daily, weekly or monthly, by default "m" + start_date: str + Start date for data. Should be in YYYY-MM-DD format, by default "2010-01-01" + maturity : str + Maturity timeline. Can be "3mo","5y","10y" or "30y", by default "10y" + + Returns + ------- + pd.DataFrame + Dataframe of historical yields + +## Getting charts +###economy.tyld(interval: str = 'm', maturity: str = '10y', start_date: str = '2010-01-01', raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display historical treasury yield for given maturity + + Parameters + ---------- + interval : str + Interval for data. Can be "d","w","m" for daily, weekly or monthly, by default "m" + maturity : str + Maturity timeline. Can be "3mo","5y","10y" or "30y", by default "10y" + start_date: str + Start date for data. Should be in YYYY-MM-DD format, by default "2010-01-01" + raw : bool, optional + Flag to display raw data, by default False + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/unemp/_index.md b/website/content/api/economy/unemp/_index.md new file mode 100644 index 000000000000..e2fe16c8047a --- /dev/null +++ b/website/content/api/economy/unemp/_index.md @@ -0,0 +1,34 @@ +# economy.unemp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.unemp(start_year: int = 2010) -> pandas.core.frame.DataFrame + +Get historical unemployment for United States + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + + Returns + ------- + pd.DataFrame + Dataframe of historical yields + +## Getting charts +###economy.unemp(start_year: int = 2010, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display US unemployment AlphaVantage + + Parameters + ---------- + start_year : int, optional + Start year for plot, by default 2010 + raw : bool, optional + Flag to show raw data, by default False + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/economy/usbonds/_index.md b/website/content/api/economy/usbonds/_index.md new file mode 100644 index 000000000000..1b834d34f3fe --- /dev/null +++ b/website/content/api/economy/usbonds/_index.md @@ -0,0 +1,11 @@ +# economy.usbonds + +## Get underlying data +###economy.usbonds() -> pandas.core.frame.DataFrame + +Scrape data for us bonds + + Returns + ------- + bonds: pd.DataFrame + Dataframe containing name, coupon rate, yield and change in yield diff --git a/website/content/api/economy/valuation/_index.md b/website/content/api/economy/valuation/_index.md new file mode 100644 index 000000000000..d9ca51f432e6 --- /dev/null +++ b/website/content/api/economy/valuation/_index.md @@ -0,0 +1,20 @@ +# economy.valuation + +## Get underlying data +###economy.valuation(group: str = 'sector', sortby: str = 'Name', ascend: bool = True) -> pandas.core.frame.DataFrame + +Get group (sectors, industry or country) valuation data. [Source: Finviz] + + Parameters + ---------- + group : str + Group by category. Available groups can be accessed through get_groups(). + sortby : str + Column to sort by + ascend : bool + Flag to sort in ascending order + + Returns + ---------- + pd.DataFrame + dataframe with valuation/performance data diff --git a/website/content/api/economy/ycrv/_index.md b/website/content/api/economy/ycrv/_index.md new file mode 100644 index 000000000000..58b1630dd189 --- /dev/null +++ b/website/content/api/economy/ycrv/_index.md @@ -0,0 +1,30 @@ +# economy.ycrv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###economy.ycrv(country: str) -> pandas.core.frame.DataFrame + +Get yield curve for specified country. [Source: Investing.com] + + Parameters + ---------- + country: str + Country to display yield curve. List of available countries is accessible through get_ycrv_countries(). + + Returns + ------- + pd.DataFrame + Country yield curve + +## Getting charts +###economy.ycrv(country: str, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, raw: bool = False, export: str = '', chart=True) + +Display yield curve for specified country. [Source: Investing.com] + + Parameters + ---------- + country: str + Country to display yield curve. List of available countries is accessible through get_ycrv_countries(). + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/etf/candle/_index.md b/website/content/api/etf/candle/_index.md new file mode 100644 index 000000000000..174cd5752684 --- /dev/null +++ b/website/content/api/etf/candle/_index.md @@ -0,0 +1,45 @@ +# etf.candle + +## Get underlying data +###etf.candle(symbol: str, data: pandas.core.frame.DataFrame = None, use_matplotlib: bool = True, intraday: bool = False, add_trend: bool = False, ma: Optional[Iterable[int]] = None, asset_type: str = '', start_date: datetime.datetime = datetime.datetime(2019, 9, 16, 18, 22, 32, 961025), interval: int = 1440, end_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 961026), prepost: bool = False, source: str = 'yf', iexrange: str = 'ytd', weekly: bool = False, monthly: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, raw: bool = False) + +Shows candle plot of loaded ticker. [Source: Yahoo Finance, IEX Cloud or Alpha Vantage] + + Parameters + ---------- + symbol: str + Ticker name + data: pd.DataFrame + Stock dataframe + use_matplotlib: bool + Flag to use matplotlib instead of interactive plotly chart + intraday: bool + Flag for intraday data for plotly range breaks + add_trend: bool + Flag to add high and low trends to chart + ma: Tuple[int] + Moving averages to add to the candle + asset_type_: str + String to include in title + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + asset_type_: str + String to include in title + start_date: datetime + Start date to get data from with + interval: int + Interval (in minutes) to get data 1, 5, 15, 30, 60 or 1440 + end_date: datetime + End date to get data from with + prepost: bool + Pre and After hours data + source: str + Source of data extracted + iexrange: str + Timeframe to get IEX data. + weekly: bool + Flag to get weekly data + monthly: bool + Flag to get monthly data + raw : bool, optional + Flag to display raw data, by default False diff --git a/website/content/api/etf/disc/mover/_index.md b/website/content/api/etf/disc/mover/_index.md new file mode 100644 index 000000000000..46de80f15d2b --- /dev/null +++ b/website/content/api/etf/disc/mover/_index.md @@ -0,0 +1,32 @@ +# etf.disc.mover + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.disc.mover(sort_type: str = 'gainers', export: bool = False) -> pandas.core.frame.DataFrame + + + Scrape data for top etf movers. + Parameters + ---------- + sort_type: str + Data to get. Can be "gainers", "decliners" or "active" + + Returns + ------- + etfmovers: pd.DataFrame + Datafame containing the name, price, change and the volume of the etf + +## Getting charts +###etf.disc.mover(sort_type: str = 'gainers', limit: int = 10, export='', chart=True) + + + Show top ETF movers from wsj.com + Parameters + ---------- + sort_type: str + What to show. Either Gainers, Decliners or Activity + limit: int + Number of etfs to show + export: str + Format to export data diff --git a/website/content/api/etf/etf_by_category/_index.md b/website/content/api/etf/etf_by_category/_index.md new file mode 100644 index 000000000000..45c7e021374f --- /dev/null +++ b/website/content/api/etf/etf_by_category/_index.md @@ -0,0 +1,34 @@ +# etf.etf_by_category + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.etf_by_category(category: str) -> Dict + +Return a selection of ETFs based on category filtered by total assets. + [Source: Finance Database] + + Parameters + ---------- + category: str + Search by category to find ETFs matching the criteria. + + Returns + ---------- + data : Dict + Dictionary with ETFs that match a certain description + +## Getting charts +###etf.etf_by_category(category: str, limit: int = 10, export: str = '', chart=True) + +Display a selection of ETFs based on a category filtered by total assets. + [Source: Finance Database] + + Parameters + ---------- + description: str + Search by description to find ETFs matching the criteria. + limit: int + Limit of ETFs to display + export: str + Type of format to export data diff --git a/website/content/api/etf/etf_by_name/_index.md b/website/content/api/etf/etf_by_name/_index.md new file mode 100644 index 000000000000..56e32a750503 --- /dev/null +++ b/website/content/api/etf/etf_by_name/_index.md @@ -0,0 +1,33 @@ +# etf.etf_by_name + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.etf_by_name(name_to_search: str) -> pandas.core.frame.DataFrame + +Get an ETF symbol and name based on ETF string to search. [Source: StockAnalysis] + + Parameters + ---------- + name_to_search: str + ETF name to match + + Returns + ------- + df: pd.Dataframe + Dataframe with symbols and names + +## Getting charts +###etf.etf_by_name(name: str, limit: int = 10, export: str = '', chart=True) + +Display ETFs matching search string. [Source: StockAnalysis] + + Parameters + ---------- + name: str + String being matched + limit: int + Limit of ETFs to display + export: str + Export to given file type + diff --git a/website/content/api/etf/holdings/_index.md b/website/content/api/etf/holdings/_index.md new file mode 100644 index 000000000000..7f6f38c8592c --- /dev/null +++ b/website/content/api/etf/holdings/_index.md @@ -0,0 +1,32 @@ +# etf.holdings + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.holdings(symbol: str) -> pandas.core.frame.DataFrame + +Get ETF holdings + + Parameters + ---------- + symbol: str + Symbol to get holdings for + + Returns + ------- + df: pd.DataFrame + Dataframe of holdings + +## Getting charts +###etf.holdings(symbol: str, limit: int = 10, export: str = '', chart=True) + + + + Parameters + ---------- + symbol: str + ETF symbol to show holdings for + limit: int + Number of holdings to show + export: str + Format to export data diff --git a/website/content/api/etf/ld/_index.md b/website/content/api/etf/ld/_index.md new file mode 100644 index 000000000000..518d64088881 --- /dev/null +++ b/website/content/api/etf/ld/_index.md @@ -0,0 +1,34 @@ +# etf.ld + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.ld(description: str) -> Dict + +Return a selection of ETFs based on description filtered by total assets. + [Source: Finance Database] + + Parameters + ---------- + description: str + Search by description to find ETFs matching the criteria. + + Returns + ---------- + data : Dict + Dictionary with ETFs that match a certain description + +## Getting charts +###etf.ld(description: str, limit: int = 10, export: str = '', chart=True) + +Display a selection of ETFs based on description filtered by total assets. + [Source: Finance Database] + + Parameters + ---------- + description: str + Search by description to find ETFs matching the criteria. + limit: int + Limit of ETFs to display + export: str + Type of format to export data diff --git a/website/content/api/etf/ln/_index.md b/website/content/api/etf/ln/_index.md new file mode 100644 index 000000000000..de771c6f5325 --- /dev/null +++ b/website/content/api/etf/ln/_index.md @@ -0,0 +1,32 @@ +# etf.ln + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.ln(name: str) -> Dict + +Return a selection of ETFs based on name filtered by total assets. [Source: Finance Database] + + Parameters + ---------- + name: str + Search by name to find ETFs matching the criteria. + + Returns + ---------- + data : Dict + Dictionary with ETFs that match a certain name + +## Getting charts +###etf.ln(name: str, limit: int = 10, export: str = '', chart=True) + +Display a selection of ETFs based on name filtered by total assets. [Source: Finance Database] + + Parameters + ---------- + name: str + Search by name to find ETFs matching the criteria. + limit: int + Limit of ETFs to display + export: str + Type of format to export data diff --git a/website/content/api/etf/load/_index.md b/website/content/api/etf/load/_index.md new file mode 100644 index 000000000000..5e33a459751f --- /dev/null +++ b/website/content/api/etf/load/_index.md @@ -0,0 +1,61 @@ +# etf.load + +## Get underlying data +###etf.load(symbol: str, start_date: datetime.datetime = datetime.datetime(2019, 9, 16, 18, 22, 32, 961016), interval: int = 1440, end_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 961023), prepost: bool = False, source: str = 'YahooFinance', iexrange: str = 'ytd', weekly: bool = False, monthly: bool = False) + + + Load a symbol to perform analysis using the string above as a template. + + Optional arguments and their descriptions are listed above. + + The default source is, yFinance (https://pypi.org/project/yfinance/). + Other sources: + - AlphaVantage (https://www.alphavantage.co/documentation/) + - IEX Cloud (https://iexcloud.io/docs/api/) + - Eod Historical Data (https://eodhistoricaldata.com/financial-apis/) + + Please note that certain analytical features are exclusive to the specific source. + + To load a symbol from an exchange outside of the NYSE/NASDAQ default, use yFinance as the source and + add the corresponding exchange to the end of the symbol. i.e. ‘BNS.TO’. Note this may be possible with + other paid sources check their docs. + + BNS is a dual-listed stock, there are separate options chains and order books for each listing. + Opportunities for arbitrage may arise from momentary pricing discrepancies between listings + with a dynamic exchange rate as a second order opportunity in ForEx spreads. + + Find the full list of supported exchanges here: + https://help.yahoo.com/kb/exchanges-data-providers-yahoo-finance-sln2310.html + + Certain analytical features, such as VWAP, require the ticker to be loaded as intraday + using the ‘-i x’ argument. When encountering this error, simply reload the symbol using + the interval argument. i.e. ‘load -t BNS -s YYYY-MM-DD -i 1 -p’ loads one-minute intervals, + including Pre/After Market data, using the default source, yFinance. + + Certain features, such as the Prediction menu, require the symbol to be loaded as daily and not intraday. + + Parameters + ---------- + symbol: str + Ticker to get data + start_date: datetime + Start date to get data from with + interval: int + Interval (in minutes) to get data 1, 5, 15, 30, 60 or 1440 + end_date: datetime + End date to get data from with + prepost: bool + Pre and After hours data + source: str + Source of data extracted + iexrange: str + Timeframe to get IEX data. + weekly: bool + Flag to get weekly data + monthly: bool + Flag to get monthly data + + Returns + ------- + df_stock_candidate: pd.DataFrame + Dataframe of data diff --git a/website/content/api/etf/news/_index.md b/website/content/api/etf/news/_index.md new file mode 100644 index 000000000000..544737058cd7 --- /dev/null +++ b/website/content/api/etf/news/_index.md @@ -0,0 +1,44 @@ +# etf.news + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.news(query: str, limit: int = 10, start_date: str = '2022-09-13', show_newest: bool = True, sources: str = '') -> List[Tuple[Any, Any]] + +Get news for a given term. [Source: NewsAPI] + + Parameters + ---------- + query : str + term to search on the news articles + start_date: str + date to start searching articles from formatted YYYY-MM-DD + show_newest: bool + flag to show newest articles first + sources: str + sources to exclusively show news from + + Returns + ---------- + tables : List[Tuple] + List of tuples containing news df in first index and dict containing title of news df + +## Getting charts +###etf.news(query: str, limit: int = 3, start_date: str = '2022-09-13', show_newest: bool = True, sources: str = '', export: str = '', chart=True) -> None + +Display news for a given term. [Source: NewsAPI] + + Parameters + ---------- + query : str + term to search on the news articles + start_date: str + date to start searching articles from formatted YYYY-MM-DD + limit : int + number of articles to display + show_newest: bool + flag to show newest articles first + sources: str + sources to exclusively show news from + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/etf/overview/_index.md b/website/content/api/etf/overview/_index.md new file mode 100644 index 000000000000..778bff01d9f9 --- /dev/null +++ b/website/content/api/etf/overview/_index.md @@ -0,0 +1,30 @@ +# etf.overview + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.overview(symbol: str) -> pandas.core.frame.DataFrame + +Get overview data for selected etf + + Parameters + ---------- + etf_symbol : str + Etf symbol to get overview for + + Returns + ---------- + df : pd.DataFrame + Dataframe of stock overview data + +## Getting charts +###etf.overview(symbol: str, export: str = '', chart=True) + +Print etf overview information + + Parameters + ---------- + symbol:str + ETF symbols to display overview for + export:str + Format to export data diff --git a/website/content/api/etf/scr/screen/_index.md b/website/content/api/etf/scr/screen/_index.md new file mode 100644 index 000000000000..1ce2586efd0c --- /dev/null +++ b/website/content/api/etf/scr/screen/_index.md @@ -0,0 +1,39 @@ +# etf.scr.screen + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.scr.screen(preset: str) + + + Screens the etfs pulled from my repo (https://github.com/jmaslek/etf_scraper), + which is updated hourly through the market day + + Parameters + ---------- + preset: str + Screener to use from presets + + Returns + ---------- + df : pd.DataFrame + Screened dataframe + +## Getting charts +###etf.scr.screen(preset: str, num_to_show: int, sortby: str, ascend: bool, export: str = '', chart=True) + +Display screener output + + Parameters + ---------- + preset: str + Preset to use + num_to_show: int + Number of etfs to show + sortby: str + Column to sort by + ascend: bool + Ascend when sorted + export: str + Output format of export + diff --git a/website/content/api/etf/summary/_index.md b/website/content/api/etf/summary/_index.md new file mode 100644 index 000000000000..165376b6e09a --- /dev/null +++ b/website/content/api/etf/summary/_index.md @@ -0,0 +1,28 @@ +# etf.summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.summary(name: str) -> str + +Return summary description of ETF. [Source: Yahoo Finance] + + Parameters + ---------- + name: str + ETF name + + Returns + ---------- + str + Summary description of the ETF + +## Getting charts +###etf.summary(name: str, chart=True) + +Display ETF description summary. [Source: Yahoo Finance] + + Parameters + ---------- + name: str + ETF name diff --git a/website/content/api/etf/symbols/_index.md b/website/content/api/etf/symbols/_index.md new file mode 100644 index 000000000000..c8a6922238ff --- /dev/null +++ b/website/content/api/etf/symbols/_index.md @@ -0,0 +1,13 @@ +# etf.symbols + +## Get underlying data +###etf.symbols() -> Tuple[List[str], List[str]] + +Gets all etf names and symbols + + Returns + ------- + etf_symbols: List[str]: + List of all available etf symbols + etf_names: List[str] + List of all available etf names diff --git a/website/content/api/etf/weights/_index.md b/website/content/api/etf/weights/_index.md new file mode 100644 index 000000000000..a21cf863c53a --- /dev/null +++ b/website/content/api/etf/weights/_index.md @@ -0,0 +1,36 @@ +# etf.weights + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###etf.weights(name: str) -> Dict + +Return sector weightings allocation of ETF. [Source: Yahoo Finance] + + Parameters + ---------- + name: str + ETF name + + Returns + ---------- + Dict + Dictionary with sector weightings allocation + +## Getting charts +###etf.weights(name: str, raw: bool = False, min_pct_to_display: float = 5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display sector weightings allocation of ETF. [Source: Yahoo Finance] + + Parameters + ---------- + name: str + ETF name + raw: bool + Display sector weighting allocation + min_pct_to_display: float + Minimum percentage to display sector + export: str + Type of format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/forex/candle/_index.md b/website/content/api/forex/candle/_index.md new file mode 100644 index 000000000000..9fe032cabfbd --- /dev/null +++ b/website/content/api/forex/candle/_index.md @@ -0,0 +1,17 @@ +# forex.candle + +## Get underlying data +###forex.candle(data: pandas.core.frame.DataFrame, to_symbol: str = '', from_symbol: str = '', ma: Optional[Iterable[int]] = None, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) + +Show candle plot for fx data. + + Parameters + ---------- + data : pd.DataFrame + Loaded fx historical data + to_symbol : str + To forex symbol + from_symbol : str + From forex symbol + external_axes: Optional[List[plt.Axes]] + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/forex/get_currency_list/_index.md b/website/content/api/forex/get_currency_list/_index.md new file mode 100644 index 000000000000..356cf08e9aac --- /dev/null +++ b/website/content/api/forex/get_currency_list/_index.md @@ -0,0 +1,6 @@ +# forex.get_currency_list + +## Get underlying data +###forex.get_currency_list() -> List + +Load AV currency codes from a local diff --git a/website/content/api/forex/hist/_index.md b/website/content/api/forex/hist/_index.md new file mode 100644 index 000000000000..ef309ac60bef --- /dev/null +++ b/website/content/api/forex/hist/_index.md @@ -0,0 +1,24 @@ +# forex.hist + +## Get underlying data +###forex.hist(to_symbol: str = 'USD', from_symbol: str = 'EUR', resolution: str = 'd', interval: int = 5, start_date: str = '') -> pandas.core.frame.DataFrame + +Get historical forex data. + + Parameters + ---------- + to_symbol : str + To forex symbol + from_symbol : str + From forex symbol + resolution : str, optional + Resolution of data. Can be "i", "d", "w", "m" for intraday, daily, weekly or monthly + interval : int, optional + Interval for intraday data + start_date : str, optional + Start date for data. + + Returns + ------- + pd.DataFrame + Historical data for forex pair diff --git a/website/content/api/forex/load/_index.md b/website/content/api/forex/load/_index.md new file mode 100644 index 000000000000..db877f355947 --- /dev/null +++ b/website/content/api/forex/load/_index.md @@ -0,0 +1,26 @@ +# forex.load + +## Get underlying data +###forex.load(to_symbol: str, from_symbol: str, resolution: str = 'd', interval: str = '1day', start_date: str = '2021-09-20', source: str = 'YahooFinance') -> pandas.core.frame.DataFrame + +Loads forex for two given symbols + + Parameters + ---------- + to_symbol : str + The from currency symbol. Ex: USD, EUR, GBP, YEN + from_symbol: str + The from currency symbol. Ex: USD, EUR, GBP, YEN + resolution: str + The resolution for the data + interval: str + What interval to get data for + start_date: str + When to begin loading in data + source: str + Where to get data from + + Returns + ------- + pd.DataFrame + The loaded data diff --git a/website/content/api/forex/oanda/calendar/_index.md b/website/content/api/forex/oanda/calendar/_index.md new file mode 100644 index 000000000000..bad838fe1e56 --- /dev/null +++ b/website/content/api/forex/oanda/calendar/_index.md @@ -0,0 +1,32 @@ +# forex.oanda.calendar + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.calendar(days: int, instrument: Optional[str] = None) -> Union[pandas.core.frame.DataFrame, bool] + +Request data of significant events calendar. + + Parameters + ---------- + instrument : Union[str, None] + The loaded currency pair, by default None + days : int + Number of days in advance + + Returns + ------- + Union[pd.DataFrame, bool] + Calendar events data or False + +## Getting charts +###forex.oanda.calendar(instrument: str, days: int = 7, chart=True) + +View calendar of significant events. + + Parameters + ---------- + instrument : str + The loaded currency pair + days : int + Number of days in advance diff --git a/website/content/api/forex/oanda/cancel/_index.md b/website/content/api/forex/oanda/cancel/_index.md new file mode 100644 index 000000000000..e2fea5425aac --- /dev/null +++ b/website/content/api/forex/oanda/cancel/_index.md @@ -0,0 +1,27 @@ +# forex.oanda.cancel + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.cancel(orderID: str, accountID: str = 'REPLACE_ME') -> Union[str, bool] + +Request cancellation of a pending order. + + Parameters + ---------- + orderID : str + The pending order ID to cancel. + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + +## Getting charts +###forex.oanda.cancel(accountID: str, orderID: str = '', chart=True) + +Cancel a Pending Order. + + Parameters + ---------- + accountID : str + Oanda user account ID + orderID : str + The pending order ID to cancel. diff --git a/website/content/api/forex/oanda/candles/_index.md b/website/content/api/forex/oanda/candles/_index.md new file mode 100644 index 000000000000..1ef9aebe6247 --- /dev/null +++ b/website/content/api/forex/oanda/candles/_index.md @@ -0,0 +1,44 @@ +# forex.oanda.candles + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.candles(instrument: Optional[str] = None, granularity: str = 'D', candlecount: int = 180) -> Union[pandas.core.frame.DataFrame, bool] + +Request data for candle chart. + + Parameters + ---------- + instrument : str + Loaded currency pair code + granularity : str, optional + Data granularity, by default "D" + candlecount : int, optional + Limit for the number of data points, by default 180 + + Returns + ------- + Union[pd.DataFrame, bool] + Candle chart data or False + +## Getting charts +###forex.oanda.candles(instrument: str = '', granularity: str = 'D', candlecount: int = 180, additional_charts: Optional[Dict[str, bool]] = None, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Show candle chart. + + Note that additional plots (ta indicators) not supported in external axis mode. + + Parameters + ---------- + instrument : str + The loaded currency pair + granularity : str, optional + The timeframe to get for the candle chart. Seconds: S5, S10, S15, S30 + Minutes: M1, M2, M4, M5, M10, M15, M30 Hours: H1, H2, H3, H4, H6, H8, H12 + Day (default): D, Week: W Month: M, + candlecount : int, optional + Limit for the number of data points + additional_charts : Dict[str, bool] + A dictionary of flags to include additional charts + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/forex/oanda/close/_index.md b/website/content/api/forex/oanda/close/_index.md new file mode 100644 index 000000000000..fd36953bd1a1 --- /dev/null +++ b/website/content/api/forex/oanda/close/_index.md @@ -0,0 +1,36 @@ +# forex.oanda.close + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.close(orderID: str, units: Optional[int] = 0, accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Close a trade. + + Parameters + ---------- + orderID : str + ID of the order to close + units : Union[int, None] + Number of units to close. If empty default to all. + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Close trades data or False + +## Getting charts +###forex.oanda.close(accountID: str, orderID: str = '', units: Optional[int] = None, chart=True) + +Close a trade. + + Parameters + ---------- + accountID : str + Oanda user account ID + orderID : str + ID of the order to close + units : Union[int, None] + Number of units to close. If empty default to all. diff --git a/website/content/api/forex/oanda/fwd/_index.md b/website/content/api/forex/oanda/fwd/_index.md new file mode 100644 index 000000000000..266b15a4a8e5 --- /dev/null +++ b/website/content/api/forex/oanda/fwd/_index.md @@ -0,0 +1,34 @@ +# forex.oanda.fwd + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.fwd(to_symbol: str = 'USD', from_symbol: str = 'EUR') + +Gets forward rates from fxempire + + Parameters + ---------- + to_symbol: str + To currency + from_symbol: str + From currency + + Returns + ------- + df: pd.DataFrame + + +## Getting charts +###forex.oanda.fwd(to_symbol: str = 'USD', from_symbol: str = 'EUR', export: str = '', chart=True) + +Display forward rates for currency pairs + + Parameters + ---------- + to_symbol: str + To currency + from_symbol: str + From currency + export: str + Format to export data diff --git a/website/content/api/forex/oanda/listorders/_index.md b/website/content/api/forex/oanda/listorders/_index.md new file mode 100644 index 000000000000..082064046488 --- /dev/null +++ b/website/content/api/forex/oanda/listorders/_index.md @@ -0,0 +1,31 @@ +# forex.oanda.listorders + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.listorders(order_state: str = 'PENDING', order_count: int = 0, accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request the orders list from Oanda. + + Parameters + ---------- + order_state : str + Filter orders by a specific state ("PENDING", "CANCELLED", etc.) + order_count : int + Limit the number of orders to retrieve + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + +## Getting charts +###forex.oanda.listorders(accountID: str, order_state: str = 'PENDING', order_count: int = 0, chart=True) + +List order history. + + Parameters + ---------- + accountID : str + Oanda user account ID + order_state : str + Filter orders by a specific state ("PENDING", "CANCELLED", etc.) + order_count : int + Limit the number of orders to retrieve diff --git a/website/content/api/forex/oanda/openpositions/_index.md b/website/content/api/forex/oanda/openpositions/_index.md new file mode 100644 index 000000000000..fab43f859154 --- /dev/null +++ b/website/content/api/forex/oanda/openpositions/_index.md @@ -0,0 +1,23 @@ +# forex.oanda.openpositions + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.openpositions(accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request information on open positions. + + Parameters + ---------- + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + +## Getting charts +###forex.oanda.openpositions(accountID: str, chart=True) + +Get information about open positions. + + Parameters + ---------- + accountID : str + Oanda user account ID diff --git a/website/content/api/forex/oanda/opentrades/_index.md b/website/content/api/forex/oanda/opentrades/_index.md new file mode 100644 index 000000000000..4c8cb77ac594 --- /dev/null +++ b/website/content/api/forex/oanda/opentrades/_index.md @@ -0,0 +1,28 @@ +# forex.oanda.opentrades + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.opentrades(accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request open trades data. + + Parameters + ---------- + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Open trades data or False + +## Getting charts +###forex.oanda.opentrades(accountID: str, chart=True) + +View open trades. + + Parameters + ---------- + accountID : str + Oanda user account ID diff --git a/website/content/api/forex/oanda/order/_index.md b/website/content/api/forex/oanda/order/_index.md new file mode 100644 index 000000000000..fdf341286049 --- /dev/null +++ b/website/content/api/forex/oanda/order/_index.md @@ -0,0 +1,40 @@ +# forex.oanda.order + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.order(price: int = 0, units: int = 0, instrument: Optional[str] = None, accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request creation of buy/sell trade order. + + Parameters + ---------- + instrument : Union[str, None] + The loaded currency pair, by default None + price : int + The price to set for the limit order. + units : int + The number of units to place in the order request. + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Orders data or False + +## Getting charts +###forex.oanda.order(accountID: str, instrument: str = '', price: int = 0, units: int = 0, chart=True) + +Create a buy/sell order. + + Parameters + ---------- + accountID : str + Oanda user account ID + instrument : str + The loaded currency pair + price : int + The price to set for the limit order. + units : int + The number of units to place in the order request. diff --git a/website/content/api/forex/oanda/orderbook/_index.md b/website/content/api/forex/oanda/orderbook/_index.md new file mode 100644 index 000000000000..07f9a60d8bcf --- /dev/null +++ b/website/content/api/forex/oanda/orderbook/_index.md @@ -0,0 +1,35 @@ +# forex.oanda.orderbook + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.orderbook(instrument: Optional[str] = None, accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request order book data for plotting. + + Parameters + ---------- + instrument : Union[str, None] + The loaded currency pair, by default None + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Order book data or False + +## Getting charts +###forex.oanda.orderbook(accountID: str, instrument: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + + + Plot the orderbook for the instrument if Oanda provides one. + + Parameters + ---------- + accountID : str + Oanda user account ID + instrument : str + The loaded currency pair + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/forex/oanda/pending/_index.md b/website/content/api/forex/oanda/pending/_index.md new file mode 100644 index 000000000000..53bbc8e125ea --- /dev/null +++ b/website/content/api/forex/oanda/pending/_index.md @@ -0,0 +1,28 @@ +# forex.oanda.pending + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.pending(accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request information on pending orders. + + Parameters + ---------- + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Pending orders data or False + +## Getting charts +###forex.oanda.pending(accountID: str, chart=True) + +Get information about pending orders. + + Parameters + ---------- + accountID : str + Oanda user account ID diff --git a/website/content/api/forex/oanda/positionbook/_index.md b/website/content/api/forex/oanda/positionbook/_index.md new file mode 100644 index 000000000000..97eaf1f1342e --- /dev/null +++ b/website/content/api/forex/oanda/positionbook/_index.md @@ -0,0 +1,34 @@ +# forex.oanda.positionbook + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.positionbook(instrument: Optional[str] = None, accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request position book data for plotting. + + Parameters + ---------- + instrument : Union[str, None] + The loaded currency pair, by default None + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Position book data or False + +## Getting charts +###forex.oanda.positionbook(accountID: str, instrument: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot a position book for an instrument if Oanda provides one. + + Parameters + ---------- + accountID : str + Oanda user account ID + instrument : str + The loaded currency pair + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/forex/oanda/price/_index.md b/website/content/api/forex/oanda/price/_index.md new file mode 100644 index 000000000000..74baea2a2681 --- /dev/null +++ b/website/content/api/forex/oanda/price/_index.md @@ -0,0 +1,32 @@ +# forex.oanda.price + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.price(accountID: str = 'REPLACE_ME', instrument: Optional[str] = None) -> Union[Dict[str, str], bool] + +Request price for a forex pair. + + Parameters + ---------- + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + instrument : Union[str, None] + The loaded currency pair, by default None + + Returns + ------- + Union[Dict[str, str], bool] + The currency pair price or False + +## Getting charts +###forex.oanda.price(account: str, instrument: Optional[str] = '', chart=True) + +View price for loaded currency pair. + + Parameters + ---------- + accountID : str + Oanda account ID + instrument : Union[str, None] + Instrument code or None diff --git a/website/content/api/forex/oanda/summary/_index.md b/website/content/api/forex/oanda/summary/_index.md new file mode 100644 index 000000000000..c3361a9dfe11 --- /dev/null +++ b/website/content/api/forex/oanda/summary/_index.md @@ -0,0 +1,28 @@ +# forex.oanda.summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.oanda.summary(accountID: str = 'REPLACE_ME') -> Union[pandas.core.frame.DataFrame, bool] + +Request Oanda account summary. + + Parameters + ---------- + accountID : str, optional + Oanda account ID, by default cfg.OANDA_ACCOUNT + + Returns + ------- + Union[pd.DataFrame, bool] + Account summary data or False + +## Getting charts +###forex.oanda.summary(accountID: str, chart=True) + +Print Oanda account summary. + + Parameters + ---------- + accountID : str + Oanda user account ID diff --git a/website/content/api/forex/quote/_index.md b/website/content/api/forex/quote/_index.md new file mode 100644 index 000000000000..c0d1be50e90c --- /dev/null +++ b/website/content/api/forex/quote/_index.md @@ -0,0 +1,32 @@ +# forex.quote + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###forex.quote(to_symbol: str = 'USD', from_symbol: str = 'EUR') -> Dict + +Get current exchange rate quote from alpha vantage. + + Parameters + ---------- + to_symbol : str + To forex symbol + from_symbol : str + From forex symbol + + Returns + ------- + Dict + Dictionary of exchange rate + +## Getting charts +###forex.quote(to_symbol: str = 'USD', from_symbol: str = 'EUR', chart=True) + +Display current forex pair exchange rate. + + Parameters + ---------- + to_symbol : str + To symbol + from_symbol : str + From forex symbol diff --git a/website/content/api/funds/info/_index.md b/website/content/api/funds/info/_index.md new file mode 100644 index 000000000000..e427a8520b8c --- /dev/null +++ b/website/content/api/funds/info/_index.md @@ -0,0 +1,32 @@ +# funds.info + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###funds.info(name: str, country: str = 'united states') -> pandas.core.frame.DataFrame + + + + Parameters + ---------- + name: str + Name of fund (not symbol) to get information + country: str + Country of fund + + Returns + ------- + pd.DataFrame + Dataframe of fund information + +## Getting charts +###funds.info(name: str, country: str = 'united states', chart=True) + +Display fund information. Finds name from symbol first if name is false + + Parameters + ---------- + name: str + Fund name to get info for + country : str + Country of fund diff --git a/website/content/api/funds/overview/_index.md b/website/content/api/funds/overview/_index.md new file mode 100644 index 000000000000..f69deec5e830 --- /dev/null +++ b/website/content/api/funds/overview/_index.md @@ -0,0 +1,34 @@ +# funds.overview + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###funds.overview(country: str = 'united states', limit: int = 20) -> pandas.core.frame.DataFrame + + + + Parameters + ---------- + country: str + Country to get overview for + limit: int + Number of results to get + + Returns + ------- + pd.DataFrame + Dataframe containing overview + +## Getting charts +###funds.overview(country: str = 'united states', limit: int = 10, export: str = '', chart=True) + +Displays an overview of the main funds from a country. + + Parameters + ---------- + country: str + Country to get overview for + limit: int + Number to show + export : str + Format to export data diff --git a/website/content/api/funds/search/_index.md b/website/content/api/funds/search/_index.md new file mode 100644 index 000000000000..1b7069882696 --- /dev/null +++ b/website/content/api/funds/search/_index.md @@ -0,0 +1,40 @@ +# funds.search + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###funds.search(by: str = 'name', value: str = '') -> pandas.core.frame.DataFrame + +Search investpy for matching funds + + Parameters + ---------- + by : str + Field to match on. Can be name, issuer, isin or symbol + value : str + String that will be searched for + + Returns + ------- + pd.DataFrame + Dataframe containing matches + +## Getting charts +###funds.search(by: str = 'name', value: str = '', country: str = 'united states', limit: int = 10, sortby: str = '', ascend: bool = False, chart=True) + +Display results of searching for Mutual Funds + + Parameters + ---------- + by : str + Field to match on. Can be name, issuer, isin or symbol + value : str + String that will be searched for + country: str + Country to filter on + limit: int + Number to show + sortby: str + Column to sort by + ascend: bool + Flag to sort in ascending order diff --git a/website/content/api/portfolio/calmar/_index.md b/website/content/api/portfolio/calmar/_index.md new file mode 100644 index 000000000000..1a8ff2d91a2a --- /dev/null +++ b/website/content/api/portfolio/calmar/_index.md @@ -0,0 +1,20 @@ +# portfolio.calmar + +## Get underlying data +###portfolio.calmar(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: int = 756) + +Get calmar ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window: int + Interval used for rolling values + + Returns + ------- + pd.DataFrame + DataFrame of calmar ratio of the benchmark and portfolio during different time periods + pd.Series + Series of calmar ratio data diff --git a/website/content/api/portfolio/commonsense/_index.md b/website/content/api/portfolio/commonsense/_index.md new file mode 100644 index 000000000000..fb936c51a87a --- /dev/null +++ b/website/content/api/portfolio/commonsense/_index.md @@ -0,0 +1,16 @@ +# portfolio.commonsense + +## Get underlying data +###portfolio.commonsense(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Get common sense ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of the portfolios and the benchmarks common sense ratio during different time periods diff --git a/website/content/api/portfolio/distr/_index.md b/website/content/api/portfolio/distr/_index.md new file mode 100644 index 000000000000..8ae87c0e1305 --- /dev/null +++ b/website/content/api/portfolio/distr/_index.md @@ -0,0 +1,35 @@ +# portfolio.distr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.distr(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all') + +Display daily returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + +## Getting charts +###portfolio.distr(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all', raw: bool = False, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display daily returns + + Parameters + ---------- + portfolio_returns : pd.Series + Returns of the portfolio + benchmark_returns : pd.Series + Returns of the benchmark + interval : str + interval to compare cumulative returns and benchmark + raw : False + Display raw data from cumulative return + export : str + Export certain type of data + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/dret/_index.md b/website/content/api/portfolio/dret/_index.md new file mode 100644 index 000000000000..b915a53fed17 --- /dev/null +++ b/website/content/api/portfolio/dret/_index.md @@ -0,0 +1,39 @@ +# portfolio.dret + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.dret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all') -> pandas.core.frame.DataFrame + +Get daily returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + Returns + ------- + pd.DataFrame + + +## Getting charts +###portfolio.dret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all', raw: bool = False, limit: int = 10, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display daily returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + raw : False + Display raw data from cumulative return + limit : int + Last daily returns to display + export : str + Export certain type of data + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/es/_index.md b/website/content/api/portfolio/es/_index.md new file mode 100644 index 000000000000..97ad3fc7aeea --- /dev/null +++ b/website/content/api/portfolio/es/_index.md @@ -0,0 +1,21 @@ +# portfolio.es + +## Get underlying data +###portfolio.es(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, use_mean: bool = False, distribution: str = 'normal', percentile: float = 0.999) -> pandas.core.frame.DataFrame + +Get portfolio expected shortfall + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + use_mean: + if one should use the data mean return + distribution: str + choose distribution to use: logistic, laplace, normal + percentile: int + es percentile + Returns + ------- + pd.DataFrame + diff --git a/website/content/api/portfolio/gaintopain/_index.md b/website/content/api/portfolio/gaintopain/_index.md new file mode 100644 index 000000000000..ba39a1b88d6f --- /dev/null +++ b/website/content/api/portfolio/gaintopain/_index.md @@ -0,0 +1,16 @@ +# portfolio.gaintopain + +## Get underlying data +###portfolio.gaintopain(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Get Pain-to-Gain ratio based on historical data + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of the portfolio's gain-to-pain ratio diff --git a/website/content/api/portfolio/holdp/_index.md b/website/content/api/portfolio/holdp/_index.md new file mode 100644 index 000000000000..4c042f47bb8a --- /dev/null +++ b/website/content/api/portfolio/holdp/_index.md @@ -0,0 +1,33 @@ +# portfolio.holdp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.holdp(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Get holdings of assets (in percentage) + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + +## Getting charts +###portfolio.holdp(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, sum_assets: bool = False, raw: bool = False, limit: int = 10, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display holdings of assets (in percentage) + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + sum_assets: bool + Sum assets over time + raw : bool + To display raw data + limit : int + Number of past market days to display holdings + export: str + Format to export plot + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/holdv/_index.md b/website/content/api/portfolio/holdv/_index.md new file mode 100644 index 000000000000..91d365f6cd32 --- /dev/null +++ b/website/content/api/portfolio/holdv/_index.md @@ -0,0 +1,38 @@ +# portfolio.holdv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.holdv(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Get holdings of assets (absolute value) + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of holdings + +## Getting charts +###portfolio.holdv(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, sum_assets: bool = False, raw: bool = False, limit: int = 10, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display holdings of assets (absolute value) + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + sum_assets: bool + Sum assets over time + raw : bool + To display raw data + limit : int + Number of past market days to display holdings + export: str + Format to export plot + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/information/_index.md b/website/content/api/portfolio/information/_index.md new file mode 100644 index 000000000000..652e30562785 --- /dev/null +++ b/website/content/api/portfolio/information/_index.md @@ -0,0 +1,16 @@ +# portfolio.information + +## Get underlying data +###portfolio.information(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Get information ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of the information ratio during different time periods diff --git a/website/content/api/portfolio/jensens/_index.md b/website/content/api/portfolio/jensens/_index.md new file mode 100644 index 000000000000..859b06e1b315 --- /dev/null +++ b/website/content/api/portfolio/jensens/_index.md @@ -0,0 +1,22 @@ +# portfolio.jensens + +## Get underlying data +###portfolio.jensens(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, risk_free_rate: float = 0, window: str = '1y') + +Get jensen's alpha + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window: str + Interval used for rolling values + risk_free_rate: float + Risk free rate + + Returns + ------- + pd.DataFrame + DataFrame of jensens's alpha during different time windows + pd.Series + Series of jensens's alpha data diff --git a/website/content/api/portfolio/kelly/_index.md b/website/content/api/portfolio/kelly/_index.md new file mode 100644 index 000000000000..080fb634d2ce --- /dev/null +++ b/website/content/api/portfolio/kelly/_index.md @@ -0,0 +1,16 @@ +# portfolio.kelly + +## Get underlying data +###portfolio.kelly(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Gets kelly criterion + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of kelly criterion of the portfolio during different time periods diff --git a/website/content/api/portfolio/kurtosis/_index.md b/website/content/api/portfolio/kurtosis/_index.md new file mode 100644 index 000000000000..8a76be7af92b --- /dev/null +++ b/website/content/api/portfolio/kurtosis/_index.md @@ -0,0 +1,16 @@ +# portfolio.kurtosis + +## Get underlying data +###portfolio.kurtosis(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Class method that retrieves kurtosis for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame with kurtosis for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/max_drawdown_ratio/_index.md b/website/content/api/portfolio/max_drawdown_ratio/_index.md new file mode 100644 index 000000000000..31f5bcbf7098 --- /dev/null +++ b/website/content/api/portfolio/max_drawdown_ratio/_index.md @@ -0,0 +1,38 @@ +# portfolio.max_drawdown_ratio + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.max_drawdown_ratio(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, is_returns: bool = False) -> pandas.core.series.Series + +Calculate the drawdown (MDD) of historical series. Note that the calculation is done + on cumulative returns (or prices). The definition of drawdown is + + DD = (current value - rolling maximum) / rolling maximum + + Parameters + ---------- + data: pd.Series + Series of input values + is_returns: bool + Flag to indicate inputs are returns + + Returns + ---------- + pd.Series + Holdings series + pd.Series + Drawdown series + ------- + +## Getting charts +###portfolio.max_drawdown_ratio(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, export: str = '', chart=True) + +Display maximum drawdown for multiple intervals + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + export : str + Export data format diff --git a/website/content/api/portfolio/maxdd/_index.md b/website/content/api/portfolio/maxdd/_index.md new file mode 100644 index 000000000000..d0430c226697 --- /dev/null +++ b/website/content/api/portfolio/maxdd/_index.md @@ -0,0 +1,40 @@ +# portfolio.maxdd + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.maxdd(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, is_returns: bool = False) -> pandas.core.series.Series + +Calculate the drawdown (MDD) of historical series. Note that the calculation is done + on cumulative returns (or prices). The definition of drawdown is + + DD = (current value - rolling maximum) / rolling maximum + + Parameters + ---------- + data: pd.Series + Series of input values + is_returns: bool + Flag to indicate inputs are returns + + Returns + ---------- + pd.Series + Holdings series + pd.Series + Drawdown series + ------- + +## Getting charts +###portfolio.maxdd(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display maximum drawdown curve + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + export: str + Format to export data + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/maxdrawdown/_index.md b/website/content/api/portfolio/maxdrawdown/_index.md new file mode 100644 index 000000000000..f7ce87559544 --- /dev/null +++ b/website/content/api/portfolio/maxdrawdown/_index.md @@ -0,0 +1,16 @@ +# portfolio.maxdrawdown + +## Get underlying data +###portfolio.maxdrawdown(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Class method that retrieves maximum drawdown ratio for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame with maximum drawdown for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/mret/_index.md b/website/content/api/portfolio/mret/_index.md new file mode 100644 index 000000000000..79763f739370 --- /dev/null +++ b/website/content/api/portfolio/mret/_index.md @@ -0,0 +1,39 @@ +# portfolio.mret + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.mret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all') -> pandas.core.frame.DataFrame + +Get monthly returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + Returns + ------- + pd.DataFrame + + +## Getting charts +###portfolio.mret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all', raw: bool = False, show_vals: bool = False, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display monthly returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + raw : False + Display raw data from cumulative return + show_vals : False + Show values on heatmap + export : str + Export certain type of data + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/portfolio/om/_index.md b/website/content/api/portfolio/om/_index.md new file mode 100644 index 000000000000..6e3e6d00a3a4 --- /dev/null +++ b/website/content/api/portfolio/om/_index.md @@ -0,0 +1,37 @@ +# portfolio.om + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.om(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, threshold_start: float = 0, threshold_end: float = 1.5) -> pandas.core.frame.DataFrame + +Get omega ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + threshold_start: float + annualized target return threshold start of plotted threshold range + threshold_end: float + annualized target return threshold end of plotted threshold range + Returns + ------- + pd.DataFrame + + +## Getting charts +###portfolio.om(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, threshold_start: float = 0, threshold_end: float = 1.5, chart=True) + +Display omega ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + use_mean: + if one should use the data mean return + distribution: str + choose distribution to use: logistic, laplace, normal + percentile: int + es percentile diff --git a/website/content/api/portfolio/payoff/_index.md b/website/content/api/portfolio/payoff/_index.md new file mode 100644 index 000000000000..c5e39e4f914b --- /dev/null +++ b/website/content/api/portfolio/payoff/_index.md @@ -0,0 +1,11 @@ +# portfolio.payoff + +## Get underlying data +###portfolio.payoff(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Gets payoff ratio + + Returns + ------- + pd.DataFrame + DataFrame of payoff ratio of the portfolio during different time periods diff --git a/website/content/api/portfolio/perf/_index.md b/website/content/api/portfolio/perf/_index.md new file mode 100644 index 000000000000..143581088e45 --- /dev/null +++ b/website/content/api/portfolio/perf/_index.md @@ -0,0 +1,19 @@ +# portfolio.perf + +## Get underlying data +###portfolio.perf(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, interval: str = 'all', show_all_trades: bool = False) -> pandas.core.frame.DataFrame + +Get portfolio performance vs the benchmark + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + interval : str + interval to consider performance. From: mtd, qtd, ytd, 3m, 6m, 1y, 3y, 5y, 10y, all + show_all_trades: bool + Whether to also show all trades made and their performance (default is False) + Returns + ------- + pd.DataFrame + diff --git a/website/content/api/portfolio/po/blacklitterman/_index.md b/website/content/api/portfolio/po/blacklitterman/_index.md new file mode 100644 index 000000000000..baf4f319464e --- /dev/null +++ b/website/content/api/portfolio/po/blacklitterman/_index.md @@ -0,0 +1,151 @@ +# portfolio.po.blacklitterman + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.blacklitterman(symbols: List[str], benchmark: Dict, p_views: List, q_views: List, interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', objective: str = 'Sharpe', risk_free_rate: float = 0, risk_aversion: float = 1, delta: float = None, equilibrium: bool = True, optimize: bool = True, value: float = 1.0, value_short: float = 0) -> Tuple + +Builds a maximal diversification portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + benchmark : Dict + Dict of portfolio weights + p_views: List + Matrix P of views that shows relationships among assets and returns. + Default value to None. + q_views: List + Matrix Q of expected returns of views. Default value is None. + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str + If not using interval, start date string (YYYY-MM-DD) + end_date: str + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + objective: str + Objective function of the optimization model. + The default is 'Sharpe'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'MaxRet': Maximize the expected return of the portfolio. + + risk_free_rate: float, optional + Risk free rate, must be in annual frequency. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + delta: float, optional + Risk aversion factor of Black Litterman model. Default value is None. + equilibrium: bool, optional + If True excess returns are based on equilibrium market portfolio, if False + excess returns are calculated as historical returns minus risk free rate. + Default value is True. + optimize: bool, optional + If True Black Litterman estimates are used as inputs of mean variance model, + if False returns equilibrium weights from Black Litterman model + Default value is True. + value : float, optional + Amount of money to allocate. The default is 1. + value_short : float, optional + Amount to allocate to portfolio in short positions. The default is 0. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.blacklitterman(symbols: List[str], p_views: List, q_views: List, interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', benchmark: Dict = None, objective: str = 'Sharpe', risk_free_rate: float = 0, risk_aversion: float = 1, delta: float = None, equilibrium: bool = True, optimize: bool = True, value: float = 1.0, value_short: float = 0, table: bool = False, chart=True) -> Dict + + + Builds a black litterman portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + p_views: List + Matrix P of views that shows relationships among assets and returns. + Default value to None. + q_views: List + Matrix Q of expected returns of views. Default value is None. + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + benchmark : Dict + Dict of portfolio weights + objective: str + Objective function of the optimization model. + The default is 'Sharpe'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'MaxRet': Maximize the expected return of the portfolio. + + risk_free_rate: float, optional + Risk free rate, must be in annual frequency. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + delta: float, optional + Risk aversion factor of Black Litterman model. Default value is None. + equilibrium: bool, optional + If True excess returns are based on equilibrium market portfolio, if False + excess returns are calculated as historical returns minus risk free rate. + Default value is True. + optimize: bool, optional + If True Black Litterman estimates are used as inputs of mean variance model, + if False returns equilibrium weights from Black Litterman model + Default value is True. + value : float, optional + Amount of money to allocate. The default is 1. + value_short : float, optional + Amount to allocate to portfolio in short positions. The default is 0. + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/ef/_index.md b/website/content/api/portfolio/po/ef/_index.md new file mode 100644 index 000000000000..7e29b1bfc89d --- /dev/null +++ b/website/content/api/portfolio/po/ef/_index.md @@ -0,0 +1,150 @@ +# portfolio.po.ef + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.ef(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, alpha: float = 0.05, value: float = 1.0, value_short: float = 0.0, n_portfolios: int = 100, seed: int = 123) -> Tuple + + + Get efficient frontier + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + The default is 0.05. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + n_portfolios: int, optional + "Number of portfolios to simulate. The default value is 100. + seed: int, optional + Seed used to generate random portfolios. The default value is 123. + + Returns + ------- + Tuple + Parameters to create efficient frontier: frontier, mu, cov, stock_returns, weights, X1, Y1, port + +## Getting charts +###portfolio.po.ef(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, alpha: float = 0.05, value: float = 1.0, value_short: float = 0.0, n_portfolios: int = 100, seed: int = 123, tangency: bool = False, plot_tickers: bool = True, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + + + Display efficient frontier + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + The default is 0.05. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + n_portfolios: int, optional + "Number of portfolios to simulate. The default value is 100. + seed: int, optional + Seed used to generate random portfolios. The default value is 123. + tangency: bool, optional + Adds the optimal line with the risk-free asset. + external_axes: Optional[List[plt.Axes]] + Optional axes to plot data on + plot_tickers: bool + Whether to plot the tickers for the assets diff --git a/website/content/api/portfolio/po/equal/_index.md b/website/content/api/portfolio/po/equal/_index.md new file mode 100644 index 000000000000..03e12a940872 --- /dev/null +++ b/website/content/api/portfolio/po/equal/_index.md @@ -0,0 +1,43 @@ +# portfolio.po.equal + +## Get underlying data +###portfolio.po.equal(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', value: float = 1.0) -> Tuple + +Equally weighted portfolio, where weight = 1/# of symbols + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + value : float, optional + Amount to allocate. Returns percentages if set to 1. + + Returns + ------- + dict + Dictionary of weights where keys are the tickers diff --git a/website/content/api/portfolio/po/get_properties/_index.md b/website/content/api/portfolio/po/get_properties/_index.md new file mode 100644 index 000000000000..68291be2b7ad --- /dev/null +++ b/website/content/api/portfolio/po/get_properties/_index.md @@ -0,0 +1,10 @@ +# portfolio.po.get_properties + +## Get underlying data +###portfolio.po.get_properties() -> List[str] + +Get properties to use on property optimization. + Returns + ------- + List[str]: + List of available properties to use on property optimization. diff --git a/website/content/api/portfolio/po/hcp/_index.md b/website/content/api/portfolio/po/hcp/_index.md new file mode 100644 index 000000000000..a01f79e86e14 --- /dev/null +++ b/website/content/api/portfolio/po/hcp/_index.md @@ -0,0 +1,370 @@ +# portfolio.po.hcp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.hcp(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', model: str = 'HRP', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'MinRisk', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'single', k: int = 0, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0) -> Tuple + +Builds hierarchical clustering based portfolios + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + model: str, optional + The hierarchical cluster portfolio model used for optimize the + portfolio. The default is 'HRP'. Possible values are: + + - 'HRP': Hierarchical Risk Parity. + - 'HERC': Hierarchical Equal Risk Contribution. + - 'NCO': Nested Clustered Optimization. + + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in annual frequency. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.hcp(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', model: str = 'HRP', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'minrisk', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'ward', k: int = None, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a hierarchical clustering portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + model: str, optional + The hierarchical cluster portfolio model used for optimize the + portfolio. The default is 'HRP'. Possible values are: + + - 'HRP': Hierarchical Risk Parity. + - 'HERC': Hierarchical Equal Risk Contribution. + - 'NCO': Nested Clustered Optimization. + + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio, by default 1.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/herc/_index.md b/website/content/api/portfolio/po/herc/_index.md new file mode 100644 index 000000000000..27212cc3ee33 --- /dev/null +++ b/website/content/api/portfolio/po/herc/_index.md @@ -0,0 +1,354 @@ +# portfolio.po.herc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.herc(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'minrisk', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'single', k: int = 0, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0) -> Tuple + + + Builds a hierarchical risk parity portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False + +## Getting charts +###portfolio.po.herc(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'ward', k: int = 0, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a hierarchical equal risk contribution portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + model: str, optional + The hierarchical cluster portfolio model used for optimize the + portfolio. The default is 'HRP'. Possible values are: + + - 'HRP': Hierarchical Risk Parity. + - 'HERC': Hierarchical Equal Risk Contribution. + - 'NCO': Nested Clustered Optimization. + + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/hrp/_index.md b/website/content/api/portfolio/po/hrp/_index.md new file mode 100644 index 000000000000..97806da116fb --- /dev/null +++ b/website/content/api/portfolio/po/hrp/_index.md @@ -0,0 +1,346 @@ +# portfolio.po.hrp + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.hrp(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'minrisk', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'single', k: int = 0, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0) -> Tuple + + + Builds a hierarchical risk parity portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False + +## Getting charts +###portfolio.po.hrp(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'single', k: int = 0, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a hierarchical risk parity portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/load/_index.md b/website/content/api/portfolio/po/load/_index.md new file mode 100644 index 000000000000..22154239e5d5 --- /dev/null +++ b/website/content/api/portfolio/po/load/_index.md @@ -0,0 +1,19 @@ +# portfolio.po.load + +## Get underlying data +###portfolio.po.load(excel_file: str = '') + + + Load in the Excel file to determine the allocation that needs to be set. + + Parameters + ---------- + excel_file: str + The location of the Excel file that needs to be loaded. + + Returns + ------- + tickers: list + Returns a list with ticker symbols + categories: dictionary + Returns a dictionary that specifies each category diff --git a/website/content/api/portfolio/po/load_bl_views/_index.md b/website/content/api/portfolio/po/load_bl_views/_index.md new file mode 100644 index 000000000000..75aa6fc64329 --- /dev/null +++ b/website/content/api/portfolio/po/load_bl_views/_index.md @@ -0,0 +1,19 @@ +# portfolio.po.load_bl_views + +## Get underlying data +###portfolio.po.load_bl_views(excel_file: str = '') + + + Load a Excel file with views for Black Litterman model. + + Parameters + ---------- + excel_file: str + The location of the Excel file that needs to be loaded. + + Returns + ------- + p_views: list + Returns a list with p_views matrix + q_views: list + Returns a list with q_views matrix diff --git a/website/content/api/portfolio/po/maxdecorr/_index.md b/website/content/api/portfolio/po/maxdecorr/_index.md new file mode 100644 index 000000000000..bd9bc422a239 --- /dev/null +++ b/website/content/api/portfolio/po/maxdecorr/_index.md @@ -0,0 +1,131 @@ +# portfolio.po.maxdecorr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.maxdecorr(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0) -> Tuple + +Builds a maximal decorrelation portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str + If not using interval, start date string (YYYY-MM-DD) + end_date: str + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + s`interpolate `_. + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + value_short : float, optional + Amount to allocate to portfolio in short positions. The default is 0. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.maxdecorr(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a maximal decorrelation portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/maxdiv/_index.md b/website/content/api/portfolio/po/maxdiv/_index.md new file mode 100644 index 000000000000..3a9feafd13ba --- /dev/null +++ b/website/content/api/portfolio/po/maxdiv/_index.md @@ -0,0 +1,131 @@ +# portfolio.po.maxdiv + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.maxdiv(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0) -> Tuple + +Builds a maximal diversification portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str + If not using interval, start date string (YYYY-MM-DD) + end_date: str + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + value_short : float, optional + Amount to allocate to portfolio in short positions. The default is 0. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.maxdiv(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a maximal diversification portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/maxret/_index.md b/website/content/api/portfolio/po/maxret/_index.md new file mode 100644 index 000000000000..edc68c7328cf --- /dev/null +++ b/website/content/api/portfolio/po/maxret/_index.md @@ -0,0 +1,209 @@ +# portfolio.po.maxret + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.maxret(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0) -> Tuple + + + Builds a maximal return/risk ratio portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.maxret(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a maximal return portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/maxsharpe/_index.md b/website/content/api/portfolio/po/maxsharpe/_index.md new file mode 100644 index 000000000000..9848cccacfc1 --- /dev/null +++ b/website/content/api/portfolio/po/maxsharpe/_index.md @@ -0,0 +1,209 @@ +# portfolio.po.maxsharpe + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.maxsharpe(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0) -> Tuple + + + Builds a maximal return/risk ratio portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.maxsharpe(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a maximal return/risk ratio portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/maxutil/_index.md b/website/content/api/portfolio/po/maxutil/_index.md new file mode 100644 index 000000000000..846ff1de7f63 --- /dev/null +++ b/website/content/api/portfolio/po/maxutil/_index.md @@ -0,0 +1,209 @@ +# portfolio.po.maxutil + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.maxutil(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0) -> Tuple + + + Builds a maximal return/risk ratio portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.maxutil(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a maximal risk averse utility portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/meanrisk/_index.md b/website/content/api/portfolio/po/meanrisk/_index.md new file mode 100644 index 000000000000..c47cd5fec535 --- /dev/null +++ b/website/content/api/portfolio/po/meanrisk/_index.md @@ -0,0 +1,229 @@ +# portfolio.po.meanrisk + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.meanrisk(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', objective: str = 'Sharpe', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0) -> Tuple + +Builds a mean risk optimal portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + objective: str + Objective function of the optimization model. + The default is 'Sharpe'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'MaxRet': Maximize the expected return of the portfolio. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in annual frequency. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + value_short : float, optional + Amount to allocate to portfolio in short positions. The default is 0. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.meanrisk(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'mv', objective: str = 'sharpe', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a mean risk optimal portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + objective: str + Objective function of the optimization model. + The default is 'Sharpe'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'MaxRet': Maximize the expected return of the portfolio. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/minrisk/_index.md b/website/content/api/portfolio/po/minrisk/_index.md new file mode 100644 index 000000000000..a4a570decd2f --- /dev/null +++ b/website/content/api/portfolio/po/minrisk/_index.md @@ -0,0 +1,209 @@ +# portfolio.po.minrisk + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.minrisk(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0) -> Tuple + + + Builds a maximal return/risk ratio portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.minrisk(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_free_rate: float = 0, risk_aversion: float = 1, alpha: float = 0.05, target_return: float = -1, target_risk: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, value_short: float = 0.0, table: bool = False, chart=True) -> Dict + + + Builds a minimum risk portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + target_risk: float, optional + Constraint on maximum level of portfolio's risk. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/nco/_index.md b/website/content/api/portfolio/po/nco/_index.md new file mode 100644 index 000000000000..2e48b36f11b6 --- /dev/null +++ b/website/content/api/portfolio/po/nco/_index.md @@ -0,0 +1,363 @@ +# portfolio.po.nco + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.nco(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'minrisk', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'single', k: int = None, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0) -> Tuple + + + Builds a hierarchical risk parity portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False + +## Getting charts +###portfolio.po.nco(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', codependence: str = 'pearson', covariance: str = 'hist', objective: str = 'MinRisk', risk_measure: str = 'mv', risk_free_rate: float = 0.0, risk_aversion: float = 1.0, alpha: float = 0.05, a_sim: int = 100, beta: float = None, b_sim: int = None, linkage: str = 'ward', k: int = None, max_k: int = 10, bins_info: str = 'KN', alpha_tail: float = 0.05, leaf_order: bool = True, d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a hierarchical equal risk contribution portfolio + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + model: str, optional + The hierarchical cluster portfolio model used for optimize the + portfolio. The default is 'HRP'. Possible values are: + + - 'HRP': Hierarchical Risk Parity. + - 'HERC': Hierarchical Equal Risk Contribution. + - 'NCO': Nested Clustered Optimization. + + codependence: str, optional + The codependence or similarity matrix used to build the distance + metric and clusters. The default is 'pearson'. Possible values are: + + - 'pearson': pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{pearson}_{i,j})}`. + - 'spearman': spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{0.5(1- ho^{spearman}_{i,j})}`. + - 'abs_pearson': absolute value pearson correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{pearson}_{i,j}|)}`. + - 'abs_spearman': absolute value spearman correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1-| ho^{spearman}_{i,j}|)}`. + - 'distance': distance correlation matrix. Distance formula: + :math:`D_{i,j} = \sqrt{(1- ho^{distance}_{i,j})}`. + - 'mutual_info': mutual information matrix. Distance used is variation information matrix. + - 'tail': lower tail dependence index matrix. Dissimilarity formula: + :math:`D_{i,j} = -\log{\lambda_{i,j}}`. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`c-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`c-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`c-MLforAM`. + + objective: str, optional + Objective function used by the NCO model. + The default is 'MinRisk'. Possible values are: + + - 'MinRisk': Minimize the selected risk measure. + - 'Utility': Maximize the risk averse utility function. + - 'Sharpe': Maximize the risk adjusted return ratio based on the selected risk measure. + - 'ERC': Equally risk contribution portfolio of the selected risk measure. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + risk_aversion: float, optional + Risk aversion factor of the 'Utility' objective function. + The default is 1. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + linkage: str, optional + Linkage method of hierarchical clustering. For more information see + `linkage `_. + The default is 'single'. Possible values are: + + - 'single'. + - 'complete'. + - 'average'. + - 'weighted'. + - 'centroid'. + - 'median'. + - 'ward'. + - 'dbht': Direct Bubble Hierarchical Tree. + + k: int, optional + Number of clusters. This value is took instead of the optimal number + of clusters calculated with the two difference gap statistic. + The default is None. + max_k: int, optional + Max number of clusters used by the two difference gap statistic + to find the optimal number of clusters. The default is 10. + bins_info: str, optional + Number of bins used to calculate variation of information. The default + value is 'KN'. Possible values are: + + - 'KN': Knuth's choice method. For more information see + `knuth_bin_width `_. + - 'FD': Freedman–Diaconis' choice method. For more information see + `freedman_bin_width `_. + - 'SC': Scotts' choice method. For more information see + `scott_bin_width `_. + - 'HGR': Hacine-Gharbi and Ravier' choice method. + + alpha_tail: float, optional + Significance level for lower tail dependence index. The default is 0.05. + leaf_order: bool, optional + Indicates if the cluster are ordered so that the distance between + successive leaves is minimal. The default is True. + d: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio in long positions, by default 1.0 + value_short : float, optional + Amount to allocate to portfolio in short positions, by default 0.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/plot/_index.md b/website/content/api/portfolio/po/plot/_index.md new file mode 100644 index 000000000000..933bb4cd80ad --- /dev/null +++ b/website/content/api/portfolio/po/plot/_index.md @@ -0,0 +1,161 @@ +# portfolio.po.plot + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.plot(weights, data: pandas.core.frame.DataFrame, category: Dict = None, title_opt: str = '', freq: str = 'D', risk_measure: str = 'MV', risk_free_rate: float = 0, alpha: float = 0.05, a_sim: float = 100, beta: float = None, b_sim: float = None, pie: bool = False, hist: bool = False, dd: bool = False, rc_chart: bool = False, heat: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None) + + + Plot additional charts + + Parameters + ---------- + weights: Dict + Dict of portfolio weights + data: pd.DataFrame + DataFrame of stock returns + title_opt: str + Title to be used on the pie chart + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + pie : bool, optional + Display a pie chart of values, by default False + hist : bool, optional + Display a histogram with risk measures, by default False + dd : bool, optional + Display a drawdown chart with risk measures, by default False + rc-chart : float, optional + Display a risk contribution chart for assets, by default False + heat : float, optional + Display a heatmap of correlation matrix with dendrogram, by default False + external_axes: Optional[List[plt.Axes]] + Optional axes to plot data on + +## Getting charts +###portfolio.po.plot(weights, data: pandas.core.frame.DataFrame, category: Dict = None, title_opt: str = '', freq: str = 'D', risk_measure: str = 'MV', risk_free_rate: float = 0, alpha: float = 0.05, a_sim: float = 100, beta: float = None, b_sim: float = None, pie: bool = False, hist: bool = False, dd: bool = False, rc_chart: bool = False, heat: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + + + Plot additional charts + + Parameters + ---------- + weights: Dict + Dict of portfolio weights + data: pd.DataFrame + DataFrame of stock returns + title_opt: str + Title to be used on the pie chart + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + risk_measure: str, optional + The risk measure used to optimize the portfolio. If model is 'NCO', + the risk measures available depends on the objective function. + The default is 'MV'. Possible values are: + + - 'MV': Variance. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'VaR': Value at Risk. + - 'CVaR': Conditional Value at Risk. + - 'TG': Tail Gini. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization (Minimax). + - 'RG': Range of returns. + - 'CVRG': CVaR range of returns. + - 'TGRG': Tail Gini range of returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio). + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'DaR': Drawdown at Risk of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'MDD_Rel': Maximum Drawdown of compounded cumulative returns (Calmar Ratio). + - 'ADD_Rel': Average Drawdown of compounded cumulative returns. + - 'DaR_Rel': Drawdown at Risk of compounded cumulative returns. + - 'CDaR_Rel': Conditional Drawdown at Risk of compounded cumulative returns. + - 'EDaR_Rel': Entropic Drawdown at Risk of compounded cumulative returns. + - 'UCI_Rel': Ulcer Index of compounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. + Used for 'FLPM' and 'SLPM'. The default is 0. + alpha: float, optional + Significance level of VaR, CVaR, EDaR, DaR, CDaR, EDaR, Tail Gini of losses. + The default is 0.05. + a_sim: float, optional + Number of CVaRs used to approximate Tail Gini of losses. The default is 100. + beta: float, optional + Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. + The default is None. + b_sim: float, optional + Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. + The default is None. + pie : bool, optional + Display a pie chart of values, by default False + hist : bool, optional + Display a histogram with risk measures, by default False + dd : bool, optional + Display a drawdown chart with risk measures, by default False + rc-chart : float, optional + Display a risk contribution chart for assets, by default False + heat : float, optional + Display a heatmap of correlation matrix with dendrogram, by default False + external_axes: Optional[List[plt.Axes]] + Optional axes to plot data on diff --git a/website/content/api/portfolio/po/property/_index.md b/website/content/api/portfolio/po/property/_index.md new file mode 100644 index 000000000000..a4b1b7dee313 --- /dev/null +++ b/website/content/api/portfolio/po/property/_index.md @@ -0,0 +1,112 @@ +# portfolio.po.property + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.property(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', s_property: str = 'marketCap', value: float = 1.0) -> Tuple + +Calculate portfolio weights based on selected property + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + s_property : str + Property to weight portfolio by + value : float, optional + Amount of money to allocate + + Returns + ------- + Dict + Dictionary of portfolio weights or allocations + +## Getting charts +###portfolio.po.property(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', s_property: str = 'marketCap', risk_measure='mv', risk_free_rate: float = 0, alpha=0.05, value: float = 1, table: bool = False, chart=True) -> Dict + + + Builds a portfolio weighted by selected property + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + s_property : str + Property to get weighted portfolio of + risk_measure: str, optional + The risk measure used to compute indicators. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'WR': Worst Realization. + - 'ADD': Average Drawdown of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'MDD': Maximum Drawdown of uncompounded cumulative returns. + + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR. + value : float, optional + Amount to allocate to portfolio, by default 1.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/relriskparity/_index.md b/website/content/api/portfolio/po/relriskparity/_index.md new file mode 100644 index 000000000000..8a56683ecd16 --- /dev/null +++ b/website/content/api/portfolio/po/relriskparity/_index.md @@ -0,0 +1,180 @@ +# portfolio.po.relriskparity + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.relriskparity(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', version: str = 'A', risk_cont: List[str] = None, penal_factor: float = 1, target_return: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0) -> Tuple + +Builds a relaxed risk parity portfolio using the least squares approach + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + version : str, optional + Relaxed risk parity model version. The default is 'A'. + Possible values are: + + - 'A': without regularization and penalization constraints. + - 'B': with regularization constraint but without penalization constraint. + - 'C': with regularization and penalization constraints. + + risk_cont: List[str], optional + The vector of risk contribution per asset. If empty, the default is + 1/n (number of assets). + penal_factor: float, optional + The penalization factor of penalization constraints. Only used with + version 'C'. The default is 1. + target_return: float, optional + Constraint on minimum level of portfolio's return. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.relriskparity(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', version: str = 'A', risk_cont: List[str] = None, penal_factor: float = 1, target_return: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a relaxed risk parity portfolio using the least squares approach + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str, optional + interval to look at returns from + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + - X (integer days) for returns calculated every X days. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + version : str, optional + Relaxed risk parity model version. The default is 'A'. + Possible values are: + + - 'A': without regularization and penalization constraints. + - 'B': with regularization constraint but without penalization constraint. + - 'C': with regularization and penalization constraints. + + risk_cont: List[str], optional + The vector of risk contribution per asset. If empty, the default is + 1/n (number of assets). + penal_factor: float, optional + The penalization factor of penalization constraints. Only used with + version 'C'. The default is 1. + target_return: float, optional + Constraint on minimum level of portfolio's return. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio, by default 1.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/po/riskparity/_index.md b/website/content/api/portfolio/po/riskparity/_index.md new file mode 100644 index 000000000000..5718af0e03a4 --- /dev/null +++ b/website/content/api/portfolio/po/riskparity/_index.md @@ -0,0 +1,198 @@ +# portfolio.po.riskparity + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.po.riskparity(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'MV', risk_cont: List[str] = None, risk_free_rate: float = 0, alpha: float = 0.05, target_return: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0) -> Tuple + +Builds a risk parity portfolio using the risk budgeting approach + + Parameters + ---------- + symbols : List[str] + List of portfolio stocks + interval : str, optional + interval to get stock data, by default "3mo" + start_date: str, optional + If not using interval, start date string (YYYY-MM-DD) + end_date: str, optional + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool, optional + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str, optional + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + + maxnan: float, optional + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float, optional + Value used to replace outliers that are higher to threshold. + method: str, optional + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str, optional + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + + risk_cont: List[str], optional + The vector of risk contribution per asset. If empty, the default is + 1/n (number of assets). + risk_free_rate: float, optional + Risk free rate, must be in annual frequency. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount of money to allocate. The default is 1. + + Returns + ------- + Tuple + Dictionary of portfolio weights and DataFrame of stock returns + +## Getting charts +###portfolio.po.riskparity(symbols: List[str], interval: str = '3y', start_date: str = '', end_date: str = '', log_returns: bool = False, freq: str = 'D', maxnan: float = 0.05, threshold: float = 0, method: str = 'time', risk_measure: str = 'mv', risk_cont: List[str] = None, risk_free_rate: float = 0, alpha: float = 0.05, target_return: float = -1, mean: str = 'hist', covariance: str = 'hist', d_ewma: float = 0.94, value: float = 1.0, table: bool = False, chart=True) -> Dict + + + Builds a risk parity portfolio using the risk budgeting approach + + Parameters + ---------- + symbols : List[str] + List of portfolio tickers + interval : str + interval to look at returns from + start_date: str + If not using interval, start date string (YYYY-MM-DD) + end_date: str + If not using interval, end date string (YYYY-MM-DD). If empty use last + weekday. + log_returns: bool + If True calculate log returns, else arithmetic returns. Default value + is False + freq: str + The frequency used to calculate returns. Default value is 'D'. Possible + values are: + - 'D' for daily returns. + - 'W' for weekly returns. + - 'M' for monthly returns. + - X (integer days) for returns calculated every X days. + + maxnan: float + Max percentage of nan values accepted per asset to be included in + returns. + threshold: float + Value used to replace outliers that are higher to threshold. + method: str + Method used to fill nan values. Default value is 'time'. For more information see + `interpolate `_. + risk_measure: str + The risk measure used to optimize the portfolio. + The default is 'MV'. Possible values are: + + - 'MV': Standard Deviation. + - 'MAD': Mean Absolute Deviation. + - 'MSV': Semi Standard Deviation. + - 'FLPM': First Lower Partial Moment (Omega Ratio). + - 'SLPM': Second Lower Partial Moment (Sortino Ratio). + - 'CVaR': Conditional Value at Risk. + - 'EVaR': Entropic Value at Risk. + - 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns. + - 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns. + - 'UCI': Ulcer Index of uncompounded cumulative returns. + + risk_cont: List[str], optional + The vector of risk contribution per asset. If empty, the default is + 1/n (number of assets). + risk_free_rate: float, optional + Risk free rate, must be in the same interval of assets returns. Used for + 'FLPM' and 'SLPM' and Sharpe objective function. The default is 0. + alpha: float, optional + Significance level of CVaR, EVaR, CDaR and EDaR + target_return: float, optional + Constraint on minimum level of portfolio's return. + mean: str, optional + The method used to estimate the expected returns. + The default value is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + + covariance: str, optional + The method used to estimate the covariance matrix: + The default is 'hist'. Possible values are: + + - 'hist': use historical estimates. + - 'ewma1': use ewma with adjust=True. For more information see + `EWM `_. + - 'ewma2': use ewma with adjust=False. For more information see + `EWM `_. + - 'ledoit': use the Ledoit and Wolf Shrinkage method. + - 'oas': use the Oracle Approximation Shrinkage method. + - 'shrunk': use the basic Shrunk Covariance method. + - 'gl': use the basic Graphical Lasso Covariance method. + - 'jlogo': use the j-LoGo Covariance method. For more information see: :cite:`a-jLogo`. + - 'fixed': denoise using fixed method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'spectral': denoise using spectral method. For more information see chapter 2 of :cite:`a-MLforAM`. + - 'shrink': denoise using shrink method. For more information see chapter 2 of :cite:`a-MLforAM`. + + d_ewma: float, optional + The smoothing factor of ewma methods. + The default is 0.94. + value : float, optional + Amount to allocate to portfolio, by default 1.0 + table: bool, optional + True if plot table weights, by default False diff --git a/website/content/api/portfolio/profitfactor/_index.md b/website/content/api/portfolio/profitfactor/_index.md new file mode 100644 index 000000000000..4b8e5130dd27 --- /dev/null +++ b/website/content/api/portfolio/profitfactor/_index.md @@ -0,0 +1,16 @@ +# portfolio.profitfactor + +## Get underlying data +###portfolio.profitfactor(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) + +Gets profit factor + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame of profit factor of the portfolio during different time periods diff --git a/website/content/api/portfolio/rbeta/_index.md b/website/content/api/portfolio/rbeta/_index.md new file mode 100644 index 000000000000..6889617a44ce --- /dev/null +++ b/website/content/api/portfolio/rbeta/_index.md @@ -0,0 +1,38 @@ +# portfolio.rbeta + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.rbeta(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y') -> pandas.core.frame.DataFrame + +Get rolling beta using portfolio and benchmark returns + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + window: string + Interval used for rolling values. + Possible options: mtd, qtd, ytd, 1d, 5d, 10d, 1m, 3m, 6m, 1y, 3y, 5y, 10y. + + Returns + ------- + pd.DataFrame + DataFrame of the portfolio's rolling beta + +## Getting charts +###portfolio.rbeta(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display rolling beta + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + window: str + interval for window to consider + Possible options: mtd, qtd, ytd, 1d, 5d, 10d, 1m, 3m, 6m, 1y, 3y, 5y, 10y. + export: str + Export to file + external_axes: Optional[List[plt.Axes]] + Optional axes to display plot on diff --git a/website/content/api/portfolio/rsharpe/_index.md b/website/content/api/portfolio/rsharpe/_index.md new file mode 100644 index 000000000000..21551a9e1507 --- /dev/null +++ b/website/content/api/portfolio/rsharpe/_index.md @@ -0,0 +1,41 @@ +# portfolio.rsharpe + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.rsharpe(portfolio: pandas.core.frame.DataFrame, risk_free_rate: float = 0, window: str = '1y') -> pandas.core.frame.DataFrame + +Get rolling sharpe ratio + + Parameters + ---------- + portfolio_returns : pd.Series + Series of portfolio returns + risk_free_rate : float + Risk free rate + window : str + Rolling window to use + Possible options: mtd, qtd, ytd, 1d, 5d, 10d, 1m, 3m, 6m, 1y, 3y, 5y, 10y + + Returns + ------- + pd.DataFrame + Rolling sharpe ratio DataFrame + +## Getting charts +###portfolio.rsharpe(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y', risk_free_rate: float = 0, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display rolling sharpe + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + window: str + interval for window to consider + risk_free_rate: float + Value to use for risk free rate in sharpe/other calculations + export: str + Export to file + external_axes: Optional[List[plt.Axes]] + Optional axes to display plot on diff --git a/website/content/api/portfolio/rsortino/_index.md b/website/content/api/portfolio/rsortino/_index.md new file mode 100644 index 000000000000..82360b1fd44b --- /dev/null +++ b/website/content/api/portfolio/rsortino/_index.md @@ -0,0 +1,40 @@ +# portfolio.rsortino + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.rsortino(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y', risk_free_rate: float = 0) -> pandas.core.frame.DataFrame + +Get rolling sortino + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + window: str + interval for window to consider + Possible options: mtd, qtd, ytd, 1d, 5d, 10d, 1m, 3m, 6m, 1y, 3y, 5y, 10y + risk_free_rate: float + Value to use for risk free rate in sharpe/other calculations + Returns + ------- + pd.DataFrame + Rolling sortino ratio DataFrame + +## Getting charts +###portfolio.rsortino(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y', risk_free_rate: float = 0, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display rolling sortino + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + window: str + interval for window to consider + risk_free_rate: float + Value to use for risk free rate in sharpe/other calculations + export: str + Export to file + external_axes: Optional[List[plt.Axes]] + Optional axes to display plot on diff --git a/website/content/api/portfolio/rsquare/_index.md b/website/content/api/portfolio/rsquare/_index.md new file mode 100644 index 000000000000..808d26d511d4 --- /dev/null +++ b/website/content/api/portfolio/rsquare/_index.md @@ -0,0 +1,16 @@ +# portfolio.rsquare + +## Get underlying data +###portfolio.rsquare(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Class method that retrieves R2 Score for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame with R2 Score between portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/rvol/_index.md b/website/content/api/portfolio/rvol/_index.md new file mode 100644 index 000000000000..64c44a71b12e --- /dev/null +++ b/website/content/api/portfolio/rvol/_index.md @@ -0,0 +1,32 @@ +# portfolio.rvol + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.rvol(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y') -> pandas.core.frame.DataFrame + +Get rolling volatility + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + Rolling window size to use + Possible options: mtd, qtd, ytd, 1d, 5d, 10d, 1m, 3m, 6m, 1y, 3y, 5y, 10y + +## Getting charts +###portfolio.rvol(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = '1y', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display rolling volatility + + Parameters + ---------- + portfolio : PortfolioModel + Portfolio object + interval: str + interval for window to consider + export: str + Export to file + external_axes: Optional[List[plt.Axes]] + Optional axes to display plot on diff --git a/website/content/api/portfolio/sharpe/_index.md b/website/content/api/portfolio/sharpe/_index.md new file mode 100644 index 000000000000..dd656d58cd61 --- /dev/null +++ b/website/content/api/portfolio/sharpe/_index.md @@ -0,0 +1,18 @@ +# portfolio.sharpe + +## Get underlying data +###portfolio.sharpe(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, risk_free_rate: float = 0) -> pandas.core.frame.DataFrame + +Class method that retrieves sharpe ratio for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + risk_free_rate: float + Risk free rate value + + Returns + ------- + pd.DataFrame + DataFrame with sharpe ratio for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/skew/_index.md b/website/content/api/portfolio/skew/_index.md new file mode 100644 index 000000000000..688e83a0e58f --- /dev/null +++ b/website/content/api/portfolio/skew/_index.md @@ -0,0 +1,14 @@ +# portfolio.skew + +## Get underlying data +###portfolio.skew(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Class method that retrieves skewness for portfolio and benchmark selected + + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame with skewness for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/sortino/_index.md b/website/content/api/portfolio/sortino/_index.md new file mode 100644 index 000000000000..d1e5a1a54c67 --- /dev/null +++ b/website/content/api/portfolio/sortino/_index.md @@ -0,0 +1,18 @@ +# portfolio.sortino + +## Get underlying data +###portfolio.sortino(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, risk_free_rate: float = 0) -> pandas.core.frame.DataFrame + +Class method that retrieves sortino ratio for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + risk_free_rate: float + Risk free rate value + + Returns + ------- + pd.DataFrame + DataFrame with sortino ratio for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/summary/_index.md b/website/content/api/portfolio/summary/_index.md new file mode 100644 index 000000000000..806f05366455 --- /dev/null +++ b/website/content/api/portfolio/summary/_index.md @@ -0,0 +1,19 @@ +# portfolio.summary + +## Get underlying data +###portfolio.summary(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all', risk_free_rate: float = 0) -> pandas.core.frame.DataFrame + +Get summary portfolio and benchmark returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + risk_free_rate : float + Risk free rate for calculations + Returns + ------- + pd.DataFrame + diff --git a/website/content/api/portfolio/tail/_index.md b/website/content/api/portfolio/tail/_index.md new file mode 100644 index 000000000000..a10894cfc8b6 --- /dev/null +++ b/website/content/api/portfolio/tail/_index.md @@ -0,0 +1,23 @@ +# portfolio.tail + +## Get underlying data +###portfolio.tail(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: int = 252) + +Get tail ratio + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + window: int + Interval used for rolling values + + Returns + ------- + pd.DataFrame + DataFrame of the portfolios and the benchmarks tail ratio during different time windows + pd.Series + Series of the portfolios rolling tail ratio + pd.Series + Series of the benchmarks rolling tail ratio diff --git a/website/content/api/portfolio/trackerr/_index.md b/website/content/api/portfolio/trackerr/_index.md new file mode 100644 index 000000000000..6197acffd7ff --- /dev/null +++ b/website/content/api/portfolio/trackerr/_index.md @@ -0,0 +1,20 @@ +# portfolio.trackerr + +## Get underlying data +###portfolio.trackerr(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: int = 252) + +Get tracking error + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window: int + Interval used for rolling values + + Returns + ------- + pd.DataFrame + DataFrame of tracking errors during different time windows + pd.Series + Series of rolling tracking error diff --git a/website/content/api/portfolio/var/_index.md b/website/content/api/portfolio/var/_index.md new file mode 100644 index 000000000000..d052614474d4 --- /dev/null +++ b/website/content/api/portfolio/var/_index.md @@ -0,0 +1,23 @@ +# portfolio.var + +## Get underlying data +###portfolio.var(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, use_mean: bool = False, adjusted_var: bool = False, student_t: bool = False, percentile: float = 0.999) -> pandas.core.frame.DataFrame + +Get portfolio VaR + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + use_mean: bool + if one should use the data mean return + adjusted_var: bool + if one should have VaR adjusted for skew and kurtosis (Cornish-Fisher-Expansion) + student_t: bool + If one should use the student-t distribution + percentile: int + var percentile + Returns + ------- + pd.DataFrame + diff --git a/website/content/api/portfolio/volatility/_index.md b/website/content/api/portfolio/volatility/_index.md new file mode 100644 index 000000000000..6157735b3a2e --- /dev/null +++ b/website/content/api/portfolio/volatility/_index.md @@ -0,0 +1,16 @@ +# portfolio.volatility + +## Get underlying data +###portfolio.volatility(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel) -> pandas.core.frame.DataFrame + +Class method that retrieves volatility for portfolio and benchmark selected + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + + Returns + ------- + pd.DataFrame + DataFrame with volatility for portfolio and benchmark for different periods diff --git a/website/content/api/portfolio/yret/_index.md b/website/content/api/portfolio/yret/_index.md new file mode 100644 index 000000000000..1b0769e7bccf --- /dev/null +++ b/website/content/api/portfolio/yret/_index.md @@ -0,0 +1,33 @@ +# portfolio.yret + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###portfolio.yret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all') + +Get yearly returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + +## Getting charts +###portfolio.yret(portfolio: openbb_terminal.portfolio.portfolio_model.PortfolioModel, window: str = 'all', raw: bool = False, export: str = '', external_axes: Optional[matplotlib.axes._axes.Axes] = None, chart=True) + +Display yearly returns + + Parameters + ---------- + portfolio: Portfolio + Portfolio object with trades loaded + window : str + interval to compare cumulative returns and benchmark + raw : False + Display raw data from cumulative return + export : str + Export certain type of data + external_axes: plt.Axes + Optional axes to display plot on diff --git a/website/content/api/stocks/ba/bullbear/_index.md b/website/content/api/stocks/ba/bullbear/_index.md new file mode 100644 index 000000000000..3c4e55190ba2 --- /dev/null +++ b/website/content/api/stocks/ba/bullbear/_index.md @@ -0,0 +1,36 @@ +# stocks.ba.bullbear + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.bullbear(symbol: str) -> Tuple[int, int, int, int] + +Gets bullbear sentiment for ticker [Source: stocktwits] + + Parameters + ---------- + symbol : str + Ticker symbol to look at + + Returns + ------- + int + Watchlist count + int + Number of cases found for ticker + int + Number of bullish statements + int + Number of bearish statements + +## Getting charts +###stocks.ba.bullbear(symbol: str, chart=True) + + + Print bullbear sentiment based on last 30 messages on the board. + Also prints the watchlist_count. [Source: Stocktwits] + + Parameters + ---------- + symbol: str + Stock ticker symbol diff --git a/website/content/api/stocks/ba/cnews/_index.md b/website/content/api/stocks/ba/cnews/_index.md new file mode 100644 index 000000000000..83acb3d85801 --- /dev/null +++ b/website/content/api/stocks/ba/cnews/_index.md @@ -0,0 +1,20 @@ +# stocks.ba.cnews + +## Get underlying data +###stocks.ba.cnews(symbol: str, start_date: str = '2022-08-21', end_date: str = '2022-09-20') -> List[Dict] + +Get news from a company. [Source: Finnhub] + + Parameters + ---------- + symbol : str + company ticker to look for news articles + start_date: str + date to start searching articles, with format YYYY-MM-DD + end_date: str + date to end searching articles, with format YYYY-MM-DD + + Returns + ---------- + articles : List + term to search on the news articles diff --git a/website/content/api/stocks/ba/cramer/_index.md b/website/content/api/stocks/ba/cramer/_index.md new file mode 100644 index 000000000000..ae3cce32ef97 --- /dev/null +++ b/website/content/api/stocks/ba/cramer/_index.md @@ -0,0 +1,16 @@ +# stocks.ba.cramer + +## Get underlying data +###stocks.ba.cramer(inverse: bool = True) -> pandas.core.frame.DataFrame + +Scrape the daily recommendations of Jim Cramer + + Parameters + ---------- + inverse: bool + Whether to include inverse + + Returns + ------- + pd.DataFrame + Datafreme of daily Cramer recommendations diff --git a/website/content/api/stocks/ba/cramer_ticker/_index.md b/website/content/api/stocks/ba/cramer_ticker/_index.md new file mode 100644 index 000000000000..9dc395454ace --- /dev/null +++ b/website/content/api/stocks/ba/cramer_ticker/_index.md @@ -0,0 +1,34 @@ +# stocks.ba.cramer_ticker + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.cramer_ticker(symbol: str) -> pandas.core.frame.DataFrame + +Get cramer recommendations from beginning of year for given ticker + + Parameters + ---------- + symbol: str + Ticker to get recommendations for + + Returns + ------- + pd.DataFrame: + Dataframe with dates and recommendations + +## Getting charts +###stocks.ba.cramer_ticker(symbol: str, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display ticker close with Cramer recommendations + + Parameters + ---------- + symbol: str + Stock ticker + raw: bool + Display raw data + export: str + Format to export data + external_axes: Optional[List[plt.Axes]] = None, + External axes to plot on diff --git a/website/content/api/stocks/ba/getdd/_index.md b/website/content/api/stocks/ba/getdd/_index.md new file mode 100644 index 000000000000..0fbad03dc24d --- /dev/null +++ b/website/content/api/stocks/ba/getdd/_index.md @@ -0,0 +1,22 @@ +# stocks.ba.getdd + +## Get underlying data +###stocks.ba.getdd(ticker: str, limit: int = 5, n_days: int = 3, show_all_flairs: bool = False) -> pandas.core.frame.DataFrame + +Gets due diligence posts from list of subreddits [Source: reddit] + + Parameters + ---------- + ticker: str + Stock ticker + limit: int + Number of posts to get + n_days: int + Number of days back to get posts + show_all_flairs: bool + Search through all flairs (apart from Yolo and Meme) + + Returns + ------- + pd.DataFrame + Dataframe of submissions diff --git a/website/content/api/stocks/ba/headlines/_index.md b/website/content/api/stocks/ba/headlines/_index.md new file mode 100644 index 000000000000..68315bd25fd3 --- /dev/null +++ b/website/content/api/stocks/ba/headlines/_index.md @@ -0,0 +1,34 @@ +# stocks.ba.headlines + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.headlines(symbol: str) -> pandas.core.frame.DataFrame + +Gets Sentiment analysis provided by FinBrain's API [Source: finbrain] + + Parameters + ---------- + symbol : str + Ticker symbol to get the sentiment analysis from + + Returns + ------- + DataFrame() + Empty if there was an issue with data retrieval + +## Getting charts +###stocks.ba.headlines(symbol: str, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Sentiment analysis from FinBrain + + Parameters + ---------- + symbol: str + Ticker symbol to get the sentiment analysis from + raw: False + Display raw table data + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ba/hist/_index.md b/website/content/api/stocks/ba/hist/_index.md new file mode 100644 index 000000000000..3af12537a96a --- /dev/null +++ b/website/content/api/stocks/ba/hist/_index.md @@ -0,0 +1,56 @@ +# stocks.ba.hist + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.hist(symbol: str, start_date: str = '2022-09-13', end_date: str = '2022-09-20', number: int = 100) -> pandas.core.frame.DataFrame + +Get hour-level sentiment data for the chosen symbol + + Source: [Sentiment Investor] + + Parameters + ---------- + symbol: str + Ticker to view sentiment data + start_date: str + Initial date like string or unix timestamp (e.g. 12-21-2021) + end_date: str + End date like string or unix timestamp (e.g. 12-21-2021) + number : int + Number of results returned by API call + Maximum 250 per api call + + Returns + ------- + pd.DataFrame + Dataframe of historical sentiment + +## Getting charts +###stocks.ba.hist(symbol: str, start_date: str = '2022-09-13', end_date: str = '2022-09-20', number: int = 100, raw: bool = False, limit: int = 10, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display historical sentiment data of a ticker, + and plot a chart with RHI and AHI. + + Parameters + ---------- + symbol: str + Ticker symbol to view sentiment data + start_date: str + Initial date like string or unix timestamp (e.g. 2021-12-21) + end_date: str + End date like string or unix timestamp (e.g. 2022-01-15) + number: int + Number of results returned by API call + Maximum 250 per api call + raw: boolean + Whether to display raw data, by default False + limit: int + Number of results display on the terminal + Default: 10 + export: str + Format to export data + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + Returns + ------- diff --git a/website/content/api/stocks/ba/infer/_index.md b/website/content/api/stocks/ba/infer/_index.md new file mode 100644 index 000000000000..220d820b09ba --- /dev/null +++ b/website/content/api/stocks/ba/infer/_index.md @@ -0,0 +1,38 @@ +# stocks.ba.infer + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.infer(symbol: str, limit: int = 100, start_date: Optional[str] = '', end_date: Optional[str] = '') -> pandas.core.frame.DataFrame + +Load tweets from twitter API and analyzes using VADER + + Parameters + ---------- + symbol: str + Ticker symbol to search twitter for + limit: int + Number of tweets to analyze + start_date: Optional[str] + If given, the start time to get tweets from + end_date: Optional[str] + If given, the end time to get tweets from + + Returns + ------- + df_tweet: pd.DataFrame + Dataframe of tweets and sentiment + +## Getting charts +###stocks.ba.infer(symbol: str, limit: int = 100, export: str = '', chart=True) + +Infer sentiment from past n tweets + + Parameters + ---------- + symbol: str + Stock ticker symbol + limit: int + Number of tweets to analyze + export: str + Format to export tweet dataframe diff --git a/website/content/api/stocks/ba/mentions/_index.md b/website/content/api/stocks/ba/mentions/_index.md new file mode 100644 index 000000000000..1df48f50c11b --- /dev/null +++ b/website/content/api/stocks/ba/mentions/_index.md @@ -0,0 +1,34 @@ +# stocks.ba.mentions + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.mentions(symbol: str) -> pandas.core.frame.DataFrame + +Get interest over time from google api [Source: google] + + Parameters + ---------- + symbol: str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of interest over time + +## Getting charts +###stocks.ba.mentions(symbol: str, start_date: str = '', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot weekly bars of stock's interest over time. other users watchlist. [Source: Google] + + Parameters + ---------- + symbol : str + Ticker symbol + start_date : str + Start date as YYYY-MM-DD string + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ba/messages/_index.md b/website/content/api/stocks/ba/messages/_index.md new file mode 100644 index 000000000000..b863cdc42ab2 --- /dev/null +++ b/website/content/api/stocks/ba/messages/_index.md @@ -0,0 +1,32 @@ +# stocks.ba.messages + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.messages(symbol: str, limit: int = 30) -> pandas.core.frame.DataFrame + +Get last messages for a given ticker [Source: stocktwits] + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number of messages to get + + Returns + ------- + pd.DataFrame + Dataframe of messages + +## Getting charts +###stocks.ba.messages(symbol: str, limit: int = 30, chart=True) + +Print up to 30 of the last messages on the board. [Source: Stocktwits] + + Parameters + ---------- + symbol: str + Stock ticker symbol + limit: int + Number of messages to get diff --git a/website/content/api/stocks/ba/popular/_index.md b/website/content/api/stocks/ba/popular/_index.md new file mode 100644 index 000000000000..26a97aae4508 --- /dev/null +++ b/website/content/api/stocks/ba/popular/_index.md @@ -0,0 +1,38 @@ +# stocks.ba.popular + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.popular(limit: int = 10, post_limit: int = 50, subreddits: str = '') -> pandas.core.frame.DataFrame + +Get popular tickers from list of subreddits [Source: reddit] + + Parameters + ---------- + limit : int + Number of top tickers to get + post_limit : int + How many posts to analyze in each subreddit + subreddits : str, optional + String of comma separated subreddits. + + Returns + ------- + pd.DataFrame + DataFrame of top tickers from supplied subreddits + +## Getting charts +###stocks.ba.popular(limit: int = 10, post_limit: int = 50, subreddits: str = '', export: str = '', chart=True) + +Print latest popular tickers. [Source: Reddit] + + Parameters + ---------- + limit : int + Number of top tickers to get + post_limit : int + How many posts to analyze in each subreddit + subreddits : str, optional + String of comma separated subreddits. + export : str + Format to export dataframe diff --git a/website/content/api/stocks/ba/queries/_index.md b/website/content/api/stocks/ba/queries/_index.md new file mode 100644 index 000000000000..453c99adb973 --- /dev/null +++ b/website/content/api/stocks/ba/queries/_index.md @@ -0,0 +1,18 @@ +# stocks.ba.queries + +## Get underlying data +###stocks.ba.queries(symbol: str, limit: int = 10) -> pandas.core.frame.DataFrame + +Get related queries from google api [Source: google] + + Parameters + ---------- + symbol: str + Stock ticker symbol to compare + limit: int + Number of queries to show + + Returns + ------- + dict : {'top': pd.DataFrame or None, 'rising': pd.DataFrame or None} + diff --git a/website/content/api/stocks/ba/reddit_sent/_index.md b/website/content/api/stocks/ba/reddit_sent/_index.md new file mode 100644 index 000000000000..8819a59e4475 --- /dev/null +++ b/website/content/api/stocks/ba/reddit_sent/_index.md @@ -0,0 +1,59 @@ +# stocks.ba.reddit_sent + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.reddit_sent(symbol: str, limit: int = 100, sortby: str = 'relevance', time_frame: str = 'week', full_search: bool = True, subreddits: str = 'all') -> Tuple[pandas.core.frame.DataFrame, list, float] + +Finds posts related to a specific search term in Reddit + + Parameters + ---------- + symbol: str + Ticker symbol to search for + limit: int + Number of posts to get per subreddit + sortby: str + Search type + Possibilities: "relevance", "hot", "top", "new", or "comments" + time_frame: str + Relative time of post + Possibilities: "hour", "day", "week", "month", "year", "all" + full_search: bool + Enable comprehensive search for ticker + subreddits: str + Comma-separated list of subreddits + + Returns + ------- + tuple[pd.DataFrame, list, float]: + Dataframe of submissions related to the search term, + List of polarity scores, + Average polarity score + +## Getting charts +###stocks.ba.reddit_sent(symbol: str, sortby: str = 'relevance', limit: int = 100, graphic: bool = False, time_frame: str = 'week', full_search: bool = True, subreddits: str = 'all', display: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Determine Reddit sentiment about a search term + Parameters + ---------- + symbol: str + The ticker symbol being search for in Reddit + sortby: str + Type of search + limit: str + Number of posts to get at most + graphic: bool + Displays box and whisker plot + time_frame: str + Time frame for search + full_search: bool + Enable comprehensive search for ticker + subreddits: str + Comma-separated list of subreddits + display: bool + Enable printing of raw sentiment values for each post + export: str + Format to export data + external_axes: Optional[List[plt.Axes]] + If supplied, expect 1 external axis diff --git a/website/content/api/stocks/ba/regions/_index.md b/website/content/api/stocks/ba/regions/_index.md new file mode 100644 index 000000000000..04173af35520 --- /dev/null +++ b/website/content/api/stocks/ba/regions/_index.md @@ -0,0 +1,34 @@ +# stocks.ba.regions + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.regions(symbol: str) -> pandas.core.frame.DataFrame + +Get interest by region from google api [Source: google] + + Parameters + ---------- + symbol: str + Ticker symbol to look at + + Returns + ------- + pd.DataFrame + Dataframe of interest by region + +## Getting charts +###stocks.ba.regions(symbol: str, limit: int = 5, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot bars of regions based on stock's interest. [Source: Google] + + Parameters + ---------- + symbol : str + Ticker symbol + limit: int + Number of regions to show + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ba/rise/_index.md b/website/content/api/stocks/ba/rise/_index.md new file mode 100644 index 000000000000..5c089834bc5e --- /dev/null +++ b/website/content/api/stocks/ba/rise/_index.md @@ -0,0 +1,18 @@ +# stocks.ba.rise + +## Get underlying data +###stocks.ba.rise(symbol: str, limit: int = 10) -> pandas.core.frame.DataFrame + +Get top rising related queries with this stock's query [Source: google] + + Parameters + ---------- + symbol: str + Stock ticker symbol + limit: int + Number of queries to show + + Returns + ------- + pd.DataFrame + Dataframe containing rising related queries diff --git a/website/content/api/stocks/ba/sentiment/_index.md b/website/content/api/stocks/ba/sentiment/_index.md new file mode 100644 index 000000000000..1500fa95e06f --- /dev/null +++ b/website/content/api/stocks/ba/sentiment/_index.md @@ -0,0 +1,37 @@ +# stocks.ba.sentiment + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.sentiment(symbol: str, n_tweets: int = 15, n_days_past: int = 2) + +Get sentiments from symbol + + Parameters + ---------- + symbol: str + Stock ticker symbol to get sentiment for + n_tweets: int + Number of tweets to get per hour + n_days_past: int + Number of days to extract tweets for + +## Getting charts +###stocks.ba.sentiment(symbol: str, n_tweets: int = 15, n_days_past: int = 2, compare: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot sentiments from symbol + + Parameters + ---------- + symbol: str + Stock ticker symbol to get sentiment for + n_tweets: int + Number of tweets to get per hour + n_days_past: int + Number of days to extract tweets for + compare: bool + Show corresponding change in stock price + export: str + Format to export tweet dataframe + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ba/snews/_index.md b/website/content/api/stocks/ba/snews/_index.md new file mode 100644 index 000000000000..12f7bca53411 --- /dev/null +++ b/website/content/api/stocks/ba/snews/_index.md @@ -0,0 +1,27 @@ +# stocks.ba.snews + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.snews(symbol: str) -> pandas.core.frame.DataFrame + +Get headlines sentiment using VADER model over time. [Source: Finnhub] + + Parameters + ---------- + symbol : str + Ticker of company + +## Getting charts +###stocks.ba.snews(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display stock price and headlines sentiment using VADER model over time. [Source: Finnhub] + + Parameters + ---------- + symbol : str + Ticker of company + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/stocks/ba/spac/_index.md b/website/content/api/stocks/ba/spac/_index.md new file mode 100644 index 000000000000..2901a5e8f0b3 --- /dev/null +++ b/website/content/api/stocks/ba/spac/_index.md @@ -0,0 +1,20 @@ +# stocks.ba.spac + +## Get underlying data +###stocks.ba.spac(limit: int = 5) -> Tuple[pandas.core.frame.DataFrame, dict, int] + +Get posts containing SPAC from top subreddits [Source: reddit] + + Parameters + ---------- + limit : int, optional + Number of posts to get for each subreddit, by default 5 + + Returns + ------- + pd.DataFrame : + Dataframe of reddit submissions + dict : + Dictionary of tickers and counts + int : + Number of posts found. diff --git a/website/content/api/stocks/ba/spac_c/_index.md b/website/content/api/stocks/ba/spac_c/_index.md new file mode 100644 index 000000000000..46b5ad0a6da0 --- /dev/null +++ b/website/content/api/stocks/ba/spac_c/_index.md @@ -0,0 +1,20 @@ +# stocks.ba.spac_c + +## Get underlying data +###stocks.ba.spac_c(limit: int = 10, popular: bool = False) -> Tuple[pandas.core.frame.DataFrame, dict] + +Get top tickers from r/SPACs [Source: reddit] + + Parameters + ---------- + limit : int + Number of posts to look at + popular : bool + Search by hot instead of new + + Returns + ------- + pd.DataFrame: + Dataframe of reddit submission + dict: + Dictionary of tickers and number of mentions diff --git a/website/content/api/stocks/ba/stalker/_index.md b/website/content/api/stocks/ba/stalker/_index.md new file mode 100644 index 000000000000..aab1bd6b9efe --- /dev/null +++ b/website/content/api/stocks/ba/stalker/_index.md @@ -0,0 +1,13 @@ +# stocks.ba.stalker + +## Get underlying data +###stocks.ba.stalker(user: str, limit: int = 30) -> List[Dict] + +Gets messages from given user [Source: stocktwits] + + Parameters + ---------- + user : str + User to get posts for + limit : int, optional + Number of posts to get, by default 30 diff --git a/website/content/api/stocks/ba/text_sent/_index.md b/website/content/api/stocks/ba/text_sent/_index.md new file mode 100644 index 000000000000..d5daf42923de --- /dev/null +++ b/website/content/api/stocks/ba/text_sent/_index.md @@ -0,0 +1,16 @@ +# stocks.ba.text_sent + +## Get underlying data +###stocks.ba.text_sent(post_data: List[str]) -> float + +Find the sentiment of a post and related comments + + Parameters + ---------- + post_data: list[str] + A post and its comments in string form + + Returns + ------- + float + A number in the range [-1, 1] representing sentiment diff --git a/website/content/api/stocks/ba/trend/_index.md b/website/content/api/stocks/ba/trend/_index.md new file mode 100644 index 000000000000..44171d10b9ba --- /dev/null +++ b/website/content/api/stocks/ba/trend/_index.md @@ -0,0 +1,47 @@ +# stocks.ba.trend + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.trend(start_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 405431), hour: int = 0, number: int = 10) -> pandas.core.frame.DataFrame + +Get sentiment data on the most talked about tickers + within the last hour + + Source: [Sentiment Investor] + + Parameters + ---------- + start_date: datetime + Datetime object (e.g. datetime(2021, 12, 21) + hour: int + Hour of the day in 24-hour notation (e.g. 14) + number : int + Number of results returned by API call + Maximum 250 per api call + + Returns + ------- + pd.DataFrame + Dataframe of trending data + +## Getting charts +###stocks.ba.trend(start_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 405814, chart=True), hour: int = 0, number: int = 10, limit: int = 10, export: str = '') + +Display most talked about tickers within + the last hour together with their sentiment data. + + Parameters + ---------- + start_date: datetime + Datetime object (e.g. datetime(2021, 12, 21) + hour: int + Hour of the day in 24-hour notation (e.g. 14) + number : int + Number of results returned by API call + Maximum 250 per api call + limit: int + Number of results display on the terminal + Default: 10 + export: str + Format to export data diff --git a/website/content/api/stocks/ba/trending/_index.md b/website/content/api/stocks/ba/trending/_index.md new file mode 100644 index 000000000000..318ad1bb2222 --- /dev/null +++ b/website/content/api/stocks/ba/trending/_index.md @@ -0,0 +1,11 @@ +# stocks.ba.trending + +## Get underlying data +###stocks.ba.trending() -> pandas.core.frame.DataFrame + +Get trending tickers from stocktwits [Source: stocktwits] + + Returns + ------- + pd.DataFrame + Dataframe of trending tickers and watchlist count diff --git a/website/content/api/stocks/ba/watchlist/_index.md b/website/content/api/stocks/ba/watchlist/_index.md new file mode 100644 index 000000000000..28ae8721aece --- /dev/null +++ b/website/content/api/stocks/ba/watchlist/_index.md @@ -0,0 +1,32 @@ +# stocks.ba.watchlist + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ba.watchlist(limit: int = 5) -> Tuple[List[praw.models.reddit.submission.Submission], dict, int] + +Get reddit users watchlists [Source: reddit] + + Parameters + ---------- + limit : int + Number of posts to look through + + Returns + ------- + list[praw.models.reddit.submission.Submission]: + List of reddit submissions + dict: + Dictionary of tickers and counts + int + Count of how many posts were analyzed + +## Getting charts +###stocks.ba.watchlist(limit: int = 5, chart=True) + +Print other users watchlist. [Source: Reddit] + + Parameters + ---------- + limit: int + Maximum number of submissions to look at diff --git a/website/content/api/stocks/ba/wsb/_index.md b/website/content/api/stocks/ba/wsb/_index.md new file mode 100644 index 000000000000..a0308c593974 --- /dev/null +++ b/website/content/api/stocks/ba/wsb/_index.md @@ -0,0 +1,18 @@ +# stocks.ba.wsb + +## Get underlying data +###stocks.ba.wsb(limit: int = 10, new: bool = False) -> pandas.core.frame.DataFrame + +Get wsb posts [Source: reddit] + + Parameters + ---------- + limit : int, optional + Number of posts to get, by default 10 + new : bool, optional + Flag to sort by new instead of hot, by default False + + Returns + ------- + pd.DataFrame + Dataframe of reddit submissions diff --git a/website/content/api/stocks/bt/ema/_index.md b/website/content/api/stocks/bt/ema/_index.md new file mode 100644 index 000000000000..676a52c13f6f --- /dev/null +++ b/website/content/api/stocks/bt/ema/_index.md @@ -0,0 +1,48 @@ +# stocks.bt.ema + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.bt.ema(symbol: str, data: pandas.core.frame.DataFrame, ema_length: int = 20, spy_bt: bool = True, no_bench: bool = False) -> bt.backtest.Result + +Perform backtest for simple EMA strategy. Buys when price>EMA(l) + + Parameters + ---------- + symbol: str + Stock ticker + data: pd.DataFrame + Dataframe of prices + ema_length: int + Length of ema window + spy_bt: bool + Boolean to add spy comparison + no_bench: bool + Boolean to not show buy and hold comparison + + Returns + ------- + bt.backtest.Result + Backtest results + +## Getting charts +###stocks.bt.ema(symbol: str, data: pandas.core.frame.DataFrame, ema_length: int = 20, spy_bt: bool = True, no_bench: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Strategy where stock is bought when Price > EMA(l) + + Parameters + ---------- + symbol : str + Stock ticker + data : pd.Dataframe + Dataframe of prices + ema_length : int + Length of ema window + spy_bt : bool + Boolean to add spy comparison + no_bench : bool + Boolean to not show buy and hold comparison + export : bool + Format to export backtest results + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None diff --git a/website/content/api/stocks/bt/ema_cross/_index.md b/website/content/api/stocks/bt/ema_cross/_index.md new file mode 100644 index 000000000000..53487be7b44c --- /dev/null +++ b/website/content/api/stocks/bt/ema_cross/_index.md @@ -0,0 +1,56 @@ +# stocks.bt.ema_cross + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.bt.ema_cross(symbol: str, data: pandas.core.frame.DataFrame, short_length: int = 20, long_length: int = 50, spy_bt: bool = True, no_bench: bool = False, shortable: bool = True) -> bt.backtest.Result + +Perform backtest for simple EMA strategy. Buys when price>EMA(l) + + Parameters + ---------- + symbol : str + Stock ticker + data : pd.DataFrame + Dataframe of prices + short_length : int + Length of short ema window + long_length : int + Length of long ema window + spy_bt : bool + Boolean to add spy comparison + no_bench : bool + Boolean to not show buy and hold comparison + shortable : bool + Boolean to allow for selling of the stock at cross + + Returns + ------- + Result + Backtest results + +## Getting charts +###stocks.bt.ema_cross(symbol: str, data: pandas.core.frame.DataFrame, short_ema: int = 20, long_ema: int = 50, spy_bt: bool = True, no_bench: bool = False, shortable: bool = True, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Strategy where we go long/short when EMA(short) is greater than/less than EMA(short) + + Parameters + ---------- + symbol : str + Stock ticker + data : pd.Dataframe + Dataframe of prices + short_ema : int + Length of short ema window + long_ema : int + Length of long ema window + spy_bt : bool + Boolean to add spy comparison + no_bench : bool + Boolean to not show buy and hold comparison + shortable : bool + Boolean to allow for selling of the stock at cross + export : str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/bt/rsi/_index.md b/website/content/api/stocks/bt/rsi/_index.md new file mode 100644 index 000000000000..e58ad8bf20dd --- /dev/null +++ b/website/content/api/stocks/bt/rsi/_index.md @@ -0,0 +1,60 @@ +# stocks.bt.rsi + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.bt.rsi(symbol: str, data: pandas.core.frame.DataFrame, periods: int = 14, low_rsi: int = 30, high_rsi: int = 70, spy_bt: bool = True, no_bench: bool = False, shortable: bool = True) -> bt.backtest.Result + +Perform backtest for simple EMA strategy. Buys when price>EMA(l) + + Parameters + ---------- + symbol : str + Stock ticker + data : pd.DataFrame + Dataframe of prices + periods : int + Number of periods for RSI calculation + low_rsi : int + Low RSI value to buy + high_rsi : int + High RSI value to sell + spy_bt : bool + Boolean to add spy comparison + no_bench : bool + Boolean to not show buy and hold comparison + shortable : bool + Flag to disable the ability to short sell + + Returns + ------- + Result + Backtest results + +## Getting charts +###stocks.bt.rsi(symbol: str, data: pandas.core.frame.DataFrame, periods: int = 14, low_rsi: int = 30, high_rsi: int = 70, spy_bt: bool = True, no_bench: bool = False, shortable: bool = True, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Strategy that buys when the stock is less than a threshold and shorts when it exceeds a threshold. + + Parameters + ---------- + symbol : str + Stock ticker + data : pd.Dataframe + Dataframe of prices + periods : int + Number of periods for RSI calculation + low_rsi : int + Low RSI value to buy + high_rsi : int + High RSI value to sell + spy_bt : bool + Boolean to add spy comparison + no_bench : bool + Boolean to not show buy and hold comparison + shortable : bool + Boolean to allow for selling of the stock at cross + export : str + Format to export backtest results + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ca/balance/_index.md b/website/content/api/stocks/ca/balance/_index.md new file mode 100644 index 000000000000..ccdda48ab7d2 --- /dev/null +++ b/website/content/api/stocks/ca/balance/_index.md @@ -0,0 +1,19 @@ +# stocks.ca.balance + +## Get underlying data +###stocks.ca.balance(similar: List[str], timeframe: str = '2021', quarter: bool = False) + +Get balance data. [Source: Marketwatch] + + Parameters + ---------- + similar : List[str] + List of tickers to compare. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + timeframe : str + Column header to compare + quarter : bool, optional + Whether to use quarterly statements, by default False + export : str, optional + Format to export data diff --git a/website/content/api/stocks/ca/cashflow/_index.md b/website/content/api/stocks/ca/cashflow/_index.md new file mode 100644 index 000000000000..c651131d46f1 --- /dev/null +++ b/website/content/api/stocks/ca/cashflow/_index.md @@ -0,0 +1,19 @@ +# stocks.ca.cashflow + +## Get underlying data +###stocks.ca.cashflow(similar: List[str], timeframe: str = '2021', quarter: bool = False) + +Get cashflow data. [Source: Marketwatch] + + Parameters + ---------- + similar : List[str] + List of tickers to compare. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + timeframe : str + Column header to compare + quarter : bool, optional + Whether to use quarterly statements, by default False + export : str, optional + Format to export data diff --git a/website/content/api/stocks/ca/finnhub_peers/_index.md b/website/content/api/stocks/ca/finnhub_peers/_index.md new file mode 100644 index 000000000000..5defe8115473 --- /dev/null +++ b/website/content/api/stocks/ca/finnhub_peers/_index.md @@ -0,0 +1,16 @@ +# stocks.ca.finnhub_peers + +## Get underlying data +###stocks.ca.finnhub_peers(symbol: str) -> List[str] + +Get similar companies from Finhub + + Parameters + ---------- + symbol : str + Ticker to find comparisons for + + Returns + ------- + List[str] + List of similar companies diff --git a/website/content/api/stocks/ca/finviz_peers/_index.md b/website/content/api/stocks/ca/finviz_peers/_index.md new file mode 100644 index 000000000000..522d1991813f --- /dev/null +++ b/website/content/api/stocks/ca/finviz_peers/_index.md @@ -0,0 +1,18 @@ +# stocks.ca.finviz_peers + +## Get underlying data +###stocks.ca.finviz_peers(symbol: str, compare_list: List[str] = None) -> Tuple[List[str], str] + +Get similar companies from Finviz + + Parameters + ---------- + symbol : str + Ticker to find comparisons for + compare_list : List[str] + List of fields to compare, ["Sector", "Industry", "Country"] + + Returns + ------- + List[str] + List of similar companies diff --git a/website/content/api/stocks/ca/hcorr/_index.md b/website/content/api/stocks/ca/hcorr/_index.md new file mode 100644 index 000000000000..9a5726c2d1c5 --- /dev/null +++ b/website/content/api/stocks/ca/hcorr/_index.md @@ -0,0 +1,46 @@ +# stocks.ca.hcorr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.hcorr(similar: List[str], start_date: str = '2021-09-19', candle_type: str = 'a') + + + Get historical price correlation. [Source: Yahoo Finance] + + Parameters + ---------- + similar : List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start_date : str, optional + Start date of comparison, by default 1 year ago + candle_type : str, optional + OHLCA column to use for candles or R for returns, by default "a" for Adjusted Close + +## Getting charts +###stocks.ca.hcorr(similar: List[str], start_date: str = '2021-09-19', candle_type: str = 'a', display_full_matrix: bool = False, raw: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, export: str = '', chart=True) + + + Correlation heatmap based on historical price comparison + between similar companies. [Source: Yahoo Finance] + + Parameters + ---------- + similar : List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start_date : str, optional + Start date of comparison, by default 1 year ago + candle_type : str, optional + OHLCA column to use for candles or R for returns, by default "a" for Adjusted Close + display_full_matrix : bool, optional + Optionally display all values in the matrix, rather than masking off half, by default False + raw: bool, optional + Whether to display raw data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + export : str, optional + Format to export correlation prices, by default "" diff --git a/website/content/api/stocks/ca/hist/_index.md b/website/content/api/stocks/ca/hist/_index.md new file mode 100644 index 000000000000..52778437b95b --- /dev/null +++ b/website/content/api/stocks/ca/hist/_index.md @@ -0,0 +1,47 @@ +# stocks.ca.hist + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.hist(similar: List[str], start: str = '2021-09-19', candle_type: str = 'a') -> pandas.core.frame.DataFrame + +Get historical prices for all comparison stocks + + Parameters + ---------- + similar: List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start: str, optional + Start date of comparison. Defaults to 1 year previously + candle_type: str, optional + Candle variable to compare, by default "a" for Adjusted Close. Possible values are: o, h, l, c, a, v, r + + Returns + ------- + pd.DataFrame + Dataframe containing candle type variable for each ticker + +## Getting charts +###stocks.ca.hist(similar: List[str], start_date: str = '2021-09-19', candle_type: str = 'a', normalize: bool = True, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display historical stock prices. [Source: Yahoo Finance] + + Parameters + ---------- + similar: List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start_date: str, optional + Start date of comparison, by default 1 year ago + candle_type: str, optional + OHLCA column to use or R to use daily returns calculated from Adjusted Close, by default "a" for Adjusted Close + normalize: bool, optional + Boolean to normalize all stock prices using MinMax defaults True + export: str, optional + Format to export historical prices, by default "" + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/stocks/ca/income/_index.md b/website/content/api/stocks/ca/income/_index.md new file mode 100644 index 000000000000..93cb67ea393f --- /dev/null +++ b/website/content/api/stocks/ca/income/_index.md @@ -0,0 +1,40 @@ +# stocks.ca.income + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.income(similar: List[str], timeframe: str = '2021', quarter: bool = False) + +Get income data. [Source: Marketwatch] + + Parameters + ---------- + similar : List[str] + List of tickers to compare. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + timeframe : str + Column header to compare + quarter : bool, optional + Whether to use quarterly statements, by default False + export : str, optional + Format to export data + +## Getting charts +###stocks.ca.income(symbols: List[str], timeframe: str = '2021', quarter: bool = False, export: str = '', chart=True) + +Display income data. [Source: Marketwatch] + + Parameters + ---------- + symbols : List[str] + List of tickers to compare. Enter tickers you want to see as shown below: + ["TSLA", "AAPL", "NFLX", "BBY"] + You can also get a list of comparable peers with + finnhub_peers(), finviz_peers(), polygon_peers(). + timeframe : str + What year to look at + quarter : bool, optional + Whether to use quarterly statements, by default False + export : str, optional + Format to export data diff --git a/website/content/api/stocks/ca/polygon_peers/_index.md b/website/content/api/stocks/ca/polygon_peers/_index.md new file mode 100644 index 000000000000..1d9ce910a57d --- /dev/null +++ b/website/content/api/stocks/ca/polygon_peers/_index.md @@ -0,0 +1,18 @@ +# stocks.ca.polygon_peers + +## Get underlying data +###stocks.ca.polygon_peers(symbol: str, us_only: bool = False) -> List[str] + +Get similar companies from Polygon + + Parameters + ---------- + symbol: str + Ticker to get similar companies of + us_only: bool + Only stocks from the US stock exchanges + + Returns + ------- + List[str]: + List of similar tickers diff --git a/website/content/api/stocks/ca/scorr/_index.md b/website/content/api/stocks/ca/scorr/_index.md new file mode 100644 index 000000000000..6b9bd477476d --- /dev/null +++ b/website/content/api/stocks/ca/scorr/_index.md @@ -0,0 +1,33 @@ +# stocks.ca.scorr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.scorr(similar: List[str]) + +Get correlation sentiments across similar companies. [Source: FinBrain] + + Parameters + ---------- + similar : List[str] + Similar companies to compare income with. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + +## Getting charts +###stocks.ca.scorr(similar: List[str], raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot correlation sentiments heatmap across similar companies. [Source: FinBrain] + + Parameters + ---------- + similar : List[str] + Similar companies to compare income with. + Comparable companies can be accessed through + finviz_peers(), finnhub_peers() or polygon_peers(). + raw : bool, optional + Output raw values, by default False + export : str, optional + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ca/screener/_index.md b/website/content/api/stocks/ca/screener/_index.md new file mode 100644 index 000000000000..6b097c9ac4b9 --- /dev/null +++ b/website/content/api/stocks/ca/screener/_index.md @@ -0,0 +1,20 @@ +# stocks.ca.screener + +## Get underlying data +###stocks.ca.screener(similar: List[str], data_type: str = 'overview') + +Screener Overview + + Parameters + ---------- + similar: + List of similar companies. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + data_type : str + Data type between: overview, valuation, financial, ownership, performance, technical + + Returns + ---------- + pd.DataFrame + Dataframe with overview, valuation, financial, ownership, performance or technical diff --git a/website/content/api/stocks/ca/sentiment/_index.md b/website/content/api/stocks/ca/sentiment/_index.md new file mode 100644 index 000000000000..ee11a327eb2b --- /dev/null +++ b/website/content/api/stocks/ca/sentiment/_index.md @@ -0,0 +1,38 @@ +# stocks.ca.sentiment + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.sentiment(symbols: List[str]) -> pandas.core.frame.DataFrame + +Gets Sentiment analysis from several symbols provided by FinBrain's API + + Parameters + ---------- + symbols : List[str] + List of tickers to get sentiment + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + + Returns + ------- + pd.DataFrame + Contains sentiment analysis from several tickers + +## Getting charts +###stocks.ca.sentiment(similar: List[str], raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display sentiment for all ticker. [Source: FinBrain] + + Parameters + ---------- + similar : List[str] + Similar companies to compare income with. + Comparable companies can be accessed through + finviz_peers(), finnhub_peers() or polygon_peers(). + raw : bool, optional + Output raw values, by default False + export : str, optional + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ca/volume/_index.md b/website/content/api/stocks/ca/volume/_index.md new file mode 100644 index 000000000000..542f7f8eb555 --- /dev/null +++ b/website/content/api/stocks/ca/volume/_index.md @@ -0,0 +1,35 @@ +# stocks.ca.volume + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ca.volume(similar: List[str], start_date: str = '2021-09-19') -> pandas.core.frame.DataFrame + +Get stock volume. [Source: Yahoo Finance] + + Parameters + ---------- + similar : List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start_date : str, optional + Start date of comparison, by default 1 year ago + +## Getting charts +###stocks.ca.volume(similar: List[str], start_date: str = '2021-09-19', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display stock volume. [Source: Yahoo Finance] + + Parameters + ---------- + similar : List[str] + List of similar tickers. + Comparable companies can be accessed through + finnhub_peers(), finviz_peers(), polygon_peers(). + start_date : str, optional + Start date of comparison, by default 1 year ago + export : str, optional + Format to export historical prices, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/candle/_index.md b/website/content/api/stocks/candle/_index.md new file mode 100644 index 000000000000..669b5dbca406 --- /dev/null +++ b/website/content/api/stocks/candle/_index.md @@ -0,0 +1,45 @@ +# stocks.candle + +## Get underlying data +###stocks.candle(symbol: str, data: pandas.core.frame.DataFrame = None, use_matplotlib: bool = True, intraday: bool = False, add_trend: bool = False, ma: Optional[Iterable[int]] = None, asset_type: str = '', start_date: datetime.datetime = datetime.datetime(2019, 9, 16, 18, 22, 32, 961025), interval: int = 1440, end_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 961026), prepost: bool = False, source: str = 'yf', iexrange: str = 'ytd', weekly: bool = False, monthly: bool = False, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, raw: bool = False) + +Shows candle plot of loaded ticker. [Source: Yahoo Finance, IEX Cloud or Alpha Vantage] + + Parameters + ---------- + symbol: str + Ticker name + data: pd.DataFrame + Stock dataframe + use_matplotlib: bool + Flag to use matplotlib instead of interactive plotly chart + intraday: bool + Flag for intraday data for plotly range breaks + add_trend: bool + Flag to add high and low trends to chart + ma: Tuple[int] + Moving averages to add to the candle + asset_type_: str + String to include in title + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + asset_type_: str + String to include in title + start_date: datetime + Start date to get data from with + interval: int + Interval (in minutes) to get data 1, 5, 15, 30, 60 or 1440 + end_date: datetime + End date to get data from with + prepost: bool + Pre and After hours data + source: str + Source of data extracted + iexrange: str + Timeframe to get IEX data. + weekly: bool + Flag to get weekly data + monthly: bool + Flag to get monthly data + raw : bool, optional + Flag to display raw data, by default False diff --git a/website/content/api/stocks/dd/analyst/_index.md b/website/content/api/stocks/dd/analyst/_index.md new file mode 100644 index 000000000000..37c5e9a94340 --- /dev/null +++ b/website/content/api/stocks/dd/analyst/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.analyst + +## Get underlying data +###stocks.dd.analyst(symbol: str) -> pandas.core.frame.DataFrame + +Get analyst data. [Source: Finviz] + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + df_fa: DataFrame + Analyst price targets diff --git a/website/content/api/stocks/dd/arktrades/_index.md b/website/content/api/stocks/dd/arktrades/_index.md new file mode 100644 index 000000000000..01c4b9409a01 --- /dev/null +++ b/website/content/api/stocks/dd/arktrades/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.arktrades + +## Get underlying data +###stocks.dd.arktrades(symbol: str) -> pandas.core.frame.DataFrame + +Gets a dataframe of ARK trades for ticker + + Parameters + ---------- + symbol : str + Ticker to get trades for + + Returns + ------- + pd.DataFrame + DataFrame of trades diff --git a/website/content/api/stocks/dd/customer/_index.md b/website/content/api/stocks/dd/customer/_index.md new file mode 100644 index 000000000000..7980855f2b89 --- /dev/null +++ b/website/content/api/stocks/dd/customer/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.customer + +## Get underlying data +###stocks.dd.customer(symbol: str) -> List[str] + +Print customers from ticker provided + + Parameters + ---------- + symbol: str + Ticker to select customers from + + Returns + ------- + list[str] + List of customers for ticker provided diff --git a/website/content/api/stocks/dd/est/_index.md b/website/content/api/stocks/dd/est/_index.md new file mode 100644 index 000000000000..07f0c1855a04 --- /dev/null +++ b/website/content/api/stocks/dd/est/_index.md @@ -0,0 +1,20 @@ +# stocks.dd.est + +## Get underlying data +###stocks.dd.est(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Get analysts' estimates for a given ticker. [Source: Business Insider] + + Parameters + ---------- + symbol : str + Ticker to get analysts' estimates + + Returns + ------- + df_year_estimates : pd.DataFrame + Year estimates + df_quarter_earnings : pd.DataFrame + Quarter earnings estimates + df_quarter_revenues : pd.DataFrame + Quarter revenues estimates diff --git a/website/content/api/stocks/dd/news/_index.md b/website/content/api/stocks/dd/news/_index.md new file mode 100644 index 000000000000..84cd44d4d877 --- /dev/null +++ b/website/content/api/stocks/dd/news/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.news + +## Get underlying data +###stocks.dd.news(symbol: str) -> List[Any] + +Get news from Finviz + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + List[Any] + News diff --git a/website/content/api/stocks/dd/pt/_index.md b/website/content/api/stocks/dd/pt/_index.md new file mode 100644 index 000000000000..eb363dba4021 --- /dev/null +++ b/website/content/api/stocks/dd/pt/_index.md @@ -0,0 +1,40 @@ +# stocks.dd.pt + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dd.pt(symbol: str) -> pandas.core.frame.DataFrame + +Get analysts' price targets for a given stock. [Source: Business Insider] + + Parameters + ---------- + symbol : str + Ticker symbol + + Returns + ------- + pd.DataFrame + Analysts data + +## Getting charts +###stocks.dd.pt(symbol: str, data: pandas.core.frame.DataFrame, start_date: str = '2022-09-20', limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display analysts' price targets for a given stock. [Source: Business Insider] + + Parameters + ---------- + symbol: str + Due diligence ticker symbol + data: DataFrame + Due diligence stock dataframe + start_date : str + Start date of the stock data + limit : int + Number of latest price targets from analysts to print + raw: bool + Display raw data only + export: str + Export dataframe data to csv,json,xlsx file + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/dd/rating/_index.md b/website/content/api/stocks/dd/rating/_index.md new file mode 100644 index 000000000000..5005cc41bcdf --- /dev/null +++ b/website/content/api/stocks/dd/rating/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.rating + +## Get underlying data +###stocks.dd.rating(symbol: str) -> pandas.core.frame.DataFrame + +Get ratings for a given ticker. [Source: Financial Modeling Prep] + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Rating data diff --git a/website/content/api/stocks/dd/rot/_index.md b/website/content/api/stocks/dd/rot/_index.md new file mode 100644 index 000000000000..ca7bd9b7512a --- /dev/null +++ b/website/content/api/stocks/dd/rot/_index.md @@ -0,0 +1,36 @@ +# stocks.dd.rot + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dd.rot(symbol: str) -> pandas.core.frame.DataFrame + +Get rating over time data. [Source: Finnhub] + + Parameters + ---------- + symbol : str + Ticker symbol to get ratings from + + Returns + ------- + pd.DataFrame + Get dataframe with ratings + +## Getting charts +###stocks.dd.rot(symbol: str, limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Rating over time (monthly). [Source: Finnhub] + + Parameters + ---------- + ticker : str + Ticker to get ratings from + limit : int + Number of last months ratings to show + raw: bool + Display raw data only + export: str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]] + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/dd/sec/_index.md b/website/content/api/stocks/dd/sec/_index.md new file mode 100644 index 000000000000..d8823cacc3cc --- /dev/null +++ b/website/content/api/stocks/dd/sec/_index.md @@ -0,0 +1,32 @@ +# stocks.dd.sec + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dd.sec(symbol: str) -> pandas.core.frame.DataFrame + +Get SEC filings for a given stock ticker. [Source: Market Watch] + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + df_financials : pd.DataFrame + SEC filings data + +## Getting charts +###stocks.dd.sec(symbol: str, limit: int = 5, export: str = '', chart=True) + +Display SEC filings for a given stock ticker. [Source: Market Watch] + + Parameters + ---------- + symbol: str + Stock ticker symbol + limit: int + Number of ratings to display + export: str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/stocks/dd/supplier/_index.md b/website/content/api/stocks/dd/supplier/_index.md new file mode 100644 index 000000000000..f5e369f9cd39 --- /dev/null +++ b/website/content/api/stocks/dd/supplier/_index.md @@ -0,0 +1,16 @@ +# stocks.dd.supplier + +## Get underlying data +###stocks.dd.supplier(symbol: str) -> List[str] + +Get suppliers from ticker provided. [Source: CSIMarket] + + Parameters + ---------- + symbol: str + Ticker to select suppliers from + + Returns + ------- + list[str] + List of suppliers for ticker provided diff --git a/website/content/api/stocks/disc/active/_index.md b/website/content/api/stocks/disc/active/_index.md new file mode 100644 index 000000000000..14c677e948ca --- /dev/null +++ b/website/content/api/stocks/disc/active/_index.md @@ -0,0 +1,11 @@ +# stocks.disc.active + +## Get underlying data +###stocks.disc.active() -> pandas.core.frame.DataFrame + +Get stocks ordered in descending order by intraday trade volume. [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Most active stocks diff --git a/website/content/api/stocks/disc/arkord/_index.md b/website/content/api/stocks/disc/arkord/_index.md new file mode 100644 index 000000000000..0f185196b984 --- /dev/null +++ b/website/content/api/stocks/disc/arkord/_index.md @@ -0,0 +1,25 @@ +# stocks.disc.arkord + +## Get underlying data +###stocks.disc.arkord(sortby: str = '', ascend: bool = False, buys_only: bool = False, sells_only: bool = False, fund: str = '') -> pandas.core.frame.DataFrame + +Returns ARK orders in a Dataframe + + Parameters + ---------- + sortby: str + Column to sort on + ascend: bool + Flag to sort in ascending order + buys_only: bool + Flag to filter on buys only + sells_only: bool + Flag to sort on sells only + fund: str + Optional filter by fund + + Returns + ------- + DataFrame + ARK orders data frame with the following columns: + ticker, date, shares, weight, fund, direction diff --git a/website/content/api/stocks/disc/asc/_index.md b/website/content/api/stocks/disc/asc/_index.md new file mode 100644 index 000000000000..169a95b38718 --- /dev/null +++ b/website/content/api/stocks/disc/asc/_index.md @@ -0,0 +1,12 @@ +# stocks.disc.asc + +## Get underlying data +###stocks.disc.asc() -> pandas.core.frame.DataFrame + +Get Yahoo Finance small cap stocks with earnings growth rates better than 25%. + [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Most aggressive small cap stocks diff --git a/website/content/api/stocks/disc/dividends/_index.md b/website/content/api/stocks/disc/dividends/_index.md new file mode 100644 index 000000000000..0d54c380964d --- /dev/null +++ b/website/content/api/stocks/disc/dividends/_index.md @@ -0,0 +1,16 @@ +# stocks.disc.dividends + +## Get underlying data +###stocks.disc.dividends(date: str = '2022-09-20') -> pandas.core.frame.DataFrame + +Gets dividend calendar for given date. Date represents Ex-Dividend Date + + Parameters + ---------- + date: datetime + Date to get for in format YYYY-MM-DD + + Returns + ------- + pd.DataFrame: + Dataframe of dividend calendar diff --git a/website/content/api/stocks/disc/fipo/_index.md b/website/content/api/stocks/disc/fipo/_index.md new file mode 100644 index 000000000000..0c6f155fda62 --- /dev/null +++ b/website/content/api/stocks/disc/fipo/_index.md @@ -0,0 +1,13 @@ +# stocks.disc.fipo + +## Get underlying data +###stocks.disc.fipo(num_days_ahead: int = 5, end_date: Optional[str] = None) + +Future IPOs dates. [Source: Finnhub] + + Parameters + ---------- + num_days_ahead: int + Number of days to look ahead for IPOs dates + end_date: datetime + The end date (format YYYY-MM-DD) to look for IPOs from today onwards diff --git a/website/content/api/stocks/disc/ford/_index.md b/website/content/api/stocks/disc/ford/_index.md new file mode 100644 index 000000000000..d92a4680e852 --- /dev/null +++ b/website/content/api/stocks/disc/ford/_index.md @@ -0,0 +1,13 @@ +# stocks.disc.ford + +## Get underlying data +###stocks.disc.ford() -> Tuple[str, pandas.core.frame.DataFrame] + +Returns Fidelity orders in a Dataframe + + Returns + ------- + Tuple[str, DataFrame] + First value in the tuple is a Fidelity orders header + Fidelity orders Dataframe with the following columns: + Symbol, Buy / Sell Ratio, Price Change, Company, # Buy Orders, # Sell Orders diff --git a/website/content/api/stocks/disc/gainers/_index.md b/website/content/api/stocks/disc/gainers/_index.md new file mode 100644 index 000000000000..b848d2257e54 --- /dev/null +++ b/website/content/api/stocks/disc/gainers/_index.md @@ -0,0 +1,11 @@ +# stocks.disc.gainers + +## Get underlying data +###stocks.disc.gainers() -> pandas.core.frame.DataFrame + +Get top gainers. [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Stock Gainers diff --git a/website/content/api/stocks/disc/gtech/_index.md b/website/content/api/stocks/disc/gtech/_index.md new file mode 100644 index 000000000000..f84d5cb0bcf0 --- /dev/null +++ b/website/content/api/stocks/disc/gtech/_index.md @@ -0,0 +1,11 @@ +# stocks.disc.gtech + +## Get underlying data +###stocks.disc.gtech() -> pandas.core.frame.DataFrame + +Get technology stocks with revenue and earnings growth in excess of 25%. [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Growth technology stocks diff --git a/website/content/api/stocks/disc/hotpenny/_index.md b/website/content/api/stocks/disc/hotpenny/_index.md new file mode 100644 index 000000000000..ee0e27e94b6b --- /dev/null +++ b/website/content/api/stocks/disc/hotpenny/_index.md @@ -0,0 +1,12 @@ +# stocks.disc.hotpenny + +## Get underlying data +###stocks.disc.hotpenny() -> pandas.core.frame.DataFrame + +Returns today hot penny stocks + + Returns + ------- + DataFrame + Today hot penny stocks DataFrame with the following columns: + Ticker, Price, Change, $ Volume, Volume, # Trades diff --git a/website/content/api/stocks/disc/ipo/_index.md b/website/content/api/stocks/disc/ipo/_index.md new file mode 100644 index 000000000000..310e32df2123 --- /dev/null +++ b/website/content/api/stocks/disc/ipo/_index.md @@ -0,0 +1,18 @@ +# stocks.disc.ipo + +## Get underlying data +###stocks.disc.ipo(start_date: str = '2022-09-15', end_date: str = '2022-09-20') -> pandas.core.frame.DataFrame + +Get IPO calendar + + Parameters + ---------- + start_date : str + start date (%Y-%m-%d) to get IPO calendar + end_date : str + end date (%Y-%m-%d) to get IPO calendar + + Returns + ------- + pd.DataFrame + Get dataframe with economic calendar events diff --git a/website/content/api/stocks/disc/losers/_index.md b/website/content/api/stocks/disc/losers/_index.md new file mode 100644 index 000000000000..39e69ac0a327 --- /dev/null +++ b/website/content/api/stocks/disc/losers/_index.md @@ -0,0 +1,11 @@ +# stocks.disc.losers + +## Get underlying data +###stocks.disc.losers() -> pandas.core.frame.DataFrame + +Get top losers. [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Stock Losers diff --git a/website/content/api/stocks/disc/lowfloat/_index.md b/website/content/api/stocks/disc/lowfloat/_index.md new file mode 100644 index 000000000000..c8125954f38f --- /dev/null +++ b/website/content/api/stocks/disc/lowfloat/_index.md @@ -0,0 +1,12 @@ +# stocks.disc.lowfloat + +## Get underlying data +###stocks.disc.lowfloat() -> pandas.core.frame.DataFrame + +Returns low float DataFrame + + Returns + ------- + DataFrame + Low float DataFrame with the following columns: + Ticker, Company, Exchange, ShortInt, Float, Outstd, Industry diff --git a/website/content/api/stocks/disc/news/_index.md b/website/content/api/stocks/disc/news/_index.md new file mode 100644 index 000000000000..e3ffa31daf9f --- /dev/null +++ b/website/content/api/stocks/disc/news/_index.md @@ -0,0 +1,19 @@ +# stocks.disc.news + +## Get underlying data +###stocks.disc.news(news_type: str = 'Top-News', num: int = 5) -> List + +Gets news. [Source: SeekingAlpha] + + Parameters + ---------- + news_type : str + From: Top-News, On-The-Move, Market-Pulse, Notable-Calls, Buybacks, Commodities, Crypto, Issuance, Global, + Guidance, IPOs, SPACs, Politics, M-A, Consumer, Energy, Financials, Healthcare, MLPs, REITs, Technology + num : int + Number of news to display + + Returns + ------- + List[dict] + List of dict news diff --git a/website/content/api/stocks/disc/pipo/_index.md b/website/content/api/stocks/disc/pipo/_index.md new file mode 100644 index 000000000000..f5cc4401c2c4 --- /dev/null +++ b/website/content/api/stocks/disc/pipo/_index.md @@ -0,0 +1,13 @@ +# stocks.disc.pipo + +## Get underlying data +###stocks.disc.pipo(num_days_behind: int = 5, start_date: Optional[str] = None) + +Past IPOs dates. [Source: Finnhub] + + Parameters + ---------- + num_days_behind: int + Number of days to look behind for IPOs dates + start_date: str + The starting date (format YYYY-MM-DD) to look for IPOs diff --git a/website/content/api/stocks/disc/rtat/_index.md b/website/content/api/stocks/disc/rtat/_index.md new file mode 100644 index 000000000000..08a5a87e28c0 --- /dev/null +++ b/website/content/api/stocks/disc/rtat/_index.md @@ -0,0 +1,11 @@ +# stocks.disc.rtat + +## Get underlying data +###stocks.disc.rtat() -> pandas.core.frame.DataFrame + +Gets the top 10 retail stocks per day + + Returns + ------- + pd.DataFrame + Dataframe of tickers diff --git a/website/content/api/stocks/disc/trending/_index.md b/website/content/api/stocks/disc/trending/_index.md new file mode 100644 index 000000000000..095631336856 --- /dev/null +++ b/website/content/api/stocks/disc/trending/_index.md @@ -0,0 +1,16 @@ +# stocks.disc.trending + +## Get underlying data +###stocks.disc.trending(limit: int = 5) -> list + +Returns a list of trending articles + + Parameters + ---------- + limit: int + Number of articles + + Returns + ------- + list + Trending articles list diff --git a/website/content/api/stocks/disc/ugs/_index.md b/website/content/api/stocks/disc/ugs/_index.md new file mode 100644 index 000000000000..e0d0de78b17c --- /dev/null +++ b/website/content/api/stocks/disc/ugs/_index.md @@ -0,0 +1,12 @@ +# stocks.disc.ugs + +## Get underlying data +###stocks.disc.ugs() -> pandas.core.frame.DataFrame + +Get stocks with earnings growth rates better than 25% and relatively low PE and PEG ratios. + [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Undervalued stocks diff --git a/website/content/api/stocks/disc/ulc/_index.md b/website/content/api/stocks/disc/ulc/_index.md new file mode 100644 index 000000000000..26e31cf434c3 --- /dev/null +++ b/website/content/api/stocks/disc/ulc/_index.md @@ -0,0 +1,12 @@ +# stocks.disc.ulc + +## Get underlying data +###stocks.disc.ulc() -> pandas.core.frame.DataFrame + +Get Yahoo Finance potentially undervalued large cap stocks. + [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Most undervalued large cap stocks diff --git a/website/content/api/stocks/disc/upcoming/_index.md b/website/content/api/stocks/disc/upcoming/_index.md new file mode 100644 index 000000000000..b05137e5d6f6 --- /dev/null +++ b/website/content/api/stocks/disc/upcoming/_index.md @@ -0,0 +1,16 @@ +# stocks.disc.upcoming + +## Get underlying data +###stocks.disc.upcoming(limit: int = 10) -> pandas.core.frame.DataFrame + +Returns a DataFrame with upcoming earnings + + Parameters + ---------- + limit : int + Number of pages + + Returns + ------- + DataFrame + Upcoming earnings DataFrame diff --git a/website/content/api/stocks/dps/ctb/_index.md b/website/content/api/stocks/dps/ctb/_index.md new file mode 100644 index 000000000000..3ac0944bfbec --- /dev/null +++ b/website/content/api/stocks/dps/ctb/_index.md @@ -0,0 +1,11 @@ +# stocks.dps.ctb + +## Get underlying data +###stocks.dps.ctb() -> pandas.core.frame.DataFrame + +Get stocks with highest cost to borrow [Source: Interactive Broker] + + Returns + ------- + pd.DataFrame + Cost to borrow diff --git a/website/content/api/stocks/dps/dpotc/_index.md b/website/content/api/stocks/dps/dpotc/_index.md new file mode 100644 index 000000000000..0f076959327d --- /dev/null +++ b/website/content/api/stocks/dps/dpotc/_index.md @@ -0,0 +1,34 @@ +# stocks.dps.dpotc + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.dpotc(symbol: str) -> Tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame] + +Get all FINRA data associated with a ticker + + Parameters + ---------- + symbol : str + Stock ticker to get data from + + Returns + ------- + pd.DataFrame + Dark Pools (ATS) Data + pd.DataFrame + OTC (Non-ATS) Data + +## Getting charts +###stocks.dps.dpotc(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display barchart of dark pool (ATS) and OTC (Non ATS) data. [Source: FINRA] + + Parameters + ---------- + symbol : str + Stock ticker + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/stocks/dps/ftd/_index.md b/website/content/api/stocks/dps/ftd/_index.md new file mode 100644 index 000000000000..f0859bde5fce --- /dev/null +++ b/website/content/api/stocks/dps/ftd/_index.md @@ -0,0 +1,49 @@ +# stocks.dps.ftd + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.ftd(symbol: str, start_date: str = '2022-07-22', end_date: str = '2022-09-20', limit: int = 0) -> pandas.core.frame.DataFrame + +Display fails-to-deliver data for a given ticker. [Source: SEC] + + Parameters + ---------- + symbol : str + Stock ticker + start_date : str + Start of data, in YYYY-MM-DD format + end_date : str + End of data, in YYYY-MM-DD format + limit : int + Number of latest fails-to-deliver being printed + + Returns + ---------- + pd.DataFrame + Fail to deliver data + +## Getting charts +###stocks.dps.ftd(symbol: str, data: pandas.core.frame.DataFrame, start_date: str = '2022-07-22', end_date: str = '2022-09-20', limit: int = 0, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display fails-to-deliver data for a given ticker. [Source: SEC] + + Parameters + ---------- + symbol: str + Stock ticker + data: pd.DataFrame + Stock data + start_date: str + Start of data, in YYYY-MM-DD format + end_date: str + End of data, in YYYY-MM-DD format + limit : int + Number of latest fails-to-deliver being printed + raw: bool + Print raw data + export: str + Export dataframe data to csv,json,xlsx file + external_axes: Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + diff --git a/website/content/api/stocks/dps/hsi/_index.md b/website/content/api/stocks/dps/hsi/_index.md new file mode 100644 index 000000000000..9e34aff566b8 --- /dev/null +++ b/website/content/api/stocks/dps/hsi/_index.md @@ -0,0 +1,12 @@ +# stocks.dps.hsi + +## Get underlying data +###stocks.dps.hsi() -> pandas.core.frame.DataFrame + +Returns a high short interest DataFrame + + Returns + ------- + DataFrame + High short interest Dataframe with the following columns: + Ticker, Company, Exchange, ShortInt, Float, Outstd, Industry diff --git a/website/content/api/stocks/dps/pos/_index.md b/website/content/api/stocks/dps/pos/_index.md new file mode 100644 index 000000000000..e8b887323439 --- /dev/null +++ b/website/content/api/stocks/dps/pos/_index.md @@ -0,0 +1,21 @@ +# stocks.dps.pos + +## Get underlying data +###stocks.dps.pos(sortby: str = 'dpp_dollar', ascend: bool = False) -> pandas.core.frame.DataFrame + +Get dark pool short positions. [Source: Stockgrid] + + Parameters + ---------- + sortby : str + Field for which to sort by, where 'sv': Short Vol. [1M], + 'sv_pct': Short Vol. %%, 'nsv': Net Short Vol. [1M], + 'nsv_dollar': Net Short Vol. ($100M), 'dpp': DP Position [1M], + 'dpp_dollar': DP Position ($1B) + ascend : bool + Data in ascending order + + Returns + ---------- + pd.DataFrame + Dark pool short position data diff --git a/website/content/api/stocks/dps/prom/_index.md b/website/content/api/stocks/dps/prom/_index.md new file mode 100644 index 000000000000..7db63cf3a78f --- /dev/null +++ b/website/content/api/stocks/dps/prom/_index.md @@ -0,0 +1,42 @@ +# stocks.dps.prom + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.prom(limit: int = 1000, tier_ats: str = 'T1') -> Tuple[pandas.core.frame.DataFrame, Dict] + +Get all FINRA ATS data, and parse most promising tickers based on linear regression + + Parameters + ---------- + limit: int + Number of tickers to filter from entire ATS data based on the sum of the total weekly shares quantity + tier_ats : int + Tier to process data from: T1, T2 or OTCE + + Returns + ------- + pd.DataFrame + Dark Pools (ATS) Data + Dict + Tickers from Dark Pools with better regression slope + +## Getting charts +###stocks.dps.prom(num: int = 1000, limit: int = 10, tier: str = 'T1', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display dark pool (ATS) data of tickers with growing trades activity. [Source: FINRA] + + Parameters + ---------- + num : int + Number of tickers to filter from entire ATS data based on + the sum of the total weekly shares quantity + limit : int + Number of tickers to display from most promising with + better linear regression slope + tier : str + Tier to process data from: T1, T2 or OTCE + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/dps/psi_q/_index.md b/website/content/api/stocks/dps/psi_q/_index.md new file mode 100644 index 000000000000..2dd6c2124692 --- /dev/null +++ b/website/content/api/stocks/dps/psi_q/_index.md @@ -0,0 +1,44 @@ +# stocks.dps.psi_q + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.psi_q(symbol: str, nyse: bool = False) -> pandas.core.frame.DataFrame + +Plots the short interest of a stock. This corresponds to the + number of shares that have been sold short but have not yet been + covered or closed out. Either NASDAQ or NYSE [Source: Quandl] + + Parameters + ---------- + symbol : str + ticker to get short interest from + nyse : bool + data from NYSE if true, otherwise NASDAQ + + Returns + ---------- + pd.DataFrame + short interest volume data + +## Getting charts +###stocks.dps.psi_q(symbol: str, nyse: bool = False, limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plots the short interest of a stock. This corresponds to the + number of shares that have been sold short but have not yet been + covered or closed out. Either NASDAQ or NYSE [Source: Quandl] + + Parameters + ---------- + symbol : str + ticker to get short interest from + nyse : bool + data from NYSE if true, otherwise NASDAQ + limit: int + Number of past days to show short interest + raw : bool + Flag to print raw data instead + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None diff --git a/website/content/api/stocks/dps/psi_sg/_index.md b/website/content/api/stocks/dps/psi_sg/_index.md new file mode 100644 index 000000000000..9327696dd751 --- /dev/null +++ b/website/content/api/stocks/dps/psi_sg/_index.md @@ -0,0 +1,39 @@ +# stocks.dps.psi_sg + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.psi_sg(symbol: str) -> Tuple[pandas.core.frame.DataFrame, List] + +Get price vs short interest volume. [Source: Stockgrid] + + Parameters + ---------- + symbol : str + Stock to get data from + + Returns + ---------- + pd.DataFrame + Short interest volume data + List + Price data + +## Getting charts +###stocks.dps.psi_sg(symbol: str, limit: int = 84, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot price vs short interest volume. [Source: Stockgrid] + + Parameters + ---------- + symbol : str + Stock to plot for + limit : int + Number of last open market days to show + raw : bool + Flag to print raw data instead + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (3 axes are expected in the list), by default None + diff --git a/website/content/api/stocks/dps/shorted/_index.md b/website/content/api/stocks/dps/shorted/_index.md new file mode 100644 index 000000000000..f0b1f3c307ef --- /dev/null +++ b/website/content/api/stocks/dps/shorted/_index.md @@ -0,0 +1,11 @@ +# stocks.dps.shorted + +## Get underlying data +###stocks.dps.shorted() -> pandas.core.frame.DataFrame + +Get most shorted stock screener [Source: Yahoo Finance] + + Returns + ------- + pd.DataFrame + Most Shorted Stocks diff --git a/website/content/api/stocks/dps/sidtc/_index.md b/website/content/api/stocks/dps/sidtc/_index.md new file mode 100644 index 000000000000..89698b9127b2 --- /dev/null +++ b/website/content/api/stocks/dps/sidtc/_index.md @@ -0,0 +1,17 @@ +# stocks.dps.sidtc + +## Get underlying data +###stocks.dps.sidtc(sortby: str = 'float') -> pandas.core.frame.DataFrame + +Get short interest and days to cover. [Source: Stockgrid] + + Parameters + ---------- + sortby : str + Field for which to sort by, where 'float': Float Short %%, + 'dtc': Days to Cover, 'si': Short Interest + + Returns + ---------- + pd.DataFrame + Short interest and days to cover data diff --git a/website/content/api/stocks/dps/spos/_index.md b/website/content/api/stocks/dps/spos/_index.md new file mode 100644 index 000000000000..f0c0c1212ea8 --- /dev/null +++ b/website/content/api/stocks/dps/spos/_index.md @@ -0,0 +1,37 @@ +# stocks.dps.spos + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.spos(symbol: str) -> pandas.core.frame.DataFrame + +Get net short position. [Source: Stockgrid] + + Parameters + ---------- + symbol: str + Stock to get data from + + Returns + ---------- + pd.DataFrame + Net short position + +## Getting charts +###stocks.dps.spos(symbol: str, limit: int = 84, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot net short position. [Source: Stockgrid] + + Parameters + ---------- + symbol: str + Stock to plot for + limit : int + Number of last open market days to show + raw : bool + Flag to print raw data instead + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (2 axes are expected in the list), by default None + diff --git a/website/content/api/stocks/dps/volexch/_index.md b/website/content/api/stocks/dps/volexch/_index.md new file mode 100644 index 000000000000..beceaf5103dc --- /dev/null +++ b/website/content/api/stocks/dps/volexch/_index.md @@ -0,0 +1,41 @@ +# stocks.dps.volexch + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.dps.volexch(symbol: str) -> pandas.core.frame.DataFrame + +Gets short data for 5 exchanges [https://ftp.nyse.com] starting at 1/1/2021 + + Parameters + ---------- + symbol : str + Ticker to get data for + + Returns + ------- + pd.DataFrame + DataFrame of short data by exchange + +## Getting charts +###stocks.dps.volexch(symbol: str, raw: bool = False, sortby: str = '', ascend: bool = False, mpl: bool = True, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display short data by exchange + + Parameters + ---------- + symbol : str + Stock ticker + raw : bool + Flag to display raw data + sortby: str + Column to sort by + ascend: bool + Sort in ascending order + mpl: bool + Display using matplotlib + export : str, optional + Format of export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/stocks/fa/analysis/_index.md b/website/content/api/stocks/fa/analysis/_index.md new file mode 100644 index 000000000000..42b2187acb11 --- /dev/null +++ b/website/content/api/stocks/fa/analysis/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.analysis + +## Get underlying data +###stocks.fa.analysis(symbol: str) -> str + +Save time reading SEC filings with the help of machine learning. [Source: https://eclect.us] + + Parameters + ---------- + symbol: str + Ticker symbol to see analysis of filings + + Returns + ------- + str + Analysis of filings text diff --git a/website/content/api/stocks/fa/av_balance/_index.md b/website/content/api/stocks/fa/av_balance/_index.md new file mode 100644 index 000000000000..09bac26f1bf0 --- /dev/null +++ b/website/content/api/stocks/fa/av_balance/_index.md @@ -0,0 +1,24 @@ +# stocks.fa.av_balance + +## Get underlying data +###stocks.fa.av_balance(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get balance sheets for company + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number of past to get + quarterly : bool, optional + Flag to get quarterly instead of annual, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + DataFrame of the balance sheet diff --git a/website/content/api/stocks/fa/av_cash/_index.md b/website/content/api/stocks/fa/av_cash/_index.md new file mode 100644 index 000000000000..8e9f1e5bcfa4 --- /dev/null +++ b/website/content/api/stocks/fa/av_cash/_index.md @@ -0,0 +1,46 @@ +# stocks.fa.av_cash + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.fa.av_cash(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get cash flows for company + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number of past to get + quarterly : bool, optional + Flag to get quarterly instead of annual, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + Dataframe of cash flow statements + +## Getting charts +###stocks.fa.av_cash(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: list = None, export: str = '', chart=True) + +Alpha Vantage income statement + + Parameters + ---------- + symbol : str + Fundamental analysis ticker symbol + limit: int + Number of past statements, by default 5 + quarterly: bool + Flag to get quarterly instead of annual, by default False + ratios: bool + Shows percentage change, by default False + plot: list + List of row labels to plot + export: str + Format to export data diff --git a/website/content/api/stocks/fa/av_income/_index.md b/website/content/api/stocks/fa/av_income/_index.md new file mode 100644 index 000000000000..da25739bfed1 --- /dev/null +++ b/website/content/api/stocks/fa/av_income/_index.md @@ -0,0 +1,24 @@ +# stocks.fa.av_income + +## Get underlying data +###stocks.fa.av_income(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get income statements for company + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number of past to get + quarterly : bool, optional + Flag to get quarterly instead of annual, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + DataFrame of income statements diff --git a/website/content/api/stocks/fa/av_metrics/_index.md b/website/content/api/stocks/fa/av_metrics/_index.md new file mode 100644 index 000000000000..657da221dbd3 --- /dev/null +++ b/website/content/api/stocks/fa/av_metrics/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.av_metrics + +## Get underlying data +###stocks.fa.av_metrics(symbol: str) -> pandas.core.frame.DataFrame + +Get key metrics from overview + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of key metrics diff --git a/website/content/api/stocks/fa/av_overview/_index.md b/website/content/api/stocks/fa/av_overview/_index.md new file mode 100644 index 000000000000..242687a6544c --- /dev/null +++ b/website/content/api/stocks/fa/av_overview/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.av_overview + +## Get underlying data +###stocks.fa.av_overview(symbol: str) -> pandas.core.frame.DataFrame + +Get alpha vantage company overview + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of fundamentals diff --git a/website/content/api/stocks/fa/cal/_index.md b/website/content/api/stocks/fa/cal/_index.md new file mode 100644 index 000000000000..72844c02a4f7 --- /dev/null +++ b/website/content/api/stocks/fa/cal/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.cal + +## Get underlying data +###stocks.fa.cal(symbol: str) -> pandas.core.frame.DataFrame + +Get calendar earnings for ticker symbol + + Parameters + ---------- + symbol: str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of calendar earnings diff --git a/website/content/api/stocks/fa/data/_index.md b/website/content/api/stocks/fa/data/_index.md new file mode 100644 index 000000000000..ee651d01a594 --- /dev/null +++ b/website/content/api/stocks/fa/data/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.data + +## Get underlying data +###stocks.fa.data(symbol: str) -> pandas.core.frame.DataFrame + +Get fundamental data from finviz + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + DataFrame of fundamental data diff --git a/website/content/api/stocks/fa/dcf/_index.md b/website/content/api/stocks/fa/dcf/_index.md new file mode 100644 index 000000000000..232b20f381e8 --- /dev/null +++ b/website/content/api/stocks/fa/dcf/_index.md @@ -0,0 +1,20 @@ +# stocks.fa.dcf + +## Get underlying data +###stocks.fa.dcf(symbol: str, limit: int = 5, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Get stocks dcf from FMP + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + + Returns + ------- + pd.DataFrame + Dataframe of dcf data diff --git a/website/content/api/stocks/fa/divs/_index.md b/website/content/api/stocks/fa/divs/_index.md new file mode 100644 index 000000000000..54d61d898bd4 --- /dev/null +++ b/website/content/api/stocks/fa/divs/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.divs + +## Get underlying data +###stocks.fa.divs(symbol: str) -> pandas.core.frame.DataFrame + +Get historical dividend for ticker + + Parameters + ---------- + symbol: str + Ticker symbol to get dividend for + + Returns + ------- + pd.DataFrame: + Dataframe of dividends and dates diff --git a/website/content/api/stocks/fa/dupont/_index.md b/website/content/api/stocks/fa/dupont/_index.md new file mode 100644 index 000000000000..d2094b1b3e84 --- /dev/null +++ b/website/content/api/stocks/fa/dupont/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.dupont + +## Get underlying data +###stocks.fa.dupont(symbol: str) -> pandas.core.frame.DataFrame + +Get dupont ratios + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + dupont : pd.DataFrame + The dupont ratio breakdown diff --git a/website/content/api/stocks/fa/earnings/_index.md b/website/content/api/stocks/fa/earnings/_index.md new file mode 100644 index 000000000000..c36c84e75755 --- /dev/null +++ b/website/content/api/stocks/fa/earnings/_index.md @@ -0,0 +1,18 @@ +# stocks.fa.earnings + +## Get underlying data +###stocks.fa.earnings(symbol: str, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Get earnings calendar for ticker + + Parameters + ---------- + symbol : str + Stock ticker symbol + quarterly : bool, optional + Flag to get quarterly and not annual, by default False + + Returns + ------- + pd.DataFrame + Dataframe of earnings diff --git a/website/content/api/stocks/fa/enterprise/_index.md b/website/content/api/stocks/fa/enterprise/_index.md new file mode 100644 index 000000000000..801466a0b4e5 --- /dev/null +++ b/website/content/api/stocks/fa/enterprise/_index.md @@ -0,0 +1,20 @@ +# stocks.fa.enterprise + +## Get underlying data +###stocks.fa.enterprise(symbol: str, limit: int = 5, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Financial Modeling Prep ticker enterprise + + Parameters + ---------- + symbol : str + Fundamental analysis ticker symbol + limit: int + Number to get + quarterly: bool + Flag to get quarterly data + + Returns + ---------- + pd.DataFrame: + Dataframe of enterprise information diff --git a/website/content/api/stocks/fa/fama_coe/_index.md b/website/content/api/stocks/fa/fama_coe/_index.md new file mode 100644 index 000000000000..df355489bada --- /dev/null +++ b/website/content/api/stocks/fa/fama_coe/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.fama_coe + +## Get underlying data +###stocks.fa.fama_coe(symbol: str) -> float + +Use Fama and French to get the cost of equity for a company + + Parameters + ---------- + symbol : str + The ticker symbol to be analyzed + + Returns + ------- + coef : float + The stock's Fama French coefficient diff --git a/website/content/api/stocks/fa/fama_raw/_index.md b/website/content/api/stocks/fa/fama_raw/_index.md new file mode 100644 index 000000000000..0e93dc2dc4cb --- /dev/null +++ b/website/content/api/stocks/fa/fama_raw/_index.md @@ -0,0 +1,11 @@ +# stocks.fa.fama_raw + +## Get underlying data +###stocks.fa.fama_raw() -> pandas.core.frame.DataFrame + +Get Fama French data + + Returns + ------- + df : pd.DataFrame + Fama French data diff --git a/website/content/api/stocks/fa/fmp_balance/_index.md b/website/content/api/stocks/fa/fmp_balance/_index.md new file mode 100644 index 000000000000..2c71ac6debbc --- /dev/null +++ b/website/content/api/stocks/fa/fmp_balance/_index.md @@ -0,0 +1,24 @@ +# stocks.fa.fmp_balance + +## Get underlying data +###stocks.fa.fmp_balance(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get balance sheets + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + Dataframe of balance sheet diff --git a/website/content/api/stocks/fa/fmp_cash/_index.md b/website/content/api/stocks/fa/fmp_cash/_index.md new file mode 100644 index 000000000000..2b7b70b26adf --- /dev/null +++ b/website/content/api/stocks/fa/fmp_cash/_index.md @@ -0,0 +1,24 @@ +# stocks.fa.fmp_cash + +## Get underlying data +###stocks.fa.fmp_cash(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get cash flow + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + Dataframe of company cash flow diff --git a/website/content/api/stocks/fa/fmp_income/_index.md b/website/content/api/stocks/fa/fmp_income/_index.md new file mode 100644 index 000000000000..aa284e6cfdeb --- /dev/null +++ b/website/content/api/stocks/fa/fmp_income/_index.md @@ -0,0 +1,24 @@ +# stocks.fa.fmp_income + +## Get underlying data +###stocks.fa.fmp_income(symbol: str, limit: int = 5, quarterly: bool = False, ratios: bool = False, plot: bool = False) -> pandas.core.frame.DataFrame + +Get income statements + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + ratios: bool + Shows percentage change, by default False + plot: bool + If the data shall be formatted ready to plot + + Returns + ------- + pd.DataFrame + Dataframe of the income statements diff --git a/website/content/api/stocks/fa/fmp_metrics/_index.md b/website/content/api/stocks/fa/fmp_metrics/_index.md new file mode 100644 index 000000000000..71cb7af2f2ca --- /dev/null +++ b/website/content/api/stocks/fa/fmp_metrics/_index.md @@ -0,0 +1,20 @@ +# stocks.fa.fmp_metrics + +## Get underlying data +###stocks.fa.fmp_metrics(symbol: str, limit: int = 5, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Get key metrics + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + + Returns + ------- + pd.DataFrame + Dataframe of key metrics diff --git a/website/content/api/stocks/fa/fmp_ratios/_index.md b/website/content/api/stocks/fa/fmp_ratios/_index.md new file mode 100644 index 000000000000..c9237231e69b --- /dev/null +++ b/website/content/api/stocks/fa/fmp_ratios/_index.md @@ -0,0 +1,20 @@ +# stocks.fa.fmp_ratios + +## Get underlying data +###stocks.fa.fmp_ratios(symbol: str, limit: int = 5, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Get key ratios + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + + Returns + ------- + pd.DataFrame + Dataframe of key ratios diff --git a/website/content/api/stocks/fa/fraud/_index.md b/website/content/api/stocks/fa/fraud/_index.md new file mode 100644 index 000000000000..4f35e73d5812 --- /dev/null +++ b/website/content/api/stocks/fa/fraud/_index.md @@ -0,0 +1,18 @@ +# stocks.fa.fraud + +## Get underlying data +###stocks.fa.fraud(symbol: str, detail: bool = False) -> pandas.core.frame.DataFrame + +Get fraud ratios based on fundamentals + + Parameters + ---------- + symbol : str + Stock ticker symbol + detail : bool + Whether to provide extra m-score details + + Returns + ------- + metrics : pd.DataFrame + The fraud ratios diff --git a/website/content/api/stocks/fa/growth/_index.md b/website/content/api/stocks/fa/growth/_index.md new file mode 100644 index 000000000000..1e623cc08517 --- /dev/null +++ b/website/content/api/stocks/fa/growth/_index.md @@ -0,0 +1,20 @@ +# stocks.fa.growth + +## Get underlying data +###stocks.fa.growth(symbol: str, limit: int = 5, quarterly: bool = False) -> pandas.core.frame.DataFrame + +Get financial statement growth + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number to get + quarterly : bool, optional + Flag to get quarterly data, by default False + + Returns + ------- + pd.DataFrame + Dataframe of financial statement growth diff --git a/website/content/api/stocks/fa/historical_5/_index.md b/website/content/api/stocks/fa/historical_5/_index.md new file mode 100644 index 000000000000..048e14904ead --- /dev/null +++ b/website/content/api/stocks/fa/historical_5/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.historical_5 + +## Get underlying data +###stocks.fa.historical_5(symbol: str) -> pandas.core.frame.DataFrame + +Get 5 year monthly historical performance for a ticker with dividends filtered + + Parameters + ---------- + symbol: str + The ticker symbol to be analyzed + + Returns + ------- + df: pd.DataFrame + Historical data diff --git a/website/content/api/stocks/fa/hq/_index.md b/website/content/api/stocks/fa/hq/_index.md new file mode 100644 index 000000000000..0558148b2bbc --- /dev/null +++ b/website/content/api/stocks/fa/hq/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.hq + +## Get underlying data +###stocks.fa.hq(symbol: str) -> str + +Gets google map url for headquarter + + Parameters + ---------- + symbol: str + Stock ticker symbol + + Returns + ------- + str + Headquarter google maps url diff --git a/website/content/api/stocks/fa/info/_index.md b/website/content/api/stocks/fa/info/_index.md new file mode 100644 index 000000000000..b770910923bf --- /dev/null +++ b/website/content/api/stocks/fa/info/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.info + +## Get underlying data +###stocks.fa.info(symbol: str) -> pandas.core.frame.DataFrame + +Gets ticker symbol info + + Parameters + ---------- + symbol: str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + DataFrame of yfinance information diff --git a/website/content/api/stocks/fa/mgmt/_index.md b/website/content/api/stocks/fa/mgmt/_index.md new file mode 100644 index 000000000000..9c5ae5865c4f --- /dev/null +++ b/website/content/api/stocks/fa/mgmt/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.mgmt + +## Get underlying data +###stocks.fa.mgmt(symbol: str) -> pandas.core.frame.DataFrame + +Get company managers from Business Insider + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of managers diff --git a/website/content/api/stocks/fa/mktcap/_index.md b/website/content/api/stocks/fa/mktcap/_index.md new file mode 100644 index 000000000000..e132e8476e42 --- /dev/null +++ b/website/content/api/stocks/fa/mktcap/_index.md @@ -0,0 +1,38 @@ +# stocks.fa.mktcap + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.fa.mktcap(symbol: str, start_date: str = '2019-09-18') -> Tuple[pandas.core.frame.DataFrame, str] + +Get market cap over time for ticker. [Source: Yahoo Finance] + + Parameters + ---------- + symbol: str + Ticker to get market cap over time + start_date: str + Start date to display market cap + + Returns + ------- + pd.DataFrame: + Dataframe of estimated market cap over time + str: + Currency of ticker + +## Getting charts +###stocks.fa.mktcap(symbol: str, start_date: str = '2019-09-18', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display market cap over time. [Source: Yahoo Finance] + + Parameters + ---------- + symbol: str + Stock ticker symbol + start_date: str + Start date to display market cap + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/fa/poly_financials/_index.md b/website/content/api/stocks/fa/poly_financials/_index.md new file mode 100644 index 000000000000..b862dfbd10a7 --- /dev/null +++ b/website/content/api/stocks/fa/poly_financials/_index.md @@ -0,0 +1,46 @@ +# stocks.fa.poly_financials + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.fa.poly_financials(symbol: str, statement: str, quarterly: bool = False, ratios: bool = False) -> pandas.core.frame.DataFrame + +Get ticker financial statements from polygon + + Parameters + ---------- + symbol: str + Stock ticker symbol + statement: str + Financial statement data to retrieve, can be balance, income or cash + quarterly:bool + Flag to get quarterly reports, by default False + ratios: bool + Shows percentage change, by default False + + Returns + ------- + pd.DataFrame + Balance Sheets or Income Statements + +## Getting charts +###stocks.fa.poly_financials(symbol: str, statement: str, limit: int = 10, quarterly: bool = False, ratios: bool = False, plot: list = None, export: str = '', chart=True) + +Display tickers balance sheet or income statement + + Parameters + ---------- + symbol: str + Stock ticker symbol + statement:str + Either balance or income + limit: int + Number of results to show, by default 10 + quarterly: bool + Flag to get quarterly reports, by default False + ratios: bool + Shows percentage change, by default False + plot: list + List of row labels to plot + export: str + Format to export data diff --git a/website/content/api/stocks/fa/profile/_index.md b/website/content/api/stocks/fa/profile/_index.md new file mode 100644 index 000000000000..dddd85f6d47a --- /dev/null +++ b/website/content/api/stocks/fa/profile/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.profile + +## Get underlying data +###stocks.fa.profile(symbol: str) -> pandas.core.frame.DataFrame + +Get ticker profile from FMP + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ---------- + pd.DataFrame: + Dataframe of ticker profile diff --git a/website/content/api/stocks/fa/quote/_index.md b/website/content/api/stocks/fa/quote/_index.md new file mode 100644 index 000000000000..3d62545ff05f --- /dev/null +++ b/website/content/api/stocks/fa/quote/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.quote + +## Get underlying data +###stocks.fa.quote(symbol: str) -> pandas.core.frame.DataFrame + +Gets ticker quote from FMP + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ---------- + pd.DataFrame: + Dataframe of ticker quote diff --git a/website/content/api/stocks/fa/score/_index.md b/website/content/api/stocks/fa/score/_index.md new file mode 100644 index 000000000000..7c28c2aa0bbb --- /dev/null +++ b/website/content/api/stocks/fa/score/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.score + +## Get underlying data +###stocks.fa.score(symbol: str) -> Optional[numpy.number] + +Gets value score from fmp + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + np.number + Value score diff --git a/website/content/api/stocks/fa/shrs/_index.md b/website/content/api/stocks/fa/shrs/_index.md new file mode 100644 index 000000000000..9b9bc3f3f29a --- /dev/null +++ b/website/content/api/stocks/fa/shrs/_index.md @@ -0,0 +1,18 @@ +# stocks.fa.shrs + +## Get underlying data +###stocks.fa.shrs(symbol: str, holder: str = 'institutional') -> pandas.core.frame.DataFrame + +Get shareholders from yahoo + + Parameters + ---------- + symbol : str + Stock ticker symbol + holder : str + Which holder to get table for + + Returns + ------- + pd.DataFrame + Major holders diff --git a/website/content/api/stocks/fa/similar_dfs/_index.md b/website/content/api/stocks/fa/similar_dfs/_index.md new file mode 100644 index 000000000000..1a8ae2ad3c39 --- /dev/null +++ b/website/content/api/stocks/fa/similar_dfs/_index.md @@ -0,0 +1,23 @@ +# stocks.fa.similar_dfs + +## Get underlying data +###stocks.fa.similar_dfs(symbol: str, info: Dict[str, Any], n: int, no_filter: bool = False) + + + Get dataframes for similar companies + + Parameters + ---------- + symbol : str + The ticker symbol to create a dataframe for + into : Dict[str,Any] + The dictionary produced from the yfinance.info function + n : int + The number of similar companies to produce + no_filter : bool + True means that we do not filter based on market cap + + Returns + ------- + new_list : List[str, pd.DataFrame] + A list of similar companies diff --git a/website/content/api/stocks/fa/splits/_index.md b/website/content/api/stocks/fa/splits/_index.md new file mode 100644 index 000000000000..b99c24b43545 --- /dev/null +++ b/website/content/api/stocks/fa/splits/_index.md @@ -0,0 +1,32 @@ +# stocks.fa.splits + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.fa.splits(symbol: str) -> pandas.core.frame.DataFrame + +Get splits and reverse splits events. [Source: Yahoo Finance] + + Parameters + ---------- + symbol: str + Ticker to get forward and reverse splits + + Returns + ------- + pd.DataFrame: + Dataframe of forward and reverse splits + +## Getting charts +###stocks.fa.splits(symbol: str, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display splits and reverse splits events. [Source: Yahoo Finance] + + Parameters + ---------- + symbol: str + Stock ticker symbol + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/fa/sust/_index.md b/website/content/api/stocks/fa/sust/_index.md new file mode 100644 index 000000000000..1995af84c0a4 --- /dev/null +++ b/website/content/api/stocks/fa/sust/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.sust + +## Get underlying data +###stocks.fa.sust(symbol: str) -> pandas.core.frame.DataFrame + +Get sustainability metrics from yahoo + + Parameters + ---------- + symbol : str + Stock ticker symbol + + Returns + ------- + pd.DataFrame + Dataframe of sustainability metrics diff --git a/website/content/api/stocks/fa/website/_index.md b/website/content/api/stocks/fa/website/_index.md new file mode 100644 index 000000000000..488cba386565 --- /dev/null +++ b/website/content/api/stocks/fa/website/_index.md @@ -0,0 +1,16 @@ +# stocks.fa.website + +## Get underlying data +###stocks.fa.website(symbol: str) -> str + +Gets website of company from yfinance + + Parameters + ---------- + symbol: str + Stock ticker symbol + + Returns + ------- + str + Company we diff --git a/website/content/api/stocks/fa/yf_financials/_index.md b/website/content/api/stocks/fa/yf_financials/_index.md new file mode 100644 index 000000000000..311c3bcb492d --- /dev/null +++ b/website/content/api/stocks/fa/yf_financials/_index.md @@ -0,0 +1,44 @@ +# stocks.fa.yf_financials + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.fa.yf_financials(symbol: str, statement: str, ratios: bool = False) -> pandas.core.frame.DataFrame + +Get cashflow statement for company + + Parameters + ---------- + symbol : str + Stock ticker symbol + statement: str + can be: + cash-flow + financials for Income + balance-sheet + ratios: bool + Shows percentage change + + Returns + ------- + pd.DataFrame + Dataframe of Financial statement + +## Getting charts +###stocks.fa.yf_financials(symbol: str, statement: str, limit: int = 12, ratios: bool = False, plot: list = None, export: str = '', chart=True) + +Display tickers balance sheet, income statement or cash-flow + + Parameters + ---------- + symbol: str + Stock ticker symbol + statement: str + Either balance or financials for income or cash-flow + limit: int + ratios: bool + Shows percentage change + plot: list + List of row labels to plot + export: str + Format to export data diff --git a/website/content/api/stocks/gov/contracts/_index.md b/website/content/api/stocks/gov/contracts/_index.md new file mode 100644 index 000000000000..96c6e2c2e0bf --- /dev/null +++ b/website/content/api/stocks/gov/contracts/_index.md @@ -0,0 +1,38 @@ +# stocks.gov.contracts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.contracts(symbol: str, past_transaction_days: int = 10) -> pandas.core.frame.DataFrame + +Get government contracts for ticker [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker to get congress trading data from + past_transaction_days: int + Number of days to get transactions for + + Returns + ------- + pd.DataFrame + Most recent transactions by members of U.S. Congress + +## Getting charts +###stocks.gov.contracts(symbol: str, past_transaction_days: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Show government contracts for ticker [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker to get congress trading data from + past_transaction_days: int + Number of days to get transactions for + raw: bool + Flag to display raw data + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/gov/government_trading/_index.md b/website/content/api/stocks/gov/government_trading/_index.md new file mode 100644 index 000000000000..8af1f886558f --- /dev/null +++ b/website/content/api/stocks/gov/government_trading/_index.md @@ -0,0 +1,19 @@ +# stocks.gov.government_trading + +## Get underlying data +###stocks.gov.government_trading(gov_type: str = 'congress', symbol: str = '') -> pandas.core.frame.DataFrame + +Returns the most recent transactions by members of government + + Parameters + ---------- + gov_type: str + Type of government data between: + 'congress', 'senate', 'house', 'contracts', 'quarter-contracts' and 'corporate-lobbying' + symbol : str + Ticker symbol to get congress trading data from + + Returns + ------- + pd.DataFrame + Most recent transactions by members of U.S. Congress diff --git a/website/content/api/stocks/gov/gtrades/_index.md b/website/content/api/stocks/gov/gtrades/_index.md new file mode 100644 index 000000000000..40afaaeff6e9 --- /dev/null +++ b/website/content/api/stocks/gov/gtrades/_index.md @@ -0,0 +1,42 @@ +# stocks.gov.gtrades + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.gtrades(symbol: str, gov_type: str = 'congress', past_transactions_months: int = 6) -> pandas.core.frame.DataFrame + +Government trading for specific ticker [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker symbol to get congress trading data from + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get transactions for + + Returns + ------- + pd.DataFrame + DataFrame of tickers government trading + +## Getting charts +###stocks.gov.gtrades(symbol: str, gov_type: str = 'congress', past_transactions_months: int = 6, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Government trading for specific ticker [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker symbol to get congress trading data from + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get transactions for + raw: bool + Show raw output of trades + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/gov/histcont/_index.md b/website/content/api/stocks/gov/histcont/_index.md new file mode 100644 index 000000000000..d8ea9f44dfb5 --- /dev/null +++ b/website/content/api/stocks/gov/histcont/_index.md @@ -0,0 +1,34 @@ +# stocks.gov.histcont + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.histcont(symbol: str) -> pandas.core.frame.DataFrame + +Get historical quarterly government contracts [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker symbol to get congress trading data from + + Returns + ------- + pd.DataFrame + Historical quarterly government contracts + +## Getting charts +###stocks.gov.histcont(symbol: str, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Show historical quarterly government contracts [Source: quiverquant.com] + + Parameters + ---------- + symbol: str + Ticker symbol to get congress trading data from + raw: bool + Flag to display raw data + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/gov/lastcontracts/_index.md b/website/content/api/stocks/gov/lastcontracts/_index.md new file mode 100644 index 000000000000..a58e1fb4b437 --- /dev/null +++ b/website/content/api/stocks/gov/lastcontracts/_index.md @@ -0,0 +1,36 @@ +# stocks.gov.lastcontracts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.lastcontracts(past_transaction_days: int = 2) -> pandas.core.frame.DataFrame + +Get last government contracts [Source: quiverquant.com] + + Parameters + ---------- + past_transaction_days: int + Number of days to look back + + Returns + ------- + pd.DataFrame + DataFrame of government contracts + +## Getting charts +###stocks.gov.lastcontracts(past_transaction_days: int = 2, limit: int = 20, sum_contracts: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Last government contracts [Source: quiverquant.com] + + Parameters + ---------- + past_transaction_days: int + Number of days to look back + limit: int + Number of contracts to show + sum_contracts: bool + Flag to show total amount of contracts given out. + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/gov/lasttrades/_index.md b/website/content/api/stocks/gov/lasttrades/_index.md new file mode 100644 index 000000000000..09eb83a4f9ad --- /dev/null +++ b/website/content/api/stocks/gov/lasttrades/_index.md @@ -0,0 +1,20 @@ +# stocks.gov.lasttrades + +## Get underlying data +###stocks.gov.lasttrades(gov_type: str = 'congress', limit: int = -1, representative: str = '') -> pandas.core.frame.DataFrame + +Get last government trading [Source: quiverquant.com] + + Parameters + ---------- + gov_type: str + Type of government data between: congress, senate and house + limit: int + Number of days to look back + representative: str + Specific representative to look at + + Returns + ------- + pd.DataFrame + Last government trading diff --git a/website/content/api/stocks/gov/lobbying/_index.md b/website/content/api/stocks/gov/lobbying/_index.md new file mode 100644 index 000000000000..eb10c920337a --- /dev/null +++ b/website/content/api/stocks/gov/lobbying/_index.md @@ -0,0 +1,18 @@ +# stocks.gov.lobbying + +## Get underlying data +###stocks.gov.lobbying(symbol: str, limit: int = 10) -> pandas.core.frame.DataFrame + +Corporate lobbying details + + Parameters + ---------- + symbol: str + Ticker symbol to get corporate lobbying data from + limit: int + Number of events to show + + Returns + ------- + pd.DataFrame + Dataframe with corporate lobbying data diff --git a/website/content/api/stocks/gov/qtrcontracts/_index.md b/website/content/api/stocks/gov/qtrcontracts/_index.md new file mode 100644 index 000000000000..2641382c0062 --- /dev/null +++ b/website/content/api/stocks/gov/qtrcontracts/_index.md @@ -0,0 +1,38 @@ +# stocks.gov.qtrcontracts + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.qtrcontracts(analysis: str = 'total', limit: int = 5) -> pandas.core.frame.DataFrame + +Analyzes quarterly contracts by ticker + + Parameters + ---------- + analysis : str + How to analyze. Either gives total amount or sorts by high/low momentum. + limit : int, optional + Number to return, by default 5 + + Returns + ------- + pd.DataFrame + Dataframe with tickers and total amount if total selected. + +## Getting charts +###stocks.gov.qtrcontracts(analysis: str = 'total', limit: int = 5, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Quarterly contracts [Source: quiverquant.com] + + Parameters + ---------- + analysis: str + Analysis to perform. Either 'total', 'upmom' 'downmom' + limit: int + Number to show + raw: bool + Flag to display raw data + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/gov/topbuys/_index.md b/website/content/api/stocks/gov/topbuys/_index.md new file mode 100644 index 000000000000..9926f27b0212 --- /dev/null +++ b/website/content/api/stocks/gov/topbuys/_index.md @@ -0,0 +1,41 @@ +# stocks.gov.topbuys + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.topbuys(gov_type: str = 'congress', past_transactions_months: int = 6) -> pandas.core.frame.DataFrame + +Get top buy government trading [Source: quiverquant.com] + + Parameters + ---------- + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get trading for + + Returns + ------- + pd.DataFrame + DataFrame of top government buy trading + +## Getting charts +###stocks.gov.topbuys(gov_type: str = 'congress', past_transactions_months: int = 6, limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Top buy government trading [Source: quiverquant.com] + + Parameters + ---------- + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get trading for + limit: int + Number of tickers to show + raw: bool + Display raw data + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/stocks/gov/toplobbying/_index.md b/website/content/api/stocks/gov/toplobbying/_index.md new file mode 100644 index 000000000000..4573e7eb3853 --- /dev/null +++ b/website/content/api/stocks/gov/toplobbying/_index.md @@ -0,0 +1,31 @@ +# stocks.gov.toplobbying + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.toplobbying() -> pandas.core.frame.DataFrame + +Corporate lobbying details + + Returns + ------- + pd.DataFrame + DataFrame of top corporate lobbying + + +## Getting charts +###stocks.gov.toplobbying(limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Top lobbying tickers based on total spent + + Parameters + ---------- + limit: int + Number of tickers to show + raw: bool + Show raw data + export: + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/stocks/gov/topsells/_index.md b/website/content/api/stocks/gov/topsells/_index.md new file mode 100644 index 000000000000..271d79c20b9e --- /dev/null +++ b/website/content/api/stocks/gov/topsells/_index.md @@ -0,0 +1,40 @@ +# stocks.gov.topsells + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.gov.topsells(gov_type: str = 'congress', past_transactions_months: int = 6) -> pandas.core.frame.DataFrame + +Get top sell government trading [Source: quiverquant.com] + + Parameters + ---------- + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get trading for + + Returns + ------- + pd.DataFrame + DataFrame of top government sell trading + +## Getting charts +###stocks.gov.topsells(gov_type: str = 'congress', past_transactions_months: int = 6, limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Top sell government trading [Source: quiverquant.com] + + Parameters + ---------- + gov_type: str + Type of government data between: congress, senate and house + past_transactions_months: int + Number of months to get trading for + limit: int + Number of tickers to show + raw: bool + Display raw data + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ins/act/_index.md b/website/content/api/stocks/ins/act/_index.md new file mode 100644 index 000000000000..3cc643830672 --- /dev/null +++ b/website/content/api/stocks/ins/act/_index.md @@ -0,0 +1,42 @@ +# stocks.ins.act + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ins.act(symbol: str) -> pandas.core.frame.DataFrame + +Get insider activity. [Source: Business Insider] + + Parameters + ---------- + symbol : str + Ticker symbol to get insider activity data from + + Returns + ------- + df_insider : pd.DataFrame + Get insider activity data + +## Getting charts +###stocks.ins.act(data: pandas.core.frame.DataFrame, symbol: str, start_date: str = '2019-09-16', interval: str = '1440min', limit: int = 10, raw: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display insider activity. [Source: Business Insider] + + Parameters + ---------- + data: pd.DataFrame + Stock dataframe + symbol: str + Due diligence ticker symbol + start_date: str + Start date of the stock data + interval: str + Stock data interval + limit: int + Number of latest days of inside activity + raw: bool + Print to console + export: str + Export dataframe data to csv,json,xlsx file + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/ins/lins/_index.md b/website/content/api/stocks/ins/lins/_index.md new file mode 100644 index 000000000000..3a52a733d296 --- /dev/null +++ b/website/content/api/stocks/ins/lins/_index.md @@ -0,0 +1,30 @@ +# stocks.ins.lins + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ins.lins(symbol: str) -> pandas.core.frame.DataFrame + +Get last insider activity for a given stock ticker. [Source: Finviz] + + Parameters + ---------- + symbol : str + Stock ticker symbol + + pd.DataFrame + Latest insider trading activity + +## Getting charts +###stocks.ins.lins(symbol: str, limit: int = 10, export: str = '', chart=True) + +Display insider activity for a given stock ticker. [Source: Finviz] + + Parameters + ---------- + symbol : str + Stock ticker symbol + limit : int + Number of latest insider activity to display + export : str + Export dataframe data to csv,json,xlsx file diff --git a/website/content/api/stocks/ins/print_insider_data/_index.md b/website/content/api/stocks/ins/print_insider_data/_index.md new file mode 100644 index 000000000000..a63601cff934 --- /dev/null +++ b/website/content/api/stocks/ins/print_insider_data/_index.md @@ -0,0 +1,29 @@ +# stocks.ins.print_insider_data + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ins.print_insider_data(type_insider: str = 'lcb', limit: int = 10) + +Print insider data + + Parameters + ---------- + type_insider: str + Insider type of data. Available types can be accessed through get_insider_types(). + limit: int + Limit of data rows to display + +## Getting charts +###stocks.ins.print_insider_data(type_insider: str = 'lcb', limit: int = 10, export: str = '', chart=True) + +Print insider data + + Parameters + ---------- + type_insider: str + Insider type of data. Available types can be accessed through get_insider_types(). + limit: int + Limit of data rows to display + export: str + Export data format diff --git a/website/content/api/stocks/load/_index.md b/website/content/api/stocks/load/_index.md new file mode 100644 index 000000000000..4aeae8991b79 --- /dev/null +++ b/website/content/api/stocks/load/_index.md @@ -0,0 +1,61 @@ +# stocks.load + +## Get underlying data +###stocks.load(symbol: str, start_date: datetime.datetime = datetime.datetime(2019, 9, 16, 18, 22, 32, 961016), interval: int = 1440, end_date: datetime.datetime = datetime.datetime(2022, 9, 20, 18, 22, 32, 961023), prepost: bool = False, source: str = 'YahooFinance', iexrange: str = 'ytd', weekly: bool = False, monthly: bool = False) + + + Load a symbol to perform analysis using the string above as a template. + + Optional arguments and their descriptions are listed above. + + The default source is, yFinance (https://pypi.org/project/yfinance/). + Other sources: + - AlphaVantage (https://www.alphavantage.co/documentation/) + - IEX Cloud (https://iexcloud.io/docs/api/) + - Eod Historical Data (https://eodhistoricaldata.com/financial-apis/) + + Please note that certain analytical features are exclusive to the specific source. + + To load a symbol from an exchange outside of the NYSE/NASDAQ default, use yFinance as the source and + add the corresponding exchange to the end of the symbol. i.e. ‘BNS.TO’. Note this may be possible with + other paid sources check their docs. + + BNS is a dual-listed stock, there are separate options chains and order books for each listing. + Opportunities for arbitrage may arise from momentary pricing discrepancies between listings + with a dynamic exchange rate as a second order opportunity in ForEx spreads. + + Find the full list of supported exchanges here: + https://help.yahoo.com/kb/exchanges-data-providers-yahoo-finance-sln2310.html + + Certain analytical features, such as VWAP, require the ticker to be loaded as intraday + using the ‘-i x’ argument. When encountering this error, simply reload the symbol using + the interval argument. i.e. ‘load -t BNS -s YYYY-MM-DD -i 1 -p’ loads one-minute intervals, + including Pre/After Market data, using the default source, yFinance. + + Certain features, such as the Prediction menu, require the symbol to be loaded as daily and not intraday. + + Parameters + ---------- + symbol: str + Ticker to get data + start_date: datetime + Start date to get data from with + interval: int + Interval (in minutes) to get data 1, 5, 15, 30, 60 or 1440 + end_date: datetime + End date to get data from with + prepost: bool + Pre and After hours data + source: str + Source of data extracted + iexrange: str + Timeframe to get IEX data. + weekly: bool + Flag to get weekly data + monthly: bool + Flag to get monthly data + + Returns + ------- + df_stock_candidate: pd.DataFrame + Dataframe of data diff --git a/website/content/api/stocks/options/chains/_index.md b/website/content/api/stocks/options/chains/_index.md new file mode 100644 index 000000000000..f09c25ec3507 --- /dev/null +++ b/website/content/api/stocks/options/chains/_index.md @@ -0,0 +1,44 @@ +# stocks.options.chains + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.chains(symbol: str, expiry: str) -> pandas.core.frame.DataFrame + +Display option chains [Source: Tradier]" + + Parameters + ---------- + symbol : str + Ticker to get options for + expiry : str + Expiration date in the form of "YYYY-MM-DD" + + Returns + ------- + chains: pd.DataFrame + Dataframe with options for the given Symbol and Expiration date + +## Getting charts +###stocks.options.chains(symbol: str, expiry: str, to_display: List[str] = None, min_sp: float = -1, max_sp: float = -1, calls_only: bool = False, puts_only: bool = False, export: str = '', chart=True) + +Display option chain + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiry: str + Expiration date of option + to_display: List[str] + List of columns to display + min_sp: float + Min strike price to display + max_sp: float + Max strike price to display + calls_only: bool + Only display calls + puts_only: bool + Only display puts + export: str + Format to export file diff --git a/website/content/api/stocks/options/chains_yf/_index.md b/website/content/api/stocks/options/chains_yf/_index.md new file mode 100644 index 000000000000..1b2e6376aea4 --- /dev/null +++ b/website/content/api/stocks/options/chains_yf/_index.md @@ -0,0 +1,47 @@ +# stocks.options.chains_yf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.chains_yf(symbol: str, expiration: str, min_sp: float = -1, max_sp: float = -1, calls: bool = True, puts: bool = True) -> pandas.core.frame.DataFrame + +Get full option chains with calculated greeks + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiration: str + Expiration date for chain in format YYY-mm-dd + calls: bool + Flag to get calls + puts: bool + Flag to get puts + + Returns + ------- + pd.DataFrame + DataFrame of option chain. If both calls and puts + +## Getting charts +###stocks.options.chains_yf(symbol: str, expiration: str, min_sp: float = -1, max_sp: float = -1, calls_only: bool = False, puts_only: bool = False, export: str = '', chart=True) + +Display option chains for given ticker and expiration + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiration: str + Expiration for option chain + min_sp: float + Min strike + max_sp: float + Max strike + calls_only: bool + Flag to get calls only + puts_only: bool + Flag to get puts only + export: str + Format to export data + diff --git a/website/content/api/stocks/options/closing/_index.md b/website/content/api/stocks/options/closing/_index.md new file mode 100644 index 000000000000..a7c4c74519ce --- /dev/null +++ b/website/content/api/stocks/options/closing/_index.md @@ -0,0 +1,16 @@ +# stocks.options.closing + +## Get underlying data +###stocks.options.closing(symbol: str) -> pandas.core.series.Series + +Get closing prices for a given ticker + + Parameters + ---------- + symbol : str + The ticker symbol to get the price for + + Returns + ---------- + price : List[float] + A list of closing prices for a ticker diff --git a/website/content/api/stocks/options/dividend/_index.md b/website/content/api/stocks/options/dividend/_index.md new file mode 100644 index 000000000000..f9e0fa3a6bb6 --- /dev/null +++ b/website/content/api/stocks/options/dividend/_index.md @@ -0,0 +1,16 @@ +# stocks.options.dividend + +## Get underlying data +###stocks.options.dividend(symbol: str) -> pandas.core.series.Series + +Gets option chain from yf for given ticker and expiration + + Parameters + ---------- + symbol: str + Ticker symbol to get options for + + Returns + ------- + chains: yf.ticker.Dividends + Dividends diff --git a/website/content/api/stocks/options/dte/_index.md b/website/content/api/stocks/options/dte/_index.md new file mode 100644 index 000000000000..7a8bc238ddb5 --- /dev/null +++ b/website/content/api/stocks/options/dte/_index.md @@ -0,0 +1,6 @@ +# stocks.options.dte + +## Get underlying data +###stocks.options.dte(date_value: str) -> int + +Gets days to expiration from yfinance option diff --git a/website/content/api/stocks/options/generate_data/_index.md b/website/content/api/stocks/options/generate_data/_index.md new file mode 100644 index 000000000000..bd3284400f87 --- /dev/null +++ b/website/content/api/stocks/options/generate_data/_index.md @@ -0,0 +1,6 @@ +# stocks.options.generate_data + +## Get underlying data +###stocks.options.generate_data(current_price: float, options: List[Dict[str, int]], underlying: int) -> Tuple[List[float], List[float], List[float]] + +Gets x values, and y values before and after pre diff --git a/website/content/api/stocks/options/grhist/_index.md b/website/content/api/stocks/options/grhist/_index.md new file mode 100644 index 000000000000..07d45d49cde7 --- /dev/null +++ b/website/content/api/stocks/options/grhist/_index.md @@ -0,0 +1,54 @@ +# stocks.options.grhist + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.grhist(symbol: str, expiry: str, strike: float, chain_id: str = '', put: bool = False) -> pandas.core.frame.DataFrame + +Get histoical option greeks + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiry: str + Option expiration date + strike: float + Strike price to look for + chain_id: str + OCC option symbol. Overwrites other inputs + put: bool + Is this a put option? + + Returns + ------- + df: pd.DataFrame + Dataframe containing historical greeks + +## Getting charts +###stocks.options.grhist(symbol: str, expiry: str, strike: float, greek: str = 'Delta', chain_id: str = '', put: bool = False, raw: bool = False, limit: int = 20, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plots historical greeks for a given option. [Source: Syncretism] + + Parameters + ---------- + symbol: str + Stock ticker + expiry: str + Expiration date + strike: float + Strike price to consider + greek: str + Greek variable to plot + chain_id: str + OCC option chain. Overwrites other variables + put: bool + Is this a put option? + raw: bool + Print to console + limit: int + Number of rows to show in raw + export: str + Format to export data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/hedge/add_hedge_option/_index.md b/website/content/api/stocks/options/hedge/add_hedge_option/_index.md new file mode 100644 index 000000000000..36ff1f3504b6 --- /dev/null +++ b/website/content/api/stocks/options/hedge/add_hedge_option/_index.md @@ -0,0 +1,51 @@ +# stocks.options.hedge.add_hedge_option + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.hedge.add_hedge_option(price: float = 100, implied_volatility: float = 20, strike: float = 120, days: float = 30, sign: int = 1) -> tuple + +Determine the delta, gamma and vega value of the portfolio and/or options. + + Parameters + ---------- + price: float + The price. + implied_volatility: float + The implied volatility. + strike: float + The strike price. + days: float + The amount of days until expiration. Use annual notation thus a month would be 30 / 360. + sign: int + Whether you have a long (1) or short (-1) position + + Returns + ------- + delta: float + gamma: float + portfolio: float + +## Getting charts +###stocks.options.hedge.add_hedge_option(price: float = 100, implied_volatility: float = 20, strike: float = 120, days: float = 30, sign: int = 1, chart=True) + +Determine the delta, gamma and vega value of the portfolio and/or options and show them. + + Parameters + ---------- + price: float + The price. + implied_volatility: float + The implied volatility. + strike: float + The strike price. + days: float + The amount of days until expiration. Use annual notation thus a month would be 30 / 360. + sign: int + Whether you have a long (1) or short (-1) position + + Returns + ------- + delta: float + gamma: float + vega: float diff --git a/website/content/api/stocks/options/hedge/calc_delta/_index.md b/website/content/api/stocks/options/hedge/calc_delta/_index.md new file mode 100644 index 000000000000..ff758ab09f3c --- /dev/null +++ b/website/content/api/stocks/options/hedge/calc_delta/_index.md @@ -0,0 +1,30 @@ +# stocks.options.hedge.calc_delta + +## Get underlying data +###stocks.options.hedge.calc_delta(asset_price: float = 100, asset_volatility: float = 20, strike_price: float = 120, time_to_expiration: float = 30, risk_free_rate: float = 0, sign: int = 1) + +The first-order partial-derivative with respect to the underlying asset of the Black-Scholes + equation is known as delta. Delta refers to how the option value changes when there is a change in + the underlying asset price. Multiplying delta by a +-$1 change in the underlying asset, holding all other + parameters constant, will give you the new value of the option. Delta will be positive for long call and + short put positions, negative for short call and long put positions. + + Parameters + ---------- + asset_price: int + The price. + asset_volatility: float + The implied volatility. + strike_price: float + The strike price. + time_to_expiration: float + The amount of days until expiration. Use annual notation thus a month would be 30 / 360. + risk_free_rate: float + The risk free rate. + sign: int + Whether you have a long (1) or short (-1) position + + Returns + ------- + delta: float + Returns the value for the delta. diff --git a/website/content/api/stocks/options/hedge/calc_gamma/_index.md b/website/content/api/stocks/options/hedge/calc_gamma/_index.md new file mode 100644 index 000000000000..7a9ec46452a9 --- /dev/null +++ b/website/content/api/stocks/options/hedge/calc_gamma/_index.md @@ -0,0 +1,29 @@ +# stocks.options.hedge.calc_gamma + +## Get underlying data +###stocks.options.hedge.calc_gamma(asset_price: float = 100, asset_volatility: float = 20, strike_price: float = 120, time_to_expiration: float = 30, risk_free_rate: float = 0) + +The second-order partial-derivative with respect to the underlying asset of the Black-Scholes equation + is known as gamma. Gamma refers to how the option’s delta changes when there is a change in the underlying + asset price. Multiplying gamma by a +-$1 change in the underlying asset, holding all other parameters constant, + will give you the new value of the option’s delta. Essentially, gamma is telling us the rate of change of delta + given a +-1 change in the underlying asset price. Gamma is always positive for long positions and + negative for short positions. + + Parameters + ---------- + asset_price: int + The price. + asset_volatility: float + The implied volatility. + strike_price: float + The strike price. + time_to_expiration: float + The amount of days until expiration. Use annual notation thus a month would be 30 / 360. + risk_free_rate: float + The risk free rate. + + Returns + ------- + gamma: float + Returns the value for the gamma. diff --git a/website/content/api/stocks/options/hedge/calc_hedge/_index.md b/website/content/api/stocks/options/hedge/calc_hedge/_index.md new file mode 100644 index 000000000000..f9bd6975a6eb --- /dev/null +++ b/website/content/api/stocks/options/hedge/calc_hedge/_index.md @@ -0,0 +1,50 @@ +# stocks.options.hedge.calc_hedge + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.hedge.calc_hedge(portfolio_option_amount: float = 100, side: str = 'Call', greeks: dict = {'Portfolio': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}, 'Option A': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}, 'Option B': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}}, sign: int = 1) + +Determine the hedge position and the weights within each option and + underlying asset to hold a neutral portfolio + + Parameters + ---------- + portfolio_option_amount: float + Number to show + side: str + Whether you have a Call or Put instrument + greeks: dict + Dictionary containing delta, gamma and vega values for the portfolio and option A and B. Structure is + as follows: {'Portfolio': {'Delta': VALUE, 'Gamma': VALUE, 'Vega': VALUE}} etc + sign: int + Whether you have a long (1) or short (-1) position + + Returns + ------- + option A weight: float + option B weight: float + portfolio weight: float + is_singular: boolean + +## Getting charts +###stocks.options.hedge.calc_hedge(portfolio_option_amount: float = 100, side: str = 'Call', greeks: dict = {'Portfolio': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}, 'Option A': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}, 'Option B': {'Delta': 1, 'Gamma': 9.1268e-05, 'Vega': 5.4661}}, sign: int = 1, chart=True) + +Determine the hedge position and the weights within each option and + underlying asset to hold a neutral portfolio and show them + + Parameters + ---------- + portfolio_option_amount: float + Number to show + side: str + Whether you have a Call or Put instrument + greeks: dict + Dictionary containing delta, gamma and vega values for the portfolio and option A and B. Structure is + as follows: {'Portfolio': {'Delta': VALUE, 'Gamma': VALUE, 'Vega': VALUE}} etc + sign: int + Whether you have a long (1) or short (-1) position + + Returns + ------- + A table with the neutral portfolio weights. diff --git a/website/content/api/stocks/options/hedge/calc_vega/_index.md b/website/content/api/stocks/options/hedge/calc_vega/_index.md new file mode 100644 index 000000000000..107cd8c2389a --- /dev/null +++ b/website/content/api/stocks/options/hedge/calc_vega/_index.md @@ -0,0 +1,28 @@ +# stocks.options.hedge.calc_vega + +## Get underlying data +###stocks.options.hedge.calc_vega(asset_price: float = 100, asset_volatility: float = 20, strike_price: float = 120, time_to_expiration: float = 30, risk_free_rate: float = 0) + +The first-order partial-derivative with respect to the underlying asset volatility of + the Black-Scholes equation is known as vega. Vega refers to how the option value + changes when there is a change in the underlying asset volatility. Multiplying vega by + a +-1% change in the underlying asset volatility, holding all other parameters constant, will give + you the new value of the option. Vega will be positive for long positions and negative for short positions. + + Parameters + ---------- + asset_price: int + The price. + asset_volatility: float + The implied volatility. + strike_price: float + The strike price. + time_to_expiration: float + The amount of days until expiration. Use annual notation thus a month would be 30 / 360. + risk_free_rate: float + The risk free rate. + + Returns + ------- + vega: float + Returns the value for the gamma. diff --git a/website/content/api/stocks/options/hist_ce/_index.md b/website/content/api/stocks/options/hist_ce/_index.md new file mode 100644 index 000000000000..44361e4fb2f6 --- /dev/null +++ b/website/content/api/stocks/options/hist_ce/_index.md @@ -0,0 +1,46 @@ +# stocks.options.hist_ce + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.hist_ce(symbol: str = 'GME', date: str = '2021-02-05', call: bool = True, price: str = '90') -> pandas.core.frame.DataFrame + +Historic prices for a specific option [chartexchange] + + Parameters + ---------- + symbol : str + Ticker symbol to get historical data from + date : str + Date as a string YYYYMMDD + call : bool + Whether to show a call or a put + price : str + Strike price for a specific option + + Returns + ------- + historical : pd.Dataframe + Historic information for an option + +## Getting charts +###stocks.options.hist_ce(symbol: str = 'GME', expiry: str = '2021-02-05', call: bool = True, price: float = 90, limit: int = 10, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> None + +Return raw stock data[chartexchange] + + Parameters + ---------- + symbol : str + Ticker symbol for the given option + expiry : str + The expiry of expiration, format "YYYY-MM-DD", i.e. 2010-12-31. + call : bool + Whether the underlying asset should be a call or a put + price : float + The strike of the expiration + limit : int + Number of rows to show + export : str + Export data as CSV, JSON, XLSX + external_axes: Optional[List[plt.Axes]] + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/hist_tr/_index.md b/website/content/api/stocks/options/hist_tr/_index.md new file mode 100644 index 000000000000..3fd8b53bfcc5 --- /dev/null +++ b/website/content/api/stocks/options/hist_tr/_index.md @@ -0,0 +1,52 @@ +# stocks.options.hist_tr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.hist_tr(symbol: str, expiry: str, strike: float = 0, put: bool = False, chain_id: Optional[str] = None) -> pandas.core.frame.DataFrame + + + Gets historical option pricing. This inputs either ticker, expiration, strike or the OCC chain ID and processes + the request to tradier for historical premiums. + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiry: str + Option expiration date + strike: int + Option strike price + put: bool + Is this a put option? + chain_id: Optional[str] + OCC chain ID + + Returns + ------- + df_hist: pd.DataFrame + Dataframe of historical option prices + +## Getting charts +###stocks.options.hist_tr(symbol: str, expiry: str, strike: float = 0, put: bool = False, raw: bool = False, chain_id: str = None, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot historical option prices + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiry: str + Expiry date of option + strike: float + Option strike price + put: bool + Is this a put option? + raw: bool + Print raw data + chain_id: str + OCC option symbol + export: str + Format of export file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/info/_index.md b/website/content/api/stocks/options/info/_index.md new file mode 100644 index 000000000000..8c3f49e820b3 --- /dev/null +++ b/website/content/api/stocks/options/info/_index.md @@ -0,0 +1,30 @@ +# stocks.options.info + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.info(symbol: str) + +Get info for a given ticker + + Parameters + ---------- + symbol : str + The ticker symbol to get the price for + + Returns + ---------- + price : float + The info for a given ticker + +## Getting charts +###stocks.options.info(symbol: str, export: str = '', chart=True) + +Scrapes Barchart.com for the options information + + Parameters + ---------- + symbol: str + Ticker symbol to get options info for + export: str + Format of export file diff --git a/website/content/api/stocks/options/last_price/_index.md b/website/content/api/stocks/options/last_price/_index.md new file mode 100644 index 000000000000..6c079734a3ae --- /dev/null +++ b/website/content/api/stocks/options/last_price/_index.md @@ -0,0 +1,16 @@ +# stocks.options.last_price + +## Get underlying data +###stocks.options.last_price(symbol: str) + +Makes api request for last price + + Parameters + ---------- + symbol: str + Ticker symbol + + Returns + ------- + float: + Last price diff --git a/website/content/api/stocks/options/option_chain/_index.md b/website/content/api/stocks/options/option_chain/_index.md new file mode 100644 index 000000000000..36838b0f75bf --- /dev/null +++ b/website/content/api/stocks/options/option_chain/_index.md @@ -0,0 +1,18 @@ +# stocks.options.option_chain + +## Get underlying data +###stocks.options.option_chain(symbol: str, expiry: str) + +Gets option chain from yf for given ticker and expiration + + Parameters + ---------- + symbol: str + Ticker symbol to get options for + expiry: str + Date to get options for. YYYY-MM-DD + + Returns + ------- + chains: yf.ticker.Options + Options chain diff --git a/website/content/api/stocks/options/option_expirations/_index.md b/website/content/api/stocks/options/option_expirations/_index.md new file mode 100644 index 000000000000..282b086f9b2a --- /dev/null +++ b/website/content/api/stocks/options/option_expirations/_index.md @@ -0,0 +1,16 @@ +# stocks.options.option_expirations + +## Get underlying data +###stocks.options.option_expirations(symbol: str) + +Get available expiration dates for given ticker + + Parameters + ---------- + symbol: str + Ticker symbol to get expirations for + + Returns + ------- + dates: List[str] + List of of available expirations diff --git a/website/content/api/stocks/options/pcr/_index.md b/website/content/api/stocks/options/pcr/_index.md new file mode 100644 index 000000000000..50b65e2e8a6b --- /dev/null +++ b/website/content/api/stocks/options/pcr/_index.md @@ -0,0 +1,35 @@ +# stocks.options.pcr + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.pcr(symbol: str, window: int = 30, start_date: str = '2021-09-19') -> pandas.core.frame.DataFrame + +Gets put call ratio over last time window [Source: AlphaQuery.com] + + Parameters + ---------- + symbol: str + Ticker symbol to look for + window: int, optional + Window to consider, by default 30 + start_date: str, optional + Start date to plot, by default last 366 days + +## Getting charts +###stocks.options.pcr(symbol: str, window: int = 30, start_date: str = '2021-09-19', export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display put call ratio [Source: AlphaQuery.com] + + Parameters + ---------- + symbol : str + Stock ticker symbol + window : int, optional + Window length to look at, by default 30 + start_date : str, optional + Starting date for data, by default (datetime.now() - timedelta(days=366)).strftime("%Y-%m-%d") + export : str, optional + Format to export data, by default "" + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/price/_index.md b/website/content/api/stocks/options/price/_index.md new file mode 100644 index 000000000000..38b9101bb64c --- /dev/null +++ b/website/content/api/stocks/options/price/_index.md @@ -0,0 +1,16 @@ +# stocks.options.price + +## Get underlying data +###stocks.options.price(symbol: str) -> float + +Get current price for a given ticker + + Parameters + ---------- + symbol : str + The ticker symbol to get the price for + + Returns + ---------- + price : float + The price of the ticker diff --git a/website/content/api/stocks/options/process_chains/_index.md b/website/content/api/stocks/options/process_chains/_index.md new file mode 100644 index 000000000000..c5227b854462 --- /dev/null +++ b/website/content/api/stocks/options/process_chains/_index.md @@ -0,0 +1,16 @@ +# stocks.options.process_chains + +## Get underlying data +###stocks.options.process_chains(response: requests.models.Response) -> pandas.core.frame.DataFrame + +Function to take in the requests.get and return a DataFrame + + Parameters + ---------- + response: requests.models.Response + This is the response from tradier api. + + Returns + ------- + opt_chain: pd.DataFrame + Dataframe with all available options diff --git a/website/content/api/stocks/options/screen/check_presets/_index.md b/website/content/api/stocks/options/screen/check_presets/_index.md new file mode 100644 index 000000000000..4c479986fe69 --- /dev/null +++ b/website/content/api/stocks/options/screen/check_presets/_index.md @@ -0,0 +1,15 @@ +# stocks.options.screen.check_presets + +## Get underlying data +###stocks.options.screen.check_presets(preset_dict: dict) -> str + +Checks option screener preset values + + Parameters + ---------- + preset_dict: dict + Defined presets from configparser + Returns + ------- + error: str + String of all errors accumulated diff --git a/website/content/api/stocks/options/screen/screener_output/_index.md b/website/content/api/stocks/options/screen/screener_output/_index.md new file mode 100644 index 000000000000..c2a26695e491 --- /dev/null +++ b/website/content/api/stocks/options/screen/screener_output/_index.md @@ -0,0 +1,42 @@ +# stocks.options.screen.screener_output + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.screen.screener_output(preset: str = 'high_IV', presets_path: str = '/Users/colindelahunty/OpenBBTerminal/openbb_terminal/stocks/options/screen/../presets/') -> Tuple[pandas.core.frame.DataFrame, str] + +Screen options based on preset filters + + Parameters + ---------- + preset: str + Preset file to screen for + presets_path: str + Path to preset folder + Returns + ------- + pd.DataFrame: + DataFrame with screener data, or empty if errors + str: + String containing error message if supplied + +## Getting charts +###stocks.options.screen.screener_output(preset: str = 'high_IV', presets_path: str = '/Users/colindelahunty/OpenBBTerminal/openbb_terminal/stocks/options/screen/../presets/', limit: int = 20, export: str = '', chart=True) -> List + +Print the output of screener + + Parameters + ---------- + preset: str + Preset file to screen for + presets_path: str + Path to preset folder + limit: int + Number of randomly sorted rows to display + export: str + Format for export file + + Returns + ------- + List + List of tickers screened diff --git a/website/content/api/stocks/options/unu/_index.md b/website/content/api/stocks/options/unu/_index.md new file mode 100644 index 000000000000..7b4809d30dd6 --- /dev/null +++ b/website/content/api/stocks/options/unu/_index.md @@ -0,0 +1,40 @@ +# stocks.options.unu + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.unu(limit: int = 100) + +Get unusual option activity from fdscanner.com + + Parameters + ---------- + limit: int + Number to show + + Returns + ------- + df: pd.DataFrame + Dataframe containing options information + last_updated: pd.Timestamp + Timestamp indicated when data was updated from website + +## Getting charts +###stocks.options.unu(limit: int = 20, sortby: str = 'Vol/OI', ascend: bool = False, calls_only: bool = False, puts_only: bool = False, export: str = '', chart=True) + +Displays the unusual options table + + Parameters + ---------- + limit: int + Number of rows to show + sortby: str + Data column to sort on + ascend: bool + Whether to sort in ascend order + calls_only : bool + Flag to only show calls + puts_only : bool + Flag to show puts only + export: str + File type to export diff --git a/website/content/api/stocks/options/voi_yf/_index.md b/website/content/api/stocks/options/voi_yf/_index.md new file mode 100644 index 000000000000..66072ab2fe20 --- /dev/null +++ b/website/content/api/stocks/options/voi_yf/_index.md @@ -0,0 +1,37 @@ +# stocks.options.voi_yf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.voi_yf(symbol: str, expiration: str) -> pandas.core.frame.DataFrame + +Plot volume and open interest + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiration: str + Option expiration + +## Getting charts +###stocks.options.voi_yf(symbol: str, expiration: str, min_sp: float = -1, max_sp: float = -1, min_vol: float = -1, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot volume and open interest + + Parameters + ---------- + symbol: str + Stock ticker symbol + expiration: str + Option expiration + min_sp: float + Min strike price + max_sp: float + Max strike price + min_vol: float + Min volume to consider + export: str + Format for exporting data + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/vol_yf/_index.md b/website/content/api/stocks/options/vol_yf/_index.md new file mode 100644 index 000000000000..b12d26701894 --- /dev/null +++ b/website/content/api/stocks/options/vol_yf/_index.md @@ -0,0 +1,39 @@ +# stocks.options.vol_yf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.vol_yf(symbol: str, expiration: str) -> pandas.core.frame.DataFrame + +Plot volume + + Parameters + ---------- + symbol: str + Ticker symbol + expiration: str + expiration date for options + +## Getting charts +###stocks.options.vol_yf(symbol: str, expiration: str, min_sp: float = -1, max_sp: float = -1, calls_only: bool = False, puts_only: bool = False, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Plot volume + + Parameters + ---------- + symbol: str + Ticker symbol + expiration: str + expiration date for options + min_sp: float + Min strike to consider + max_sp: float + Max strike to consider + calls_only: bool + Show calls only + puts_only: bool + Show puts only + export: str + Format to export file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/vsurf/_index.md b/website/content/api/stocks/options/vsurf/_index.md new file mode 100644 index 000000000000..cd91b329c8b9 --- /dev/null +++ b/website/content/api/stocks/options/vsurf/_index.md @@ -0,0 +1,34 @@ +# stocks.options.vsurf + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.options.vsurf(symbol: str) -> pandas.core.frame.DataFrame + +Gets IV surface for calls and puts for ticker + + Parameters + ---------- + symbol: str + Stock ticker symbol to get + + Returns + ------- + pd.DataFrame + Dataframe of DTE, Strike and IV + +## Getting charts +###stocks.options.vsurf(symbol: str, export: str = '', z: str = 'IV', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display vol surface + + Parameters + ---------- + symbol : str + Ticker symbol to get surface for + export : str + Format to export data + z : str + The variable for the Z axis + external_axes: Optional[List[plt.Axes]] + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/options/x_values/_index.md b/website/content/api/stocks/options/x_values/_index.md new file mode 100644 index 000000000000..990b95f9b84b --- /dev/null +++ b/website/content/api/stocks/options/x_values/_index.md @@ -0,0 +1,6 @@ +# stocks.options.x_values + +## Get underlying data +###stocks.options.x_values(current_price: float, options: List[Dict[str, int]]) -> List[float] + +Generates different price values that need to be t diff --git a/website/content/api/stocks/options/y_values/_index.md b/website/content/api/stocks/options/y_values/_index.md new file mode 100644 index 000000000000..5d0c45bbd4f2 --- /dev/null +++ b/website/content/api/stocks/options/y_values/_index.md @@ -0,0 +1,6 @@ +# stocks.options.y_values + +## Get underlying data +###stocks.options.y_values(base: float, price: float, options: List[Dict[Any, Any]], underlying: int) -> float + +Generates y values for corresponding x v diff --git a/website/content/api/stocks/process_candle/_index.md b/website/content/api/stocks/process_candle/_index.md new file mode 100644 index 000000000000..558347009acf --- /dev/null +++ b/website/content/api/stocks/process_candle/_index.md @@ -0,0 +1,17 @@ +# stocks.process_candle + +## Get underlying data +###stocks.process_candle(df: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame + +Process DataFrame into candle style plot + + Parameters + ---------- + df : DataFrame + Stock dataframe. + + Returns + ------- + DataFrame + A Panda's data frame with columns Open, High, Low, Close, Adj Close, Volume, + date_id, OC-High, OC-Low. diff --git a/website/content/api/stocks/qa/capm_information/_index.md b/website/content/api/stocks/qa/capm_information/_index.md new file mode 100644 index 000000000000..52c4734f6343 --- /dev/null +++ b/website/content/api/stocks/qa/capm_information/_index.md @@ -0,0 +1,18 @@ +# stocks.qa.capm_information + +## Get underlying data +###stocks.qa.capm_information(symbol: str) -> Tuple[float, float] + +Provides information that relates to the CAPM model + + Parameters + ---------- + symbol : str + A ticker symbol in string form + + Returns + ------- + beta : float + The beta for a stock + sys : float + The systematic risk for a stock diff --git a/website/content/api/stocks/qa/fama_raw/_index.md b/website/content/api/stocks/qa/fama_raw/_index.md new file mode 100644 index 000000000000..4b7ebeba12be --- /dev/null +++ b/website/content/api/stocks/qa/fama_raw/_index.md @@ -0,0 +1,11 @@ +# stocks.qa.fama_raw + +## Get underlying data +###stocks.qa.fama_raw() -> pandas.core.frame.DataFrame + +Gets base Fama French data to calculate risk + + Returns + ---------- + fama : pd.DataFrame + A data with fama french model information diff --git a/website/content/api/stocks/qa/historical_5/_index.md b/website/content/api/stocks/qa/historical_5/_index.md new file mode 100644 index 000000000000..91a34e6b213e --- /dev/null +++ b/website/content/api/stocks/qa/historical_5/_index.md @@ -0,0 +1,16 @@ +# stocks.qa.historical_5 + +## Get underlying data +###stocks.qa.historical_5(symbol: str) -> pandas.core.frame.DataFrame + +Get 5 year monthly historical performance for a ticker with dividends filtered + + Parameters + ---------- + symbol : str + A ticker symbol in string form + + Returns + ---------- + data : pd.DataFrame + A dataframe with historical information diff --git a/website/content/api/stocks/quote/_index.md b/website/content/api/stocks/quote/_index.md new file mode 100644 index 000000000000..baa7ba448e95 --- /dev/null +++ b/website/content/api/stocks/quote/_index.md @@ -0,0 +1,11 @@ +# stocks.quote + +## Get underlying data +###stocks.quote(symbol: str) -> pandas.core.frame.DataFrame + +Ticker quote + + Parameters + ---------- + symbol : str + Ticker diff --git a/website/content/api/stocks/screener/historical/_index.md b/website/content/api/stocks/screener/historical/_index.md new file mode 100644 index 000000000000..cd4634047de7 --- /dev/null +++ b/website/content/api/stocks/screener/historical/_index.md @@ -0,0 +1,57 @@ +# stocks.screener.historical + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.screener.historical(preset_loaded: str = 'top_gainers', limit: int = 10, start_date: str = '2022-03-24', type_candle: str = 'a', normalize: bool = True) + +View historical price of stocks that meet preset + + Parameters + ---------- + preset_loaded: str + Preset loaded to filter for tickers + limit: int + Number of stocks to display + start_date: str + Start date to display historical data, in YYYY-MM-DD format + type_candle: str + Type of candle to display + normalize : bool + Boolean to normalize all stock prices using MinMax + + Returns + ------- + pd.DataFrame + Dataframe of the screener + list[str] + List of stocks + bool + Whether some random stock selection due to limitations + +## Getting charts +###stocks.screener.historical(preset_loaded: str = 'top_gainers', limit: int = 10, start_date: str = '2022-03-24', type_candle: str = 'a', normalize: bool = True, export: str = '', external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) -> List[str] + +View historical price of stocks that meet preset + + Parameters + ---------- + preset_loaded: str + Preset loaded to filter for tickers + limit: int + Number of stocks to display + start_date: str + Start date to display historical data, in YYYY-MM-DD format + type_candle: str + Type of candle to display + normalize : bool + Boolean to normalize all stock prices using MinMax + export : str + Export dataframe data to csv,json,xlsx file + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + + Returns + ------- + list[str] + List of stocks diff --git a/website/content/api/stocks/screener/screener_data/_index.md b/website/content/api/stocks/screener/screener_data/_index.md new file mode 100644 index 000000000000..3edb8e552b0d --- /dev/null +++ b/website/content/api/stocks/screener/screener_data/_index.md @@ -0,0 +1,49 @@ +# stocks.screener.screener_data + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.screener.screener_data(preset_loaded: str = 'top_gainers', data_type: str = 'overview', limit: int = 10, ascend: bool = False) + +Screener Overview + + Parameters + ---------- + preset_loaded : str + Loaded preset filter + data_type : str + Data type between: overview, valuation, financial, ownership, performance, technical + limit : int + Limit of stocks filtered with presets to print + ascend : bool + Ascended order of stocks filtered to print + + Returns + ---------- + pd.DataFrame + Dataframe with loaded filtered stocks + +## Getting charts +###stocks.screener.screener_data(loaded_preset: str = 'top_gainers', data_type: str = 'overview', limit: int = 10, ascend: bool = False, sortby: str = '', export: str = '', chart=True) -> List[str] + +Screener one of the following: overview, valuation, financial, ownership, performance, technical. + + Parameters + ---------- + loaded_preset: str + Preset loaded to filter for tickers + data_type : str + Data type string between: overview, valuation, financial, ownership, performance, technical + limit : int + Limit of stocks to display + ascend : bool + Order of table to ascend or descend + sortby: str + Column to sort table by + export : str + Export dataframe data to csv,json,xlsx file + + Returns + ------- + List[str] + List of stocks that meet preset criteria diff --git a/website/content/api/stocks/search/_index.md b/website/content/api/stocks/search/_index.md new file mode 100644 index 000000000000..df5ba2ae6dde --- /dev/null +++ b/website/content/api/stocks/search/_index.md @@ -0,0 +1,23 @@ +# stocks.search + +## Get underlying data +###stocks.search(query: str = '', country: str = '', sector: str = '', industry: str = '', exchange_country: str = '', limit: int = 0, export: str = '') -> None + +Search selected query for tickers. + + Parameters + ---------- + query : str + The search term used to find company tickers + country: str + Search by country to find stocks matching the criteria + sector : str + Search by sector to find stocks matching the criteria + industry : str + Search by industry to find stocks matching the criteria + exchange_country: str + Search by exchange country to find stock matching + limit : int + The limit of companies shown. + export : str + Export data diff --git a/website/content/api/stocks/sia/countries/_index.md b/website/content/api/stocks/sia/countries/_index.md new file mode 100644 index 000000000000..7ebbe194d3da --- /dev/null +++ b/website/content/api/stocks/sia/countries/_index.md @@ -0,0 +1,18 @@ +# stocks.sia.countries + +## Get underlying data +###stocks.sia.countries(industry: str = '', sector: str = '') + +Get all countries in Yahoo Finance data based on sector or industry. [Source: Finance Database] + + Parameters + ---------- + industry : str + Filter retrieved countries by industry + sector : str + Filter retrieved countries by sector + + Returns + ------- + list + List of possible countries diff --git a/website/content/api/stocks/sia/cpci/_index.md b/website/content/api/stocks/sia/cpci/_index.md new file mode 100644 index 000000000000..8af657025794 --- /dev/null +++ b/website/content/api/stocks/sia/cpci/_index.md @@ -0,0 +1,46 @@ +# stocks.sia.cpci + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.sia.cpci(industry: str = 'Internet Content & Information', mktcap: str = 'Large', exclude_exchanges: bool = True) + +Get number of companies per country in a specific industry (and specific market cap). [Source: Finance Database] + + Parameters + ---------- + industry: str + Select industry to get number of companies by each country + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + + Returns + ------- + dict + Dictionary of countries and number of companies in a specific sector + +## Getting charts +###stocks.sia.cpci(industry: str = 'Internet Content & Information', mktcap: str = 'Large', exclude_exchanges: bool = True, export: str = '', raw: bool = False, max_countries_to_display: int = 15, min_pct_to_display_country: float = 0.015, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display number of companies per country in a specific industry. [Source: Finance Database] + + Parameters + ---------- + industry: str + Select industry to get number of companies by each country + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + export: str + Format to export data as + raw: bool + Output all raw data + max_countries_to_display: int + Maximum number of countries to display + min_pct_to_display_country: float + Minimum percentage to display country + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/sia/cpcs/_index.md b/website/content/api/stocks/sia/cpcs/_index.md new file mode 100644 index 000000000000..ec90885b9f66 --- /dev/null +++ b/website/content/api/stocks/sia/cpcs/_index.md @@ -0,0 +1,46 @@ +# stocks.sia.cpcs + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.sia.cpcs(sector: str = 'Technology', mktcap: str = 'Large', exclude_exchanges: bool = True) + +Get number of companies per country in a specific sector (and specific market cap). [Source: Finance Database] + + Parameters + ---------- + sector: str + Select sector to get number of companies by each country + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + + Returns + ------- + dict + Dictionary of countries and number of companies in a specific sector + +## Getting charts +###stocks.sia.cpcs(sector: str = 'Technology', mktcap: str = 'Large', exclude_exchanges: bool = True, export: str = '', raw: bool = False, max_countries_to_display: int = 15, min_pct_to_display_country: float = 0.015, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display number of companies per country in a specific sector. [Source: Finance Database] + + Parameters + ---------- + sector: str + Select sector to get number of companies by each country + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + export: str + Format to export data as + raw: bool + Output all raw data + max_countries_to_display: int + Maximum number of countries to display + min_pct_to_display_country: float + Minimum percentage to display country + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/sia/cpic/_index.md b/website/content/api/stocks/sia/cpic/_index.md new file mode 100644 index 000000000000..4b6e610c57a6 --- /dev/null +++ b/website/content/api/stocks/sia/cpic/_index.md @@ -0,0 +1,47 @@ +# stocks.sia.cpic + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.sia.cpic(country: str = 'United States', mktcap: str = 'Large', exclude_exchanges: bool = True) + +Get number of companies per industry in a specific country (and specific market cap). [Source: Finance Database] + + Parameters + ---------- + country: str + Select country to get number of companies by each industry + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + + Returns + ------- + dict + Dictionary of industries and number of companies in a specific country + +## Getting charts +###stocks.sia.cpic(country: str = 'United States', mktcap: str = 'Large', exclude_exchanges: bool = True, export: str = '', raw: bool = False, max_industries_to_display: int = 15, min_pct_to_display_industry: float = 0.015, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display number of companies per industry in a specific country. [Source: Finance Database] + + Parameters + ---------- + country: str + Select country to get number of companies by each industry + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + export: str + Format to export data as + raw: bool + Output all raw data + max_industries_to_display: int + Maximum number of industries to display + min_pct_to_display_industry: float + Minimum percentage to display industry + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None + diff --git a/website/content/api/stocks/sia/cpis/_index.md b/website/content/api/stocks/sia/cpis/_index.md new file mode 100644 index 000000000000..f7dd8c364509 --- /dev/null +++ b/website/content/api/stocks/sia/cpis/_index.md @@ -0,0 +1,46 @@ +# stocks.sia.cpis + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.sia.cpis(sector: str = 'Technology', mktcap: str = 'Large', exclude_exchanges: bool = True) + +Get number of companies per industry in a specific sector (and specific market cap). [Source: Finance Database] + + Parameters + ---------- + sector: str + Select sector to get number of companies by each industry + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + + Returns + ------- + dict + Dictionary of industries and number of companies in a specific sector + +## Getting charts +###stocks.sia.cpis(sector: str = 'Technology', mktcap: str = 'Large', exclude_exchanges: bool = True, export: str = '', raw: bool = False, max_industries_to_display: int = 15, min_pct_to_display_industry: float = 0.015, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display number of companies per industry in a specific sector. [Source: Finance Database] + + Parameters + ---------- + sector: str + Select sector to get number of companies by each industry + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + export: str + Format to export data as + raw: bool + Output all raw data + max_industries_to_display: int + Maximum number of industries to display + min_pct_to_display_industry: float + Minimum percentage to display industry + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/sia/cps/_index.md b/website/content/api/stocks/sia/cps/_index.md new file mode 100644 index 000000000000..d474550e6852 --- /dev/null +++ b/website/content/api/stocks/sia/cps/_index.md @@ -0,0 +1,46 @@ +# stocks.sia.cps + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.sia.cps(country: str = 'United States', mktcap: str = 'Large', exclude_exchanges: bool = True) + +Get number of companies per sector in a specific country (and specific market cap). [Source: Finance Database] + + Parameters + ---------- + country: str + Select country to get number of companies by each sector + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + + Returns + ------- + dict + Dictionary of sectors and number of companies in a specific country + +## Getting charts +###stocks.sia.cps(country: str = 'United States', mktcap: str = 'Large', exclude_exchanges: bool = True, export: str = '', raw: bool = False, max_sectors_to_display: int = 15, min_pct_to_display_sector: float = 0.015, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +Display number of companies per sector in a specific country (and market cap). [Source: Finance Database] + + Parameters + ---------- + country: str + Select country to get number of companies by each sector + mktcap: str + Select market cap of companies to consider from Small, Mid and Large + exclude_exchanges : bool + Exclude international exchanges + export: str + Format to export data as + raw: bool + Output all raw data + max_sectors_to_display: int + Maximum number of sectors to display + min_pct_to_display_sector: float + Minimum percentage to display sector + external_axes : Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/sia/filter_stocks/_index.md b/website/content/api/stocks/sia/filter_stocks/_index.md new file mode 100644 index 000000000000..4d484ddee7c3 --- /dev/null +++ b/website/content/api/stocks/sia/filter_stocks/_index.md @@ -0,0 +1,24 @@ +# stocks.sia.filter_stocks + +## Get underlying data +###stocks.sia.filter_stocks(country: str = None, sector: str = None, industry: str = None, marketcap: str = '', exclude_exchanges: bool = True) + +Filter stocks based on country, sector, industry, market cap and exclude exchanges. [Source: Finance Database] + + Parameters + ---------- + country: str + Search by country to find stocks matching the criteria. + sector: str + Search by sector to find stocks matching the criteria. + industry: str + Search by industry to find stocks matching the criteria. + marketcap: str + Select stocks based on the market cap. + exclude_exchanges: bool + When you wish to include different exchanges use this boolean. + + Returns + ------- + list + List of filtered stocks diff --git a/website/content/api/stocks/sia/industries/_index.md b/website/content/api/stocks/sia/industries/_index.md new file mode 100644 index 000000000000..41361d5161fa --- /dev/null +++ b/website/content/api/stocks/sia/industries/_index.md @@ -0,0 +1,18 @@ +# stocks.sia.industries + +## Get underlying data +###stocks.sia.industries(country: str = '', sector: str = '') + +Get all industries in Yahoo Finance data based on country or sector. [Source: Finance Database] + + Parameters + ---------- + country : str + Filter retrieved industries by country + sector : str + Filter retrieved industries by sector + + Returns + ------- + list + List of possible industries diff --git a/website/content/api/stocks/sia/maketcap/_index.md b/website/content/api/stocks/sia/maketcap/_index.md new file mode 100644 index 000000000000..fd7dd5d8c7f8 --- /dev/null +++ b/website/content/api/stocks/sia/maketcap/_index.md @@ -0,0 +1,11 @@ +# stocks.sia.maketcap + +## Get underlying data +###stocks.sia.maketcap() + +Get all market cap division in Yahoo Finance data. [Source: Finance Database] + + Returns + ------- + list + List of possible market caps diff --git a/website/content/api/stocks/sia/sectors/_index.md b/website/content/api/stocks/sia/sectors/_index.md new file mode 100644 index 000000000000..a1518e49ad68 --- /dev/null +++ b/website/content/api/stocks/sia/sectors/_index.md @@ -0,0 +1,18 @@ +# stocks.sia.sectors + +## Get underlying data +###stocks.sia.sectors(industry: str = '', country: str = '') + +Get all sectors in Yahoo Finance data based on country or industry. [Source: Finance Database] + + Parameters + ---------- + industry : str + Filter retrieved sectors by industry + country : str + Filter retrieved sectors by country + + Returns + ------- + list + List of possible sectors diff --git a/website/content/api/stocks/sia/stocks_data/_index.md b/website/content/api/stocks/sia/stocks_data/_index.md new file mode 100644 index 000000000000..c3be405ed9e6 --- /dev/null +++ b/website/content/api/stocks/sia/stocks_data/_index.md @@ -0,0 +1,28 @@ +# stocks.sia.stocks_data + +## Get underlying data +###stocks.sia.stocks_data(symbols: List[str] = None, finance_key: str = 'ncf', stocks_data: dict = None, period: str = 'annual', currency: str = 'USD') + +Get stocks data based on a list of stocks and the finance key. The function searches for the + correct financial statement automatically. [Source: StockAnalysis] + + Parameters + ---------- + symbols: list + A list of tickers that will be used to collect data for. + finance_key: str + The finance key used to search within the SA_KEYS for the correct name of item + on the financial statement + stocks_data : dict + A dictionary that is empty on initialisation but filled once data is collected + for the first time. + period : str + Whether you want annually, quarterly or trailing financial statements. + currency : str + Choose in what currency you wish to convert each company's financial statement. + Default is USD (US Dollars). + + Returns + ------- + dict + Dictionary of filtered stocks data separated by financial statement diff --git a/website/content/api/stocks/ta/recom/_index.md b/website/content/api/stocks/ta/recom/_index.md new file mode 100644 index 000000000000..49358daf8fdb --- /dev/null +++ b/website/content/api/stocks/ta/recom/_index.md @@ -0,0 +1,42 @@ +# stocks.ta.recom + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ta.recom(symbol: str, screener: str = 'america', exchange: str = '', interval: str = '') -> pandas.core.frame.DataFrame + +Get tradingview recommendation based on technical indicators + + Parameters + ---------- + symbol : str + Ticker symbol to get the recommendation from tradingview based on technical indicators + screener : str + Screener based on tradingview docs https://python-tradingview-ta.readthedocs.io/en/latest/usage.html + exchange: str + Exchange based on tradingview docs https://python-tradingview-ta.readthedocs.io/en/latest/usage.html + interval: str + Interval time to check technical indicators and correspondent recommendation + + Returns + ------- + df_recommendation: pd.DataFrame + Dataframe of tradingview recommendations based on technical indicators + +## Getting charts +###stocks.ta.recom(symbol: str, screener: str = 'america', exchange: str = '', interval: str = '', export: str = '', chart=True) + +Print tradingview recommendation based on technical indicators + + Parameters + ---------- + symbol : str + Ticker symbol to get tradingview recommendation based on technical indicators + screener : str + Screener based on tradingview docs https://python-tradingview-ta.readthedocs.io/en/latest/usage.html + exchange: str + Exchange based on tradingview docs https://python-tradingview-ta.readthedocs.io/en/latest/usage.html + interval: str + Interval time to check technical indicators and correspondent recommendation + export: str + Format of export file diff --git a/website/content/api/stocks/ta/summary/_index.md b/website/content/api/stocks/ta/summary/_index.md new file mode 100644 index 000000000000..4307463446ac --- /dev/null +++ b/website/content/api/stocks/ta/summary/_index.md @@ -0,0 +1,28 @@ +# stocks.ta.summary + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ta.summary(symbol: str) -> str + +Get technical summary report provided by FinBrain's API + + Parameters + ---------- + symbol : str + Ticker symbol to get the technical summary + + Returns + ------- + report:str + technical summary report + +## Getting charts +###stocks.ta.summary(symbol: str, chart=True) + +Print technical summary report provided by FinBrain's API + + Parameters + ---------- + symbol: str + Ticker symbol to get the technical summary diff --git a/website/content/api/stocks/ta/view/_index.md b/website/content/api/stocks/ta/view/_index.md new file mode 100644 index 000000000000..d0867ee2e55f --- /dev/null +++ b/website/content/api/stocks/ta/view/_index.md @@ -0,0 +1,30 @@ +# stocks.ta.view + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.ta.view(symbol: str) -> bytes + +Get finviz image for given ticker + + Parameters + ---------- + symbol: str + Ticker symbol + + Returns + ------- + bytes + Image in byte format + +## Getting charts +###stocks.ta.view(symbol: str, external_axes: Optional[List[matplotlib.axes._axes.Axes]] = None, chart=True) + +View finviz image for ticker + + Parameters + ---------- + symbol: str + Stock ticker symbol + external_axes: Optional[List[plt.Axes]], optional + External axes (1 axis is expected in the list), by default None diff --git a/website/content/api/stocks/th/all/_index.md b/website/content/api/stocks/th/all/_index.md new file mode 100644 index 000000000000..c90b2f31925c --- /dev/null +++ b/website/content/api/stocks/th/all/_index.md @@ -0,0 +1,24 @@ +# stocks.th.all + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.th.all() -> pandas.core.frame.DataFrame + +Get all exchanges. + + Parameters + ---------- + + Returns + ------- + pd.DataFrame + All available exchanges + +## Getting charts +###stocks.th.all(, chart=True) + +Display all exchanges. + + Parameters + ---------- diff --git a/website/content/api/stocks/th/check_if_open/_index.md b/website/content/api/stocks/th/check_if_open/_index.md new file mode 100644 index 000000000000..00e29febb21a --- /dev/null +++ b/website/content/api/stocks/th/check_if_open/_index.md @@ -0,0 +1,18 @@ +# stocks.th.check_if_open + +## Get underlying data +###stocks.th.check_if_open(bursa, exchange) + +Check if market open helper function + + Parameters + __________ + bursa + pd.DataFrame of all exchanges + exchange + bursa pd.DataFrame index value for exchande + + Returns + _______ + bool + If market is open diff --git a/website/content/api/stocks/th/closed/_index.md b/website/content/api/stocks/th/closed/_index.md new file mode 100644 index 000000000000..5c3631ce5531 --- /dev/null +++ b/website/content/api/stocks/th/closed/_index.md @@ -0,0 +1,24 @@ +# stocks.th.closed + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.th.closed() -> pandas.core.frame.DataFrame + +Get closed exchanges. + + Parameters + ---------- + + Returns + ------- + pd.DataFrame + Currently closed exchanges + +## Getting charts +###stocks.th.closed(, chart=True) + +Display closed exchanges. + + Parameters + ---------- diff --git a/website/content/api/stocks/th/exchange/_index.md b/website/content/api/stocks/th/exchange/_index.md new file mode 100644 index 000000000000..9e61d47cc907 --- /dev/null +++ b/website/content/api/stocks/th/exchange/_index.md @@ -0,0 +1,28 @@ +# stocks.th.exchange + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.th.exchange(symbol: str) -> pandas.core.frame.DataFrame + +Get current exchange open hours. + + Parameters + ---------- + symbol : str + Exchange symbol + + Returns + ------- + pd.DataFrame + Exchange info + +## Getting charts +###stocks.th.exchange(symbol: str, chart=True) + +Display current exchange trading hours. + + Parameters + ---------- + symbol : str + Exchange symbol diff --git a/website/content/api/stocks/th/open/_index.md b/website/content/api/stocks/th/open/_index.md new file mode 100644 index 000000000000..cb9264f81500 --- /dev/null +++ b/website/content/api/stocks/th/open/_index.md @@ -0,0 +1,24 @@ +# stocks.th.open + +To obtain charts, make sure to add `chart=True` as the last parameter + +## Get underlying data +###stocks.th.open() -> pandas.core.frame.DataFrame + +Get open exchanges. + + Parameters + ---------- + + Returns + ------- + pd.DataFrame + Currently open exchanges + +## Getting charts +###stocks.th.open(, chart=True) + +Display open exchanges. + + Parameters + ----------