OpenBB – An Introductory Guide to Investment Research

10 min read

Get 10-day Free Algo Trading Course

Loading

Last Updated on November 25, 2023

Table of contents:

  1. What is OpenBB?
  2. What is OpenBB used for?
  3. Why should I use OpenBB?
  4. Why shouldn’t I use OpenBB?
  5. Is OpenBB free?
  6. What are some OpenBB alternatives?
  7. How to get started with OpenBB?
  8. What is the OpenBB Terminal?
  9. How to use the OpenBB Terminal?
  10. How to get stock data with OpenBB Terminal?
  11. How to plot data with OpenBB Terminal?
  12. How to get Crypto data with OpenBB Terminal?
  13. How to get Futures data with OpenBB Terminal?
  14. How to get Options data with OpenBB Terminal?
  15. How to import and export data with OpenBB?
  16. How to add external API Keys to OpenBB?
  17. What are OpenBB Terminal Reports?
  18. How to use Reports in OpenBB?
  19. What are OpenBB Portfolios?
  20. How to create Portfolios in OpenBB?
  21. What is OpenBB Econometrics?
  22. How to use Econometrics in OpenBB?
  23. What are OpenBB Jupyter features?
  24. How to do behavioral sentiment analysis with OpenBB?
  25. How to do quantitative analysis with OpenBB?
  26. How to do technical analysis with OpenBB?
  27. What is OpenBB Automation and Scripting?
  28. How to write your automated script in OpenBB?
  29. What is the OpenBB Bot?
  30. How to use OpenBB Bot with Telegram?
  31. Where can I learn more about OpenBB?

What is OpenBB?

OpenBB is an open-sourced investment research platform.

Link: https://openbb.co

What is OpenBB used for?

OpenBB is primarily used by investors, quants, and traders to create reports, perform investment research, create custom charts and analyses, optimize portfolios, run sentiment and machine learning analyses, and more.

Why should I use OpenBB?

  • OpenBB is open source
  • OpenBB is easy to use and intuitive
  • Has a decent layout
  • The OpenBB Terminal is completely free
  • The OpenBB Bot has a free option
  • Abstracts technicality while providing depth and customizability
  • Has a solid amount of features
  • Has good investor support
  • Is very customizable
  • Has solid documentation
  • Has a great company culture and ethics

Why shouldn’t I use OpenBB?

  • OpenBB is quite new
  • OpenBB could use more features
  • The software could be a bit faster at certain times
  • Is based inside a terminal and not an “App” that some users might be more comfortable with
  • Needs polishing
  • Some parts of the documentation are outdated at the time of writing this article

Is OpenBB free?

The OpenBB Terminal is entirely free, although there might be some premium packages coming out soon. The OpenBB bot features a free version with constrained features and two premium ones with more features. You can see the difference in the picture below:

What are some OpenBB alternatives?

OpenBB can be replaced with other products that can be more suitable for your needs. Here is the list:

  1. QuantRocket
  2. Finviz
  3. Bloomberg Terminal
  4. AlphaSense
  5. EquityRT
  6. Verity, and more

How to get started with OpenBB?

To get started with OpenBB, you will have several options that depend on your preferences and operating system. In this article, I’ll follow the Windows version of OpenBB and show you how to set it up. If you don’t use Windows, check out the steps here.

The Windows version features an installer that can be downloaded from the following page. To do so we can simply click the “Download” button for the Windows installer. When the download is complete, you might get a warning from your antivirus software.

Don’t worry, it’s not a virus. The warning is the reason that OpenBB is still in Beta. The next step is to open up the installer exe file and start the installation process. It should take a minute or so. After it’s installed, you will see the OpenBB Terminal icon on your screen.

Click the icon to get started with OpenBB.

If you press a key (e.g., ENTER) you’ll be presented with some of the features that the OpenBB Terminal has to offer. In the following headers, we’ll explore some of those features so that you can get an idea of the product and its current state.

What is the OpenBB Terminal?

The OpenBB Terminal can be seen as your OpenBB workstation which is designed as a CLI (Command Line Interface). From the OpenBB Terminal, you can issue commands with your keyboard to interact with the Software and navigate through it.

How to use the OpenBB Terminal?

To use the OpenBB Terminal, all you need to do is to open it and navigate to any menu by typing its name. To go directly to the sub-menus you can write menu/sub-menu. If you ever need help with what a function does and what parameters it uses, you can add the -h flag at the end to get more details.

Here are some useful flags that can be used inside the OpenBB Terminal:

