Merge branch 'develop' into feature/login

This commit is contained in:
Diogo Sousa
2023-02-01 11:52:42 +00:00
284 changed files with 106886 additions and 30488 deletions

View File

@@ -1,4 +1,4 @@
name: Trigger Build on Release and PRs to Main
name: Build & Release
env:
OPENBB_ENABLE_QUICK_EXIT: true
@@ -26,30 +26,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: windows10_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-macos-build:
runs-on: ubuntu-latest
steps:
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
- name: Trigger M1 MacOs Build
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: m1_macos_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-intel-build:
runs-on: ubuntu-latest
steps:
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
- name: Trigger Intel MacOs Build
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: intel_macos_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-docker-build:
runs-on: ubuntu-latest
steps:
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
- name: Trigger docker Build
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: docker.yml
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -40,4 +40,4 @@ jobs:
- name: Publishing the Docker image
run: |
docker push "${OPENBBTERMINAL_DOCKER_POETRY_IMAGE}"
if: startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/')
if: startsWith(github.ref, 'refs/heads/main')

View File

@@ -1,4 +1,4 @@
name: Nightly Build on the develop branch
name: Nightly Build
env:
OPENBB_ENABLE_QUICK_EXIT: true
@@ -21,30 +21,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: windows10_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-macos-build:
runs-on: ubuntu-latest
steps:
- name: Trigger M1 MacOs Build
uses: benc-uk/workflow-dispatch@v1
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: m1_macos_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-intel-build:
runs-on: ubuntu-latest
steps:
- name: Trigger Intel MacOs Build
uses: benc-uk/workflow-dispatch@v1
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: intel_macos_build.yml
token: ${{ secrets.GITHUB_TOKEN }}
wait-for-completion-timeout: 2h
trigger-docker-build:
runs-on: ubuntu-latest
steps:
- name: Trigger docker Build
uses: benc-uk/workflow-dispatch@v1
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: docker.yml
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -16,47 +16,62 @@ concurrency:
jobs:
Windows-Build:
name: Windows10 Build
runs-on: [self-hosted, Windows, x64]
name: Windows10 Build ENV
runs-on: windows-latest
# Configuring -------------
steps:
- name: Setup Windows Git Configuration # This is under the assumption that git is already installed on the system
run: |
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1
git config --system core.longpaths true
- name: Checkout
uses: actions/checkout@v2.4.2
- name: Activate Base & Create OpenBB Environment
- name: Set up Python & Create OpenBB Environment
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Create and start virtual environment
run: |
conda activate base
conda env create -n obb --file build/conda/conda-3-9-env-full.yaml
conda init
conda activate obb
conda env list
- name: Poetry Install
# Conda activate needs to be run every time because of the way that the workflow steps work
# on powershell where it creates a new shell every time for every step
python -m venv venv
source venv/Scripts/activate
python -m pip install --upgrade pip
python -m pip install poetry==1.1.13
python -m pip install setuptools==64.0.2 wheel
python -m pip install charset_normalizer==2.1.1
python -m poetry install -E installer -E all
python -m pip uninstall papermill -y
python -m pip install git+https://github.com/nteract/papermill.git@main
python -m PyInstaller build/pyinstaller/terminal.spec --clean
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: OpenBB-Windows10-ENV
path: dist
Build-Exe:
name: Windows10 Build-Exe
runs-on: [self-hosted, Windows, x64]
needs: Windows-Build
# Configuring -------------
steps:
- name: Setup Windows Git Configuration # This is under the assumption that git is already installed on the system
run: |
conda activate obb
poetry install
- name: Poetry Install Portfolio Optimization and Forecasting Toolkits
run: |
conda activate obb
poetry install -E all
- name: Poetry Install Installer
run: |
conda activate obb
poetry install -E installer
- name: Install Specific Papermill
run: |
conda activate obb
pip uninstall papermill -y
pip install git+https://github.com/nteract/papermill.git@main
# Building ------------
- name: Build Terminal.spec file
run: |
conda activate obb
pyinstaller build/pyinstaller/terminal.spec --clean
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1
git config --system core.longpaths true
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: OpenBB-Windows10-ENV
path: dist
- name: Move Files into App Folder
run: cp -r .\dist\OpenBBTerminal\ .\build\nsis\app\
# don't need this because log collection is turned off
@@ -64,16 +79,18 @@ jobs:
# run: Remove-Item .\build\nsis\app\openbb_terminal\logs\ -Recurse
- name: Build Exe File
run: |
conda activate obb
C:\'.\Program Files (x86)\'\nsis\makensis.exe .\build\nsis\setup.nsi
- name: Save Build Artifact
uses: actions/upload-artifact@v3
with:
name: Windows EXE Artifact
path: '.\build\nsis\OpenBB Terminal Setup.exe'
- name: Run Integration Tests
run: |
dist\OpenBBTerminal\OpenBBTerminal.exe C:\Users\Administrator\actions-runner\_work\OpenBBTerminal\OpenBBTerminal\openbb_terminal\miscellaneous\integration_tests_scripts -t
dist\OpenBBTerminal\OpenBBTerminal.exe -t
# Cleaning ------------------------
# Make sure to add Remove-Item C:\Users\Administrator\Desktop\OPENBB-exports -Recurse whenever integration tests get fixed
- name: Remove Previous Build
@@ -81,10 +98,4 @@ jobs:
Remove-Item '.\build\nsis\OpenBB Terminal Setup.exe' -Recurse
Remove-Item .\build\nsis\app\ -Recurse
Remove-Item .\dist\ -Recurse
Remove-Item .\build\terminal\ -Recurse
- name: Deactivate & Remove Conda Environment
run: |
conda deactivate obb
conda deactivate base
conda env remove -n obb
Remove-Item C:\Users\Administrator\miniconda3\envs\obb\ -Recurse

