Ready to Start Learning?

Sign in to check if you already have access, or get started with a purchase or membership.

Stock Trading Bot with Python and Django

Extract time-series stock market data and analyze with Django and Celery

0:00
11/15/2024
Build a Stock Trading Bot with Python and Django.
The goal is to learn how to ingest large amounts of data quickly using Django and Postgres. To do this, we create custom Python api clients to get near real time data thanks to both Polygon and Alpha Vantage.
Storing this data requires a special kind of Postgres -- time series optimized. We use Timescale for this exact reason (as well as their django-timescaledb package).
Once we have a lot of data, we use built-in Django tools to analyze it and then provide automated recommendations via simple logic and OpenAI's GPT-4.
To make all this work, I cover a lot of different topics including:
✅ Django for Time Series Data
✅ TimescaleDB Integration with Django via Docker Compose
✅ Django & Timescale Cloud Integration
✅ Connect to Polygon.io and Alpha Vantage APIs
✅ Use Jupyter to rapidly prototype Python and Django Code
✅ Transform timestamps and date strings into timezone aware data
✅ Integrate Django & Jupyter
✅ Process near real-time market data
✅ Store time series data at rapid speed with TimescaleDB
✅ Calculate key technical indicators via Django ORM and Database Queries
✅ Build and schedule automated async functions with Celery worker and beat server processes
✅ Create trading signals and recommendations
✅ Leverage AI/LLMs for market analysis
✅ And much more
⭐️ Thanks to Timescale for sponsoring this course! If you sign up with my link so they know I sent you: https://tsdb.co/justin

Tech Stack

☑︎ Python 3.12
☑︎ Django 5.1
☑︎ TimescaleDB Cloud (or Docker version)
☑︎ Django Timescaledb (pip install django-timescaledb)
☑︎ Celery worker and beat server (pip install celery)
☑︎ Python Requests (pip install requests)
☑︎ Jupyter (pip install jupyter)
☑︎ Psycopg Binary (pip install psycopg[binary])
☑︎ Python Decouple (pip install python-decouple) to load environment variables (e.g. .env)
☑︎ Stock Market data from Polygon.io and Alpha Vantage
☑︎ OpenAI

References

Stock Trading Bot with Python and Django

Lifetime access to this course

or get access to 500+ courses with a membership