Load cryptocurrency prices directly from the web and create an interactive candlestick chart using Altair.
Follow along with the exercise
Pre-requisites
Installed and configured miniconda. See either Up and running with miniconda and pycharm on macOS or Up And Running With Miniconda And PyCharm On Windows.
After that, get the required code and notebook from the github repo by doing this:
git clone git@github.com:cpbotha/altair_basic_charting.git
cd altair_basic_charting
conda env update
conda activate vxuni_altair
jupyter lab
You should now be looking at a live version of the notebook in your browser.
Overview 00:16
- Load tabular data from the web: Cryptocurrency prices.
- Create candlestick + volume charts using Altair.
- Compose charts.
- Digging into Altair source and Vega lite docs in order to:
- Make the composite chart pannable and zoomable.
Load tabular data from the web 00:46
- Copy and paste into spreadsheet, import that into pandas.
- Even quicker:
pandas.read_html()
What is a candlestick chart? 04:58
- Candlesticks show opening, closing, high and low prices.
- Green when price has gone up, red otherwise.
Building candlestick charts with Altair 06:39
Adding pan and zoom to the composite chart 17:47
Conclusion 25:23
- Summary.
- See you next time!