How to get stock data with OpenBB Terminal?

To get stock data with OpenBB Terminal, all you need to do is to use use the stocks menu and execute the quote function with the stock symbol of your interest provided. For example, let us obtain the price data of Microsoft:

quote -t MSFT
              Ticker Quote
┌────────────────┬───────────────────────┐
│                │ MSFT                  │
├────────────────┼───────────────────────┤
│ Name           │ Microsoft Corporation │
├────────────────┼───────────────────────┤
│ Price          │ 232.70                │
├────────────────┼───────────────────────┤
│ Open           │ 233.76                │
├────────────────┼───────────────────────┤
│ High           │ 234.92                │
├────────────────┼───────────────────────┤
│ Low            │ 231.15                │
├────────────────┼───────────────────────┤
│ Previous Close │ 235.87                │
├────────────────┼───────────────────────┤
│ Volume         │ 12,347,163            │
├────────────────┼───────────────────────┤
│ 52 Week High   │ 349.67                │
├────────────────┼───────────────────────┤
│ 52 Week Low    │ 219.13                │
├────────────────┼───────────────────────┤
│ Change         │ -3.17                 │
├────────────────┼───────────────────────┤
│ Change %       │ -1.34%                │
└────────────────┴───────────────────────┘

How to plot data with OpenBB Terminal?

To plot data with OpenBB Terminal, you can use the candle function. Prior to that, you will need to load the data for the symbol of your interest. For example, let’s load the data for Dropbox and plot it:

load -t DBX
Loading Daily DBX stock with starting period 2019-10-28 for analysis.

Company:  Dropbox, Inc.
Exchange: NASDAQ/NMS (GLOBAL MARKET)
Currency: USD

                                           DBX Performance

│ 1 Day │ 1 Week │ 1 Month │ 1 Year │ YTD │ Volatility (1Y) │ Volume (10D avg) │ Last Price │

│ 2.04 % │ 2.8 %  │ 7.26 %  │ -27.16 % │ -11.78 % │ 38.45 % │ 2.35 M           │ 22.02 │

And now we plot the price chart:

candle

How to get Crypto data with OpenBB Terminal?

To get Crypto data with OpenBB Terminal, you will need to access the crypto menu and utilize a function you might be interested in. For example, let us obtain the current trending Cryptocurrencies by using the disc function.

crypto/disc

This will open a few options that we can choose from. Each option shows the data pool it is utilizing.

Let’s see the top trending ones by writing cgtreding. The result is as follows:

            Trending coins on CoinGecko
┌─────────────┬──────────────┬─────────────────────┐
│ Symbol      │ Name         │ market_cap Cap Rank │
├─────────────┼──────────────┼─────────────────────┤
│ dogecoin    │ Dogecoin     │ 8                   │
├─────────────┼──────────────┼─────────────────────┤
│ aptos       │ Aptos        │ 55                  │
├─────────────┼──────────────┼─────────────────────┤
│ enq-enecuum │ Enecuum      │ 965                 │
├─────────────┼──────────────┼─────────────────────┤
│ monkeyball  │ MonkeyLeague │ 813                 │
├─────────────┼──────────────┼─────────────────────┤
│ dogechain   │ Dogechain    │ 327                 │
├─────────────┼──────────────┼─────────────────────┤
│ binancecoin │ BNB          │ 4                   │
├─────────────┼──────────────┼─────────────────────┤
│ husd        │ HUSD         │ 351                 │
└─────────────┴──────────────┴─────────────────────┘

How to get Futures data with OpenBB Terminal?

To get Futures data with OpenBB Terminal, you can access the future menu (under the economy menu) and use the search, historical, or curve functions that will return data on the symbol of your interest. For example, let’s obtain some general future data by writing:

economy/futures
     Futures/Commodities [Source: Wall St. Journal]
┌───────────────────────────┬─────────┬─────────┬───────┐
│                           │ Price   │ Chg     │ %Chg  │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Crude Oil                 │ 85.49   │ -2.41   │ -2.74 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Brent Crude               │ 91.61   │ -2.16   │ -2.30 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Gold                      │ 1639.80 │ -5.00   │ -0.30 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Silver                    │ 19.120  │ -0.027  │ -0.14 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Natural Gas               │ 6.504   │ 0.551   │ 9.26  │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Unleaded Gasoline         │ 2.4858  │ -0.0771 │ -3.01 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Copper                    │ 3.3785  │ -0.0505 │ -1.47 │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Corn                      │ 687.75  │ 7.00    │ 1.03  │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Wheat                     │ 873.50  │ 44.25   │ 5.34  │
├───────────────────────────┼─────────┼─────────┼───────┤
│ Bloomberg Commodity Index │ 112.75  │ 0.99    │ 0.89  │
└───────────────────────────┴─────────┴─────────┴───────┘

How to get Options data with OpenBB Terminal?

To get Options data with OpenBB Terminal, you can access the options submenu from the stocks menu and use one of the many functions such as info, chains, parity, greeks, pricing, hedge, and more. For example, let’s load PG data and obtain the put/call ratio by providing the interval for the option:

load -t PG
stocks/options/pcr 10

How to import and export data with OpenBB?

To import and export data with OpenBB, you can navigate to the OpenBBUserData folder which is found in the home of the system user account. The location of this folder can be set by the user from the /settings menu.

This folder is where exported files are saved, it is also where files being imported to the Terminal functions are kept. These include the following:

  • Screener presets
  • Portfolio files
  • Exported files
  • Files to be imported by various functions
  • Styles and themes
  • Preferred data sources
  • Anonymized usage logs

How to add external API Keys to OpenBB?

To add external API Keys to OpenBB, you can access the keys menu where you will find a list of all possible APIs that OpenBB Terminal Supports. To add a key, write the provider’s name and then the key (e.g., iex apiKey123). Press ENTER to save the key.

Once you add a key, OpenBB will perform an API request test to validate that the key is correct. If it is, it will be colored green. If it isn’t correct, the key will be in red.

What are OpenBB Terminal Reports?

OpenBB Terminal Reports are a feature that allows the user to create investment research workflow templates through Jupyter and easily automate them with different parameters. This feature is a good time saver.

How to use Reports in OpenBB?

To use Reports in OpenBB, navigate to the reports menu and choose the report type that you want to use. Currently, you can choose between stocks, crypto, economy, equity, portfolio, forex, and more. Let’s observe what the equity report looks like for Microsoft:

reports/equity MSFT

This will open an HTML page with a generated comprehensive equity report that you can inspect. I’ll just show a few snippets of it in the pictures below:

What are OpenBB Portfolios?

OpenBB Portfolios are a feature that allows the user to easily import, track, visualize and optimize Portfolios for performance in and across different markets.

How to create Portfolios in OpenBB?

To create Portfolios in OpenBB, you will need to access the portfolio menu and adding your assets to it by using the load function that intakes the excel file with your portfolio details. OpenBB comes prepared with an example portfolio that we can load the following way:

load -f Public_Equity_Orderbook.xlsx

Here are the mandatory variables that the portfolio sheet needs to have:

  • Date – The date the trade occurred
  • Name – The name of the security
  • Type – The type of security. Use Cash/Stock/Crypto/ETF as appropriate
  • Price – The price the security was added or removed, on a per-unit basis
  • Quantity – How much of the security in question was added or removed
  • Side – Whether you bought or sold. Use Buy/Deposit/1 to add to the portfolio or Sell/Withdrawal/0 to remove from the portfolio a search criterion, country, sector, or industry.

Now that we loaded the portfolio, we can define what our benchmark is. To add the benchmark we do the following:

bench SPDR S&P 500 ETF Trust (SPY)

Now we can use all the portfolio menu functions to obtain data about our portfolio. For example, let’s obtain the summary and performance of the portfolio.

summary
Summary of Portfolio vs Benchmark for all period
┌───────────────────┬───────────┬───────────┬────────────┐
│                   │ Portfolio │ Benchmark │ Difference │
├───────────────────┼───────────┼───────────┼────────────┤
│ Volatility        │ 0.02      │ 0.01      │ 0.00       │
├───────────────────┼───────────┼───────────┼────────────┤
│ Skew              │ -1.84     │ -0.56     │ -1.28      │
├───────────────────┼───────────┼───────────┼────────────┤
│ Kurtosis          │ 32.52     │ 11.08     │ 21.44      │
├───────────────────┼───────────┼───────────┼────────────┤
│ Maximum Drawdowwn │ -0.48     │ -0.34     │ -0.14      │
├───────────────────┼───────────┼───────────┼────────────┤
│ Sharpe ratio      │ 0.04      │ 0.05      │ -0.01      │
├───────────────────┼───────────┼───────────┼────────────┤
│ Sortino ratio     │ 0.05      │ 0.06      │ -0.01      │
├───────────────────┼───────────┼───────────┼────────────┤
│ R2 Score          │ 0.55      │ 0.55      │ 0.00       │
└───────────────────┴───────────┴───────────┴────────────┘
perf
Portfolio vs. Benchmark - Totals in period: all
┌──────────────────┬───────────┬───────────┬────────────┐
│                  │ Portfolio │ Benchmark │ Difference │
├──────────────────┼───────────┼───────────┼────────────┤
│ Total Investment │ 48693.95  │ 48693.95  │ -          │
├──────────────────┼───────────┼───────────┼────────────┤
│ Total Value      │ 53096.91  │ 61769.33  │ -8672.42   │
├──────────────────┼───────────┼───────────┼────────────┤
│ Total % Return   │ 9.04%     │ 26.85%    │ -17.81%    │
├──────────────────┼───────────┼───────────┼────────────┤
│ Total Abs Return │ 4402.96   │ 13075.38  │ -8672.42   │
└──────────────────┴───────────┴───────────┴────────────┘

