DEV Community

Cover image for #FOSS Fintech in Python: How To Use The Historical Command In The OpenBB Terminal!
Danglewood
Danglewood

Posted on

#FOSS Fintech in Python: How To Use The Historical Command In The OpenBB Terminal!

If it's historical, it's hysterical! Get your lolz on with this blast-from-the-past command.

historical: this command is used for comparison analysis of price history between two or more companies.

2022 Apr 09, 14:14 (πŸ¦‹) / $ /stocks/ca/historical -h

2022 Apr 09, 14:14 (πŸ¦‹) /stocks/ $ ca
2022 Apr 09, 14:14 (πŸ¦‹) /stocks/ca/ $ historical -h
usage: historical [-t {o,h,l,c,a}] [-n] [-s START] [-h] [--export EXPORT]

Historical price comparison between similar companies.

optional arguments:
  -t {o,h,l,c,a}, --type {o,h,l,c,a}
                        Candle data to use: o-open, h-high, l-low, c-close, a-adjusted close. (default: a)
  -n, --normalize       Flag to normalize all prices on same 0-1 scale (default: False)
  -s START, --start START
                        The starting date (format YYYY-MM-DD) of the stock (default: 2021-04-08)
  -h, --help            show this help message (default: False)
  --export EXPORT       Export raw data into csv, json, xlsx and figure into png, jpg, pdf, svg (default: )
Enter fullscreen mode Exit fullscreen mode

The screener is well suited for discovery and includes a path to the comparison analysis menu, where this command is found. The first step, from the stock screener, is to populate the terminal with some tickers.

/stocks/scr/set unusual_volume/
Enter fullscreen mode Exit fullscreen mode

Read the documentation here: https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/comparison_analysis/historical/

With a preset, like unusual_volume, the best results are obtained when the filters are applied to a logical category. We will use 'technical' here to rank the top five tickers with unusual volume, sorted by the trading volume of the current/last session.

technical -l 5 -s Volume
Enter fullscreen mode Exit fullscreen mode

Prints a table:

2022 Apr 09, 13:41 (πŸ¦‹) /stocks/scr/ $ technical -l 5 -s Volume
                                                       Finviz Screener                                                        
┏━━━━━━━━┳━━━━━━━┳━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━┓
┃ Ticker ┃ Beta  ┃ ATR  ┃ SMA20 ┃ SMA50 ┃ SMA200 ┃ 52W High ┃ 52W Low ┃ RSI   ┃ Price ┃ Change ┃ from Open ┃ Gap   ┃ Volume  ┃
┑━━━━━━━━╇━━━━━━━╇━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━┩
β”‚ MDVL   β”‚ 0.94  β”‚ 0.21 β”‚ 0.97  β”‚ 0.75  β”‚ -0.41  β”‚ -0.87    β”‚ 1.49    β”‚ 77.77 β”‚ 1.96  β”‚ 0.39   β”‚ 0.05      β”‚ 0.32  β”‚ 193.7 M β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ PHIO   β”‚ 1.84  β”‚ 0.18 β”‚ 1.67  β”‚ 1.72  β”‚ 0.63   β”‚ -0.18    β”‚ 2.36    β”‚ 90.36 β”‚ 2.35  β”‚ 1.59   β”‚ 1.67      β”‚ -0.03 β”‚ 110.9 M β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SBFM   β”‚ -2.34 β”‚ 1.32 β”‚ 0.75  β”‚ 0.32  β”‚ -0.62  β”‚ -0.90    β”‚ 2.99    β”‚ 57.73 β”‚ 6.03  β”‚ -0.38  β”‚ -0.20     β”‚ -0.22 β”‚ 90.1 M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ATER   β”‚       β”‚ 0.48 β”‚ 0.75  β”‚ 0.60  β”‚ -0.26  β”‚ -0.85    β”‚ 1.22    β”‚ 73.35 β”‚ 4.67  β”‚ 0.21   β”‚ 0.02      β”‚ 0.18  β”‚ 85.8 M  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TWTR   β”‚ 0.80  β”‚ 2.69 β”‚ 0.16  β”‚ 0.25  β”‚ -0.11  β”‚ -0.37    β”‚ 0.48    β”‚ 63.68 β”‚ 46.23 β”‚ -0.04  β”‚ -0.02     β”‚ -0.01 β”‚ 83.1 M  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

We can now see that the cache has been loaded with five tickers.
Read the documentation here: https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/comparison_analysis/historical/<br>

Now we can take these tickers to the comparison analysis menu

ca
Enter fullscreen mode Exit fullscreen mode

The Comparison Analysis Menu (https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/comparison_analysis/historical/)

Now using the daily command, historical, the chart below shows a normalized share price, targeting daily highs, and starting from Valentines' Day.

historical -t h -n -s 2022-02-14
Enter fullscreen mode Exit fullscreen mode

historical -t h -n -s 2022-02-14 (https://openbb-finance.github.io/OpenBBTerminal/terminal/stocks/comparison_analysis/historical/)

This should help you get started using the historical command in the OpenBB Terminal. Feel free to stop by the community Discord Server and ask questions, or just say hello!

https://discord.com/invite/Up2QGbMKHY

https://openbb.co

https://twitter.com/openbb_finance

Top comments (0)