Introduction to Comparison Analysis

The Comparison Analysis menu provides the user with tools for:

  • searching and populating a list of companies that are similar to the loaded ticker.
  • building a correlation matrix.
  • comparing the price and volume history of multiple companies.
  • comparing financial statements, technical performance, and ownership statistics of otherwise similar companies.
  • comparing sentiment of similar companies.
  • building a list of companies to use features from the Portfolio Optimization menu.

To use all features in this menu, the following API keys (free) must be obtained by the user:

It is not necessary to load a ticker from the stocks menu to use these features. Enter the Comparison Analysis submenu by typing ca and pressing ENTER (⏎).

Comparison Analysis Menu

How to use

To add a primary ticker, or to swap it for another, enter ticker AMZN. The three commands: getfinnhub, getpoly and getfinviz all provide a similar function. Sources may return different results.

(🦋) /stocks/ca/ $ getfinviz
[Finviz] Similar Companies: WMT, BIG, BJ, COST, DG, DLTR, OLLI, PSMT, TGT, TUEM

(🦋) /stocks/ca/ $ getpoly
[Polygon] Similar Companies: WMT, AMZN, COST, EBAY, DLTR, KSS, JCP, TGT, M, DG

(🦋) /stocks/ca/ $ getfinnhub
[Finnhub] Similar Companies: WMT, COST, BJ, PSMT

Using any of these commands will automatically populate the list of similar companies for analysis. Furthermore, add & rmv allows the user to make modifications, or create a list from scratch.

Get similar companies for analysis

To show a correlation matrix, use the hcorr command. The start dates can be modified, which changes the results, to show correlation over different periods. For example, obtain a one year correlation matrix with hcorr:

One year correlation matrix

Or, by adjusting the date, it is possible to define a correlation matrix with a different time horizon, e.g hcorr -s 2022-01-01:

YTD correlation matrix

The list of similar companies can be compared by a number of fundamental metrics.

valuation displays earnings and valuation multiples. Valuation

performance compares technical performance of similar companies: Performance

sentiment is a chart from Finbrain that shows sentiment over the last ten days. Performance

This list of similar companies can be imported directly to the Portfolio Optimization menu by using the command, po. PO Menu

Examples

The correlation matrix can also be used in other ways, like measuring sectors or asset classes. The chart below is a daily, price-normalized, comparison of S&P, NASDAQ, and BTC futures.

(🦋) /stocks/ca/ $ ticker F

(🦋) /stocks/ca/ $ historical -n

Historical

This is a chart of the NASDAQ 100 Index, and three different futures contracts that are trading against it.

(🦋) /stocks/ca/ $ set ^NDX,NQH23.CME,NQZ22.CME,NQ=F
[Custom] Similar Companies: ^NDX, NQH23.CME, NQZ22.CME, NQ=F

(🦋) /stocks/ca/ $ historical

Historical NASDAQ 100

Compare financial statements of the ten largest US banks.

(🦋) /stocks/ca/ $ set C,USB,WFC,JPM,TD,GS,PNC,TFC,BAC,COF
[Custom] Similar Companies: C, USB, WFC, JPM, TD, COF, PNC, TFC, BAC, GS
(🦋) /stocks/ca/ $ cashflow

Cashflow comparison of the ten largest US banks

Compare the income statements.

(🦋) /stocks/ca/ $ income

Income statements of the ten largest US banks

To run a demonstration of the commands presented here, in the OpenBB Terminal, run this command from the home menu: exe routines/comparison_demo.openbb