View File

@@ -1,18 +1,15 @@
# -*- mode: python ; coding: utf-8 -*-
import os
import pathlib
import subprocess
import sys
from pathlib import Path
import scipy
from dotenv import set_key
from PyInstaller.compat import is_darwin, is_win
from PyInstaller.building.api import PYZ, EXE, COLLECT
from PyInstaller.building.splash import Splash
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
# import subprocess
from PyInstaller.building.splash import Splash
from PyInstaller.compat import is_darwin, is_win
from openbb_terminal.loggers import get_commit_hash
@@ -23,21 +20,30 @@ build_type = (
)
# Local python environment packages folder
pathex = os.path.join(os.path.dirname(os.__file__), "site-packages")
venv_path = Path(sys.executable).parent.parent.resolve()
# Check if we are running in a conda environment
if is_darwin:
pathex = os.path.join(os.path.dirname(os.__file__), "site-packages")
else:
if "site-packages" in list(venv_path.iterdir()):
pathex = str(venv_path / "site-packages")
else:
pathex = str(venv_path / "lib" / "site-packages")
# Removing unused ARM64 binary
binary_to_remove = pathlib.Path(
os.path.join(pathex, "_scs_direct.cpython-39-darwin.so")
)
binary_to_remove = Path(os.path.join(pathex, "_scs_direct.cpython-39-darwin.so"))
print("Removing ARM64 Binary: _scs_direct.cpython-39-darwin.so")
binary_to_remove.unlink(missing_ok=True)
build_assets_folder = os.path.join(os.getcwd(), "build", "pyinstaller")
# Removing inspect hook
destination = pathlib.Path(
destination = Path(
os.path.join(pathex, "pyinstaller/hooks/rthooks", "pyi_rth_inspect.py")
)
print("Replacing Pyinstaller Hook: pyi_rth_inspect.py")
source = "build/pyinstaller/hooks/pyi_rth_inspect.py"
source = os.path.join(build_assets_folder, "hooks", "pyi_rth_inspect.py")
subprocess.run(["cp", source, str(destination)], check=True)
@@ -77,8 +83,8 @@ added_files = [
]
if is_win:
added_files.append(
(os.path.join(f"{os.path.dirname(scipy.__file__)}.libs"), "scipy.libs/"),
)
(os.path.join(f"{os.path.dirname(scipy.__file__)}.libs"), "scipy.libs/"),
)
# Python libraries that are explicitly pulled into the bundle
hidden_imports = [
"sklearn.utils._cython_blas",
@@ -103,7 +109,7 @@ hidden_imports = [
"_sysconfigdata__darwin_darwin",
"prophet",
"debugpy",
"scipy.sparse.linalg._isolve._iterative"
"scipy.sparse.linalg._isolve._iterative",
]

View File

@@ -2,35 +2,32 @@
"""Main Testing Module"""
__docformat__ = "numpy"
from functools import partial
from multiprocessing.pool import Pool
from multiprocessing import cpu_count
from pathlib import Path
import re
import time
from typing import Any, List, Dict, Optional, Tuple
from traceback import FrameSummary, format_list, extract_tb
import argparse
import logging
import sys
import os
from openbb_terminal.helper_funcs import check_positive
import re
import sys
import time
from functools import partial
from multiprocessing import cpu_count
from multiprocessing.pool import Pool
from pathlib import Path
from traceback import FrameSummary, extract_tb, format_list
from typing import Any, Dict, List, Optional, Tuple
from openbb_terminal.rich_config import console
from openbb_terminal.core.config.paths import (
MISCELLANEOUS_DIRECTORY,
REPOSITORY_DIRECTORY,
)
from openbb_terminal.helper_funcs import check_positive
from openbb_terminal.rich_config import console
from openbb_terminal.terminal_controller import (
insert_start_slash,
terminal,
replace_dynamic,
obbff,
replace_dynamic,
terminal,
)
from openbb_terminal.terminal_helper import (
is_reset,
suppress_stdout,
)
from openbb_terminal.terminal_helper import is_reset, suppress_stdout
logger = logging.getLogger(__name__)
special_arguments_values = [
@@ -697,6 +694,11 @@ def main():
if "--test" in sys.argv:
sys.argv.remove("--test")
os.environ["OPENBB_ENABLE_QUICK_EXIT"] = "True"
os.environ["OPENBB_LOG_COLLECT"] = "False"
os.environ["OPENBB_USE_ION"] = "False"
os.environ["OPENBB_USE_PROMPT_TOOLKIT"] = "False"
parse_args_and_run()

View File

@@ -607,6 +607,10 @@ def get_macro_data(
f"NEW: {df_new_oldest} - {df_new_newest}"
)
if not df.empty:
df = df.groupby(df.index.strftime("%Y-%m")).head(1)
df.index = df.index.strftime("%Y-%m")
except HTTPError:
return console.print(
f"There is no data available for the combination {parameter} and {country}."
@@ -724,6 +728,7 @@ def get_aggregated_macro_data(
).T
(df_rounded, denomination) = transform_by_denomination(country_data_df)
df_rounded.index = pd.DatetimeIndex(df_rounded.index)
return (
df_rounded,

View File

@@ -92,7 +92,7 @@ def get_economic_calendar(
calendar = calendar.rename(
columns={
"gmt": "Time (GMT)",
"gmt": "Time (ET)",
"country": "Country",
"eventName": "Event",
"actual": "Actual",

View File

@@ -100,6 +100,7 @@ def get_historical(
resolution: str = "d",
interval: int = 5,
start_date: str = "",
end_date: str = "",
) -> pd.DataFrame:
"""Get historical forex data.
@@ -115,6 +116,8 @@ def get_historical(
Interval for intraday data
start_date : str, optional
Start date for data.
end_date : str, optional
End date for data.
Returns
-------
@@ -146,6 +149,10 @@ def get_historical(
if not response_json:
console.print("No data found.\n")
else:
if "Meta Data" not in response_json and "Information" in response_json:
console.print(response_json["Information"])
return pd.DataFrame()
key = list(response_json.keys())[1]
df = pd.DataFrame.from_dict(response_json[key], orient="index")
@@ -153,6 +160,9 @@ def get_historical(
if start_date and resolution != "i":
df = df[df.index > start_date]
if end_date and resolution != "i":
df = df[df.index < end_date]
df = df.rename(
columns={
"1. open": "Open",

View File

@@ -150,9 +150,17 @@ class ForexController(BaseController):
"--start",
default=(datetime.now() - timedelta(days=365)),
type=valid_date,
help="Start date of data.",
help="The starting date (format YYYY-MM-DD) of the forex pair",
dest="start_date",
)
parser.add_argument(
"-e",
"--end",
type=valid_date,
default=datetime.now().strftime("%Y-%m-%d"),
dest="end",
help="The ending date (format YYYY-MM-DD) of the forex pair",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-t")
@@ -179,6 +187,7 @@ class ForexController(BaseController):
resolution=ns_parser.resolution,
interval=ns_parser.interval,
start_date=ns_parser.start_date.strftime("%Y-%m-%d"),
end_date=ns_parser.end.strftime("%Y-%m-%d"),
source=ns_parser.source,
)
@@ -190,6 +199,7 @@ class ForexController(BaseController):
)
else:
self.data.index.name = "date"
console.print(f"{self.from_symbol}-{self.to_symbol} loaded.")
export_data(
ns_parser.export,
@@ -198,12 +208,8 @@ class ForexController(BaseController):
self.data.copy(),
" ".join(ns_parser.sheet_name) if ns_parser.sheet_name else None,
)
self.source = ns_parser.source
if self.source != "YahooFinance":
console.print(f"{self.from_symbol}-{self.to_symbol} loaded.\n")
else:
console.print("\n[red]Make sure to load.[/red]\n")
@log_start_end(log=logger)

View File

@@ -98,6 +98,7 @@ def load(
resolution: str = "d",
interval: str = "1day",
start_date: Optional[str] = None,
end_date: Optional[str] = None,
source: str = "YahooFinance",
verbose: bool = False,
) -> pd.DataFrame:
@@ -115,6 +116,8 @@ def load(
What interval to get data for, by default "1day"
start_date : Optional[str], optional
When to begin loading in data, by default last_year.strftime("%Y-%m-%d")
end_date : Optional[str], optional
When to end loading in data, by default None
source : str, optional
Where to get data from, by default "YahooFinance"
verbose : bool, optional
@@ -124,10 +127,17 @@ def load(
-------
pd.DataFrame
The loaded data
Examples
--------
>>> from openbb_terminal.sdk import openbb
>>> openbb.forex.load(from_symbol="EUR", to_symbol="USD", start_date="2020-11-30", end_date="2022-12-01")
"""
if start_date is None:
start_date = (datetime.now() - timedelta(days=365)).strftime("%Y-%m-%d")
if end_date is None:
end_date = datetime.now().strftime("%Y-%m-%d")
if source in ["YahooFinance", "AlphaVantage"]:
interval_map = INTERVAL_MAPS[source]
@@ -159,6 +169,7 @@ def load(
resolution=resolution,
interval=clean_interval,
start_date=start_date,
end_date=end_date,
)
df.index.name = "date"
return df
@@ -167,6 +178,7 @@ def load(
df = yf.download(
f"{from_symbol}{to_symbol}=X",
start=datetime.strptime(start_date, "%Y-%m-%d"),
end=datetime.strptime(end_date, "%Y-%m-%d"),
interval=clean_interval,
progress=verbose,
)
@@ -185,6 +197,7 @@ def load(
multiplier=multiplier,
timespan=timeframe,
start_date=start_date,
end_date=end_date,
)
df.index.name = "date"
return df

View File

@@ -151,8 +151,6 @@ def parse_and_split_input(an_input: str, custom_filters: List) -> List[str]:
if an_input:
if an_input == "/":
an_input = "home"
elif an_input[0] == "/":
an_input = "home" + an_input
# everything from ` -f ` to the next known extension
file_flag = r"(\ -f |\ --file )"

View File

@@ -1,20 +1,21 @@
en:
_home_: Information, guides and support for the OpenBB Terminal
intro: introduction on the OpenBB Terminal
about: discover the capabilities of the OpenBB Terminal (https://openbb.co/docs)
support: pre-populate a support ticket for our team to evaluate
survey: fill in our 2-minute survey so we better understand how we can improve the terminal
update: attempt to update the terminal automatically (GitHub version)
exe: execute automated routine script
wiki: search for an expression in Wikipedia (https://www.wikipedia.org/)
news: display news articles based on term and data sources
settings: tune settings (export folder, timezone, language, plot size)
keys: set API keys and check their validity
featflags: enable and disable feature flags
sources: select your preferred data sources
account: manage your OpenBB account
keys: set API keys and check their validity
wiki: search for an expression in Wikipedia (https://www.wikipedia.org/)
record: record session to be converted into a .openbb routine
stop: stop session recording
intro: introduction on the OpenBB Terminal
settings: tune settings (export folder, timezone, language, plot size)
_scripts_: Record and execute your own .openbb routine scripts
record: start recording current session
stop: stop session recording and convert to .openbb routine
exe: execute .openbb routine scripts (use exe --example for an example)
_configure_: Configure your own terminal
_main_menu_: Main menu
account/_info_: Cloud storage of keys, settings and feature flags
@@ -915,7 +916,7 @@ en:
econometrics/coint: co-integration test on a multitude of columns
portfolio/bro: brokers holdings, supports robinhood, ally, degiro, coinbase
portfolio/po: portfolio optimization, optimize your portfolio weights efficiently
portfolio/load: load transactions into the portfolio
portfolio/load: load transactions into the portfolio (use load --example for an example)
portfolio/_loaded: Loaded transactions
portfolio/_riskfreerate: Risk Free Rate
portfolio/show: show existing transactions
@@ -974,7 +975,7 @@ en:
portfolio/bro/cb/deposits: show all your deposits or internal transfers
portfolio/bro/cb/orders: show all your orders
portfolio/po/file: file that contains portfolio risk parameters
portfolio/po/load: load tickers and categories from .xlsx or .csv file
portfolio/po/load: load tickers and categories from .xlsx or .csv file (use load --example for an example)
portfolio/po/_loaded: Portfolio loaded
portfolio/po/_tickers: Tickers
portfolio/po/_categories: Categories

View File

@@ -9,7 +9,7 @@ plot
plot -pf a,b
plot -ct a,b
plot -pf a,b -ct c,d
load --file 50_30_10_10_Portfolio.xlsx
load --example
show -pf a,b -ct c,d
show -pf a
show -ct c
@@ -39,7 +39,7 @@ plot -pf name_0,maxsharpe_1 -ct c,sector,current_invested_amount -dd
plot -pf name_0,maxsharpe_1 -ct c,sector,current_invested_amount -rc
plot -pf name_0,maxsharpe_1 -ct c,sector,current_invested_amount -he
..
load --file market.csv
load --example
po
equal
show -pf name_0

View File

@@ -1,5 +1,5 @@
portfolio
load -f Public_Equity_Orderbook.xlsx
load --example
show
bench QQQ
alloc assets -t -l 4

View File

@@ -1,8 +1,8 @@
portfolio
load --file Public_Equity_Orderbook.xlsx
load --example
po
params
load OpenBB_Parameters_Template_v1.0.0.xlsx
load
set ef
arg tangency False
arg log_returns True

View File

@@ -1,7 +1,7 @@
portfolio
po
load 60_40_Portfolio.xlsx
file --file example.ini
load --example
file
maxsharpe -s 2022-10-20
minrisk -r 0.05
maxutil -a 0.1 -ra 2 -tk 0.4 -tr 8
@@ -23,7 +23,7 @@ plot -pf MAXSHARPE_0 -rc
plot -pf MAXSHARPE_0 -he
rpf NAME_6
..
load --file market.csv
load --example
po
equal
maxsharpe -s 1995-05-07

View File

@@ -1,8 +1,8 @@
reports
portfolio Public_Equity_Orderbook.xlsx
portfolio --transactions holdings_example.xlsx
# Test with invalid path
portfolio Public_Equity_Orderbook_test.xlsx
portfolio --transactions holdings_test.xlsx
exit

View File

@@ -1,3 +0,0 @@
Date,Ticker,Type,Sector,Industry,Country,Price,Quantity,Fees,Premium,Investment,Side,Currency
7/20/2021,btc,CRYPTO,Digital Currency,Large,United States,29790,1,0,0,29790,Buy,USD
7/25/2021,eth,CRYPTO,Digital Asset,Mid,United States,29799,1,0,0,29799,Buy,USD
1 Date Ticker Type Sector Industry Country Price Quantity Fees Premium Investment Side Currency
2 7/20/2021 btc CRYPTO Digital Currency Large United States 29790 1 0 0 29790 Buy USD
3 7/25/2021 eth CRYPTO Digital Asset Mid United States 29799 1 0 0 29799 Buy USD

View File

@@ -1,5 +0,0 @@
Date,Ticker,Type,Sector,Industry,Country,Price,Quantity,Fees,Premium,Investment,Side,Currency
3/24/2021,aapl,stock,Technology,Communication Services,United States,120.7,300,0,0,0,Buy,USD
3/26/2021,msft,stock,Technology,Communication Services,United States,232.8,200,0,0,0,Buy,USD
5/21/2021,btc,crypto,Digital Assets,Digital Assets,United States,37430,1,0,0,0,Buy,USD
7/2/2021,aapl,stock,Technology,Communication Services,United States,139.8,300,0,0,0,Buy,USD
1 Date Ticker Type Sector Industry Country Price Quantity Fees Premium Investment Side Currency
2 3/24/2021 aapl stock Technology Communication Services United States 120.7 300 0 0 0 Buy USD
3 3/26/2021 msft stock Technology Communication Services United States 232.8 200 0 0 0 Buy USD
4 5/21/2021 btc crypto Digital Assets Digital Assets United States 37430 1 0 0 0 Buy USD
5 7/2/2021 aapl stock Technology Communication Services United States 139.8 300 0 0 0 Buy USD

View File

@@ -1,3 +0,0 @@
Date,Ticker,Type,Sector,Industry,Country,Price,Quantity,Fees,Premium,Investment,Side,Currency
10/12/2018,QQQ,ETF,American Technology,Large,United States,174.32,30,0,0,0,Buy,USD
6/5/2020,SPY,ETF,American Market,Large,United States,319.34,10,0,0,0,Buy,USD
1 Date Ticker Type Sector Industry Country Price Quantity Fees Premium Investment Side Currency
2 10/12/2018 QQQ ETF American Technology Large United States 174.32 30 0 0 0 Buy USD
3 6/5/2020 SPY ETF American Market Large United States 319.34 10 0 0 0 Buy USD

View File

@@ -1,7 +0,0 @@
[OPENBB]
freq = d
maxnan = 0.1923912931924
method = time
risk_measure = MV
alpha = 3

View File

@@ -1,6 +0,0 @@
[OPENBB]
freq = d
maxnan = 0.05
method = time
risk_measure = MV

View File

@@ -1,8 +0,0 @@
[OPENBB]
historic_period=3y
log_returns=0
return_frequency=d
max_nan=0.05
threshold_value=0.3
nan_fill_method=time
significance_level=0.05

View File

@@ -1,7 +0,0 @@
[OPENBB]
interval=3y
log_returns=0
freq=d
maxnan=0.05
threshold=0.3
alpha=0.05

View File

@@ -1,7 +0,0 @@
[OPENBB]
freq = d
maxnan = 1.69
method = time
risk_measure = MV
alpha = 3

View File

@@ -1,15 +0,0 @@
# ROUTINES
This folder introduces the concept of routines, which are meant for the user to develop and run at once. The notebook reports is a better approach to this idea, but currently the development of this is not trivial. On the other hand, the development of this is trivial as long as the user is familiar with our terminal interface.
Try out with:
```bash
python terminal.py routines/example.openbb
```
Or within the Terminal, use:
```bash
exe routines/example.openbb
```

View File

@@ -1,29 +0,0 @@
# Go into the stocks context
stocks
# Load a ticker that's given as a first argument of the routine
load USB
# Go into the Comparison Analysis Menu
ca
# Get similar companies
set C,USB,WFC,JPM,TD,GS,PNC,TFC,BAC,COF
# Show the historical prices
historical -n
# Show a correlation matrix
hcorr
# Compare valuations
valuation
# Compare performance
performance
# Show cashflows
cashflow
# Return to home
/

View File

@@ -1,40 +0,0 @@
# Select location folder to export data to (if doesn't exist, will be created by default)
# export didier_analysis_on_$ARGV[0]
# Go into the stocks context
stocks
# Navigate to Dark Pools and Short Data Menu
dps
# Show the most shorted stocks on Yahoo Finance
shorted
# Show the stocks with the highest short interest on https://highshortinterest.com
hsi
# Show the top 25 largest Dark Pool positions from https://stockgrid.io
pos -l 25
pos -l 25 -a
# Get the Cost-to-Borrow List
ctb
# Get the days-to-cover list and sort
sidtc -s si
sidtc
# Load Apple as a ticker
load AAPL
# Short Volume vs Position
spos
# Price vs. Short Interest
psi
# Export the Cost-to-Borrow list as a spreadsheet to examine.
ctb
# Return to home
/

View File

@@ -1,38 +0,0 @@
# Select location folder to export data to (if doesn't exist, will be created by default)
# export didier_analysis_on_$ARGV[0]
# Go into the stocks context
stocks
# Load a ticker that's given as a first argument of the routine
load CF
# Enter the Due Diligence submenu
dd
# Print last twenty SEC filings
sec -l 20
# Print a chart and raw table of historical price targets
pt
pt -l 20 --raw
# See a list of public companies that are customers of, or suppliers to, CF Industries
customer
supplier
# Change tickers to $TSLA
load tsla
# Display table of the last twenty $TSLA trades across all ARK funds
arktrades -l 20
# Export a spreadsheet of historic ARK fund trades of $HOOD
load hood
arktrades --export xlsx
# Show future earnings estimates for $HOOD
est
# Show recent analyst upgrades/downgrades
analyst

View File

@@ -1,29 +0,0 @@
# Enter the discovery menu
stocks/disc
# Show a dividend calendar
divcal -l 25
# Show upcoming earnings
upcoming
# Show Ark trades
arkord
# See news from Alpha Vantage
cnews -t issuance
cnews -t m-a
# Gainers and Losers from Yahoo
gainers
losers
active
# Fidelity Order Flow
ford -l 25
# Next IPOs scheduled
fipo
# Hot Penny Stocks
hotpenny -l 25

View File

@@ -1,83 +0,0 @@
# This script requires you to use a ticker as an argument. This can be done with the following:
# exe due_diligence_stock.openbb -i AMT
# Go to the stocks menu
stocks
# Load a ticker, given the argument used. E.g. -i AMT
load $ARGV[0]
# Display stock price over time
candle
# Check market cap
fa/mktcap
# Check company management
mgmt
# Check fundamentals
income/balance/cash
# Look into sustainability
sust
# Look into historical dividends
divs
# Display most important notes of SEC filings based on a NLP model
analysis
# Create discounted cash flow spreadsheet
dcf
# show latest insider activity
../ins/stats
# check price vs short interest volume
../dps/psi
# check historical quarterly government contracts
../gov/histcont
# check rating from analysts
../dd/rating
# check price targets over time along share price
pt
# check annual earnings estimates
est
# check simple moving average 20,50 window
../ta/sma
# check recommendation and summary based on main technical analysis indicators
recom/summary
# check Twitter's sentiment on the ticker
../ba/sentiment
# go into sector and industry analysis menu
../sia
# check total cash metrics across similar tickers
metric tc
# check free cash flow metrics across similar tickers
metric fcf
# check operating income over time
vis oi
# go into comparison analysis menu
ca
# share price over time
historical
# correlation heatmap
hcorr
# compare fundamentals across these companies
cashflow/balance/income

View File

@@ -1,19 +0,0 @@
# Go into the econometrics context
econometrics
# Load the wage_panel dataset and include an alias
load wage_panel -a wp
# Set the MultiIndex, allowing for Panel regressions to be performed
index wp -i nr,year
# Change the type of the year column so it can be included as time effects within the regressions
type wp.year -f category
# Perform a Pooled OLS, Random Effects and Fixed Effects estimation
panel -d wp.lwage -i wp.black,wp.hisp,wp.exper,wp.expersq,wp.married,wp.educ,wp.union,wp.year
panel -d wp.lwage -i wp.black,wp.hisp,wp.exper,wp.expersq,wp.married,wp.educ,wp.union,wp.year -r re
panel -d wp.lwage -i wp.expersq,wp.union,wp.married,wp.year -r fe
# Compare the results obtained from these regressions
compare

View File

@@ -1,27 +0,0 @@
# Go to the stocks menu
stocks
# Load Palantir Technologies (PLTR)
load pltr
# Enter the Due Diligence (dd) menu
dd
# Show price targets, both the chart and the table
pt
pt --raw
# Enter the Insider menu
../ins
# Show open insider filtered data for Palantir Technologies
stats
# Enter the Technical Analysis (ta) menu
../ta
# Show the fibonacci retracement levels
fib
# Return to home
/

View File

@@ -1,26 +0,0 @@
# This script requires you to use arguments. This can be done with the following:
# exe example_with_inputs.openbb -i TSLA,AAPL,MSFT
# Go to the stocks menu
stocks
# Load a ticker, given the argument used. E.g. -i TSLA
load $ARGV[0]
# Enter the Technical Analysis (ta) menu
ta
# Show the fibonacci retracement levels
fib
# Enter the comparison analysis (ca) menu
../ca
# Set two extra tickers based on the arguments used. E.g. -i TSLA,AAPL,MSFT
set $ARGV[1],$ARGV[2]
# Plot the historical prices
historical
# Return to home
/

View File

@@ -1,80 +0,0 @@
# This script requires you to use an argument. This can be done with the following:
# exe routines/example_with_inputs_saved.openbb -i AMZN
# Select location folder to export data to (if doesn't exist, will be created by default)
export didier_analysis_on_$ARGV[0]
# Go into the stocks context
stocks
# Load a ticker that's given as a first argument of the routine
load $ARGV[0]
# Go into the Sector and Industry analysis
sia
# When filtering by industry peers remove market cap filtering
clear mktcap
# Compare ticker against industry peers regarding their revenues over time
vis re --export jpg
# Filter by large market cap
mktcap Large
# Compare industry peers (with large market cap) regarding their current quick ratio
metric qr --export jpg
# Take these companies to Comparison Analysis menu
ca
# Access these companies historical raw price since 2019
historical -s 2019-01-01 -n --export jpg
# Compute their correlation of price
hcorr -s 2019-01-01 --export jpg
# Compare their income statements for current year
income --export csv
# Go back one menu to the main stocks context
..
# Enter in the Dark Pool short menu
dps
# Shows stock price vs short interest volume
psi --export jpg,csv
# Go back one menu and go into Behavioural Analysis menu
../ba
# Check interest on google search of covid and quarantine correlated with ticker price
interest -s 2019-01-01 -w covid,quarantine --export interest_with_covid_quarantine.jpg
# Correlate headlines news sentiment with stock price
snews --export jpg
# Check shareholders of company (leave menu, go into Fundamental Analysis command and call command)
../fa/shrs --export csv
# Get SEC filings
../dd/sec --export csv
# Analyst ratings over time
rot --export jpg
# Price targets over time vs stock price
pt --export jpg
# Apply Relative Strength Index to the stock price
../ta/rsi --export jpg
# Get similar companies arccording to Finnhub API
../ca/getfinnhub
# Compare their volume
volume --export jpg
# Return to home
/

View File

@@ -1,47 +0,0 @@
# Demonstration of the Fundamental Analysis features, with a user-defined ticker.
# This can be done on the home menu through 'exe fa_demo.openbb -i AAPL'
# Enter stocks menu, load $ARGV[0], enter the Fundamental Analysis submenu and show a quote and overview statistics.
stocks
load $ARGV[0]
fa
quote
overview
mgmt
# NLP analysis of SEC filings
analysis
# Table of the corporate executives with links to their recent trading activity.
mgmt
# Major shareholders
shrs
# Sustainability Metrics
sust
# Performance ratios
key
enterprise -l 10
ratios -l 10
growth -l 10
metrics -l 10
# Financial Statements
income --source Polygon
income -q -l 8 --source Polygon
balance --source Polygon
balance -q -l 8 --source Polygon
cash -l 8 --source FinancialModelingPrep
data
# Charts
divs -p
splits
mktcap -s 1900-01-01
# Discount Cash Flow
dcfc -l 10
dcf

View File

@@ -1,43 +0,0 @@
# This script requires you to use arguments. This can be done with the following:
# exe routines/example_with_inputs.openbb -i TSLA,AAPL,MSFT
# Go to the Government submenu
stocks
gov
# Last Senate, Congress & House trades
lasttrades congress
lasttrades senate
lasttrades house
# Lobbying efforts
toplobbying
toplobbying -l 50 --raw
# Government spending
lastcontracts -p 1 -l 100 -s
# Load Microsoft for analysis
load msft
# Show government officials trades over six months
gtrades congress
gtrades congress --raw
gtrades senate
gtrades senate --raw
gtrades house
gtrades house --raw
# Show MSFT lobbying efforts on sigle-issue agendas
lobbying -l 20
# Historical Quarterly Government Contracts Awarded to MSFT
histcont
# Top tickers for overall trading by elected officials
topbuys congress
topbuys senate
topbuys house
topsells congress
topsells senate
topsells house

View File

@@ -1,34 +0,0 @@
# This script does not require you to use arguments.
# Go to the Insider Trading menu.
stocks
ins
# Commands not dependent on a loaded ticker
lcb
lit
lis
blcs
tispm
tippm
lip
lpsb
# Screener functions
set Gold-Silver
filter
set Retail-Trade
filter
set Guided-Missiles
filter
set Credit-Industry
filter
set Pharmaceuticals
filter
# Functions requiring a ticker
load spgi -s 2022-01-01
act
stats
lins

View File

@@ -1,58 +0,0 @@
# This script does not require you to use arguments.
# Go to the Options menu and load SPY with an expiry that is the second closest date.
stocks
options
load SPY
exp 0
# Show the chain's info
info
# Show the Put/Call Ratio with a 10, 30, and 90 day window.
pcr -l 10
pcr -l 30
pcr -l 90
# Show Open Interest and Volume
vol
oi
# Plot strike vs last trade date of puts and calls.
plot -p -x s -y ltd
plot -x s -y ltd
# Plot the volatility smile of puts and calls.
plot -c smile
plot -p -c smile
# Get chains and greeks data and export to spreadsheet.
chains --export xlsx
greeks -a -d 1.4 -r 1
greeks -p -a -d 1.4 -r 1
# Binomial pricing for $400 strike put and call.
binom -s 400
binom -p -s 400
# Run screeners
screen
set Highest_OI
scr
set Highest_Volume
scr
set Highest_IV
scr
set SPY_ATM_Calls
scr
set SPY_ATM_Poots
# Show unusual options list and export to a spreadsheet
..
unu -l 500 --export xlsx

View File

@@ -1,26 +0,0 @@
# Go to the Portfolio Optimization (po) menu
portfolio/po
# Load in an allocation sheet with all S&P 500 tickers
load SP_500_Portfolio.xlsx
# Load in a parameters file
file OpenBB_Parameters_Template_v1.0.0.xlsx
# Apply the Hierarchical Risk Parity (hrp) technique
hrp
# Show HRP results based on sector
show HRP_0 -ct SECTOR
# Plot the sector distribution
plot HRP_0 -ct SECTOR -pi
# Show a histogram of returns and drawdowns
plot HRP_0 -ct SECTOR -hi -dd
# Show assets clustermap and risk contribution
plot HRP_0 -ct SECTOR -rc -he
# Return to home
/

View File

@@ -0,0 +1,23 @@
# Go into the stocks context
stocks
# Load a company ticker, e.g. Apple
load AAPL
# Show a candle chart with a 20 day Moving Average
candle --ma 20
# Switch over to the Due Diligence menu
dd
# Show analyst ratings
analyst
# Show price targets charts
pt
# Show future estimations
est
# Return to home
home

View File

@@ -1,47 +0,0 @@
# Enter the Stock Screener menu
stocks/scr
# Top Gainers
technical -s Gap
technical -s RSI
overview -s Volume
# Strong Support Levels Preset
set stocks_strong_support_levels
overview
performance
financial
# Multiple Bottom Preset
set multiple_bottom
technical -l 15 -s RSI
# Cheap Dividend
set cheap_dividend
overview -l 20 -s Market Cap
# Potential Reversals
set potential_reversals
performance -s Perf Week
overview -s Volume
# Unusual Volume
set unusual_volume
performance -l 20 -s Volume
overview -l 20 -s Market Cap
# Value stocks
set value_stocks
overview -s Market Cap
performance
# Major News
set major_news
overview -l 20 -s Market Cap
performance -l 20 -s Volume
# Display Correlation Heat Map of the last screened tickers
ca
hcorr -t r --display-full-matrix
# Scroll back up the terminal screen to review the different outputs of the screeners

View File

@@ -1,36 +0,0 @@
# Go into the stocks context
stocks
# Load a company ticker, e.g. Amazon
load AMZN
# Show a simple plot of the ticker, adding in any basic indicator.
candle --ma 20,30
# Switch over to the due diligence menu
dd
# Show the price targets of Amazon, both the graph as well as the table
pt
pt --raw
# Show estimates of annual and quarterly earnings as well as quarterly revenue estimates
est
# Open the comparison analysis menu (ca)
../ca
# Pick stocks that are competitors to Amazon
add ebay,wmt,tgt,baba,jd
# Determine the valuations of each company
valuation
# Show correlations between each company
hcorr
# Figure out the sentiment perceived of each company
sentiment
# Return to home
/

View File

@@ -1,37 +0,0 @@
# Demonstration of the Technical Analysis features, using SPY. No arguments are required to run this routine.
# Enter stocks menu, load intraday SPY with 30 minute interval, enter the T/A menu.
stocks
load spy -i 30
ta
# Show the RSI and OBV for 30 minute intervals and weekly intervals.
rsi
obv
..
load spy -w
ta
rsi
obv
# Show one week of OBV, VWAP, Bollinger Bands, MACD, and Fibonacci Retracements with one-minute intervals.
..
load spy -i 1
ta
obv
vwap
bbands
fib
macd
# Print T/A summary
summary
# Show long chart of SPY with monthly intervals with EMA for 3 and 6 months & MACD using six months as the slow and 4 as the signal.
..
load spy -s 1993-02-01 -m
ta
ema 3,6
macd -f 1 -s 6 --signal 4
..
candle --ma 6,12

View File

@@ -1,17 +0,0 @@
# This is a comment, below you can find a command
stocks
# This is another comment
# There can be multiple lines of comments if desired
load MSFT
# You can also have multiple commands below each other
candle
fa
# You have the ability to move around menus by using /
/portfolio/po
/economy
# Returning to home is easily done with home
home

Some files were not shown because too many files have changed in this diff Show More