What is OpenBB Econometrics?

OpenBB Econometrics is a feature that allows the user to apply advanced statistical methods and techniques to financial data. OpenBB features many tests and models such as the multi-linear regression models, normality, autocorrelation, and cointegration tests.

How to use Econometrics in OpenBB?

To use Econometrics in OpenBB, you will need to access the econometrics menu and load a dataset on which you want to perform the analysis on. Then, select functions that are categorized into the exploration, tests, regression, and regression tests groups.

For example, let’s load an example dataset called danish_data (Danish money demand data) that OpenBB has provided us with:

load -f danish_data
show
Dataset danish_data | Showing 10 of 55 rows
┌─────────────────────┬───────┬──────┬───────┬──────┬──────┐
│                     │ lrm   │ lry  │ lpy   │ ibo  │ ide  │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1974-01-01 00:00:00 │ 11.63 │ 5.90 │ -0.62 │ 0.15 │ 0.09 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1974-04-01 00:00:00 │ 11.60 │ 5.87 │ -0.58 │ 0.18 │ 0.10 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1974-07-01 00:00:00 │ 11.58 │ 5.84 │ -0.54 │ 0.17 │ 0.10 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1974-10-01 00:00:00 │ 11.60 │ 5.81 │ -0.50 │ 0.15 │ 0.10 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1975-01-01 00:00:00 │ 11.59 │ 5.80 │ -0.49 │ 0.13 │ 0.09 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1975-04-01 00:00:00 │ 11.60 │ 5.79 │ -0.45 │ 0.13 │ 0.08 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1975-07-01 00:00:00 │ 11.65 │ 5.83 │ -0.44 │ 0.13 │ 0.08 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1975-10-01 00:00:00 │ 11.76 │ 5.93 │ -0.44 │ 0.13 │ 0.07 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1976-01-01 00:00:00 │ 11.75 │ 5.94 │ -0.40 │ 0.14 │ 0.07 │
├─────────────────────┼───────┼──────┼───────┼──────┼──────┤
│ 1976-04-01 00:00:00 │ 11.77 │ 5.94 │ -0.37 │ 0.15 │ 0.08 │
└─────────────────────┴───────┴──────┴───────┴──────┴──────┘

Now, let’s perform an OLS regression between the lrm and ide variables as an example:

ols -d danish_data.ide -i danish_data.lrm

You can also test the residuals for autocorrelation and heteroscedasticity by using commands such as bgod and bpag.

┌──────────┬─────────────────┐
│          │ Breusch-Godfrey │
├──────────┼─────────────────┤
│ LM-stat  │ 46.35           │
├──────────┼─────────────────┤
│ p-value  │ 0.00            │
├──────────┼─────────────────┤
│ f-stat   │ 37.02           │
├──────────┼─────────────────┤
│ fp-value │ 0.00            │
└──────────┴─────────────────┘
┌──────────┬───────────────┐
│          │ Breusch-Pagan │
├──────────┼───────────────┤
│ lm-stat  │ 26.48         │
├──────────┼───────────────┤
│ p-value  │ nan           │
├──────────┼───────────────┤
│ f-stat   │ 50.15         │
├──────────┼───────────────┤
│ fp-value │ 0.00          │
└──────────┴───────────────┘

What are OpenBB Jupyter features?

The OpenBB Jupyter features allow the user to create notebook templates that can be run on different tickers. This level of automation speeds up your investment thesis investigation. OpenBB comes with some pre-built Jupyter templates.

How to do behavioral sentiment analysis with OpenBB?

To do behavioral sentiment analysis with OpenBB, you can access the ba submenu that has useful functions that can obtain sentiment scores from Twitter, news outlets, capture trends, and more. For example, let’s gauge the headlines sentiment of AMZN:

stocks/ba/load AMZN
headlines

Some of the additional features that you can explore in the Behavioral Analysis section are the following:

  • snews – stock price displayed over the sentiment of news headlines
  • wsb – shows what the Reddit WallStreetBets are up to
  • reddit_sent – searches ticker through Reddit to find its sentiment
  • stalker – stalks Stocktwits user’s last messages
  • infer – infers stocks sentiment from the latest tweets
  • queries – returns top-related queries with the stock
  • rise – shows top rising queries related to the stock
  • jcdr – shows Jim Cramer’s daily recommendations
  • mentions – interest over time-based on stock mentions
  • and much more

How to do quantitative analysis with OpenBB?

To do quantitative analysis with OpenBB, you will need to access the qa submenu and utilize functions that are categorized into statistics, plots, rolling metrics, risk, and others. For example, let’s load the Dropbox stock and compare its Beta to Box:

stocks/qa/load DBX
beta -r BOX

As another example, let’s check the trend and seasonality of DBX:

decompose

Some of the additional features that you can explore in the Quantitative Analysis section are the following:

  • Statistics
    • summary – brief summary of the stock
    • normality – normality stats and tests
    • unitroot – unit root test for stationarity (ADF, KPSS)
  • Plots
    • line – line plots
    • hist – histograms with density plots
    • cdf – cumulative distribution function
    • bw – box and whisker plots
    • and more
  • Rolling Metrics
    • rolling – rolling mean and standard deviation (SD)
    • spread – rolling variance and SD
    • quantile – rolling median and quantile of prices
    • skew – rolling skewness of distribution of prices
    • kurtosis – rolling kurtosis of the distribution of prices
  • Risk
    • var – display value at risk
    • es – display expected shortfall
    • sh – display sharpe ratio
    • so – display sortino ratio
    • om – display omega ratio
  • Other
    • raw – print raw data
    • decompose – decomposition in cyclic-trend, season, and residuals of prices
    • cusum – detects abrupt changes using cumulative sum algorithm of prices
    • capm – capital asset pricing model
    • beta – display beta w.r.t to any reference ticker

How to do technical analysis with OpenBB?

To do technical analysis with OpenBB, you will need to access the ta submenu and utilize its functions which are categorized into overlap, momentum, trend, volatility, volume, and custom. For example, let us load BTC data and plot the Bollinger Bands for it:

crypto/ta/load BTC
bbands

For another example, let’s show the stochastic oscillator:

stoch

Some of the additional features that you can explore in the Technical Analysis section are the following:

  • Overlap
    • ema
    • sma
    • wma
    • hma
    • zlma
    • vwap
  • Momentum
    • cci – commodity channel index
    • macd
    • rsi
    • rsp – relative strength percentile
    • stoch
    • fisher
    • cg – centre of gravity
    • clenow – clenow volatility adjusted momentum
  • Trend
    • adx
    • aroon
  • Volatility
    • bbands
    • donchian
    • kc
  • Volume
    • ad – accumulation/distribution line
    • adosc – chaikin oscillator
    • obv – on balance volume
  • Custom
    • fib

What is OpenBB Automation and Scripting?

OpenBB Automation and Scripting provides commands and pipeline capabilities to speed up investment research using .openbb files. It can also serve as documentation. Scripts can be executed with the exe function followed by the script’s name.

How to write your automated script in OpenBB?

To write your automated script in OpenBB, you will need to add a script to the routines folder. They are written the same way that you would use the terminal and end in the .openbb file extension. You can copy and edit existing scripts or create new ones.

It is important that any of your scripts remain inside of the routines folder in order to be executable by the OpenBB Terminal. Below is a simple script that takes an asset symbol as an argument and shows insider trading stats:

# 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]

# Go to insider trading
ins

# Show insider stats
stats

These scripts can be as simple or complicated as for your needs.

What is the OpenBB Bot?

OpenBB Bot is a chatting bot for investment research that provides access to financial data for investors and online communities. It can be added to your Telegram or Discord for ease of use and has over 100 commands to interact with.

How to use OpenBB Bot with Telegram?

To use OpenBB Bot with Telegram, you can start chatting with it by accessing the following URL. Click on the Menu to see all the available options and parameters they require. For example, let’s ask for some information about ETH.

Where can I learn more about OpenBB?

To learn more about OpenBB, I advise visiting their website, reading the documentation, and checking out their GitHub repo.

Igor Radovanovic