Analyze historical intraday stock data
This tutorial is a step-by-step guide on how to collect, store, and analyze intraday stock data with TimescaleDB.
This tutorial has a few main steps:
You create a table that is capable of storing 1-min candlestick data. 2. Fetch and ingest stock data
You learn how to fetch data from the Alpha Vantage API and ingest it into the database in a fast manner. 3. Explore stock market data
After all the plumbing work is done, you can see several ways to explore stock price points, lows and highs, price changes over time, symbols with the most daily gains, candlestick charts, and more!
Prerequisites
- Python 3
- TimescaleDB (see installation options)
- Alpha Vantage API key (get one for free)
- Virtualenv (installation:
pip install virtualenv) - Psql or any other PostgreSQL client (for example, DBeaver)
Get started: create a virtual environment
It’s recommended to create a new Python virtual environment to isolate the packages used throughout this tutorial.
2. mkdir intraday-stock-analysis
4. cd intraday-stock-analysis
6. virtualenv env
8. source env/bin/activate
Install Pandas within the virtual environment:
2. pip install pandas
