Stock-Trading-Bot

Step-by-step tutorial to extract data, analyze, and decide on stocks in the market using Django, Celery, TimescaleDB, Jupyter, OpenAI, and more.

MIT License

Stars
3

Stock Trading Bot

Learn how to extract data, analyze, and decide on stocks in the market using Django, Celery, TimescaleDB, Jupyter, OpenAI, and more.

Tech Stack

Getting Started

Download the following:

Open a command line (Terminal, VSCode Terminal, Cursor Terminal, Powershell, etc)

Clone this Repo

mkdir -p ~/dev/stock-trading-bot
cd ~/dev/stock-trading-bot
git clone https://github.com/codingforentrepreneurs/Stock-Trading-Bot .

Checkout the start branch

git checkout start
rm -rf .git
git init
git add --all
git commit -m "It's my bot now"

Create a Python vitual environment macOS/Linux/WSL

python3.12 -m venv venv
source venv/bin/activate

windows powershell

c:\Path\To\Python312\python.exe -m venv venv
.\venv\Scripts\activate

Install requirements

(venv) python -m pip install -r requirements.txt

Docker Compose Up (for local TimescaleDB and Redis)

docker compose -f compose.yaml up -d

If you don't have Docker, use TimescaleDB Cloud and Upstash Redis

Create .env in project root

mkdir -p ~/dev/stock-trading-bot
echo "" >> .env

Add DATABASE_URL and REDIS_URL to .env (these are based on the compose.yaml file):

DATABASE_URL="postgresql://postgres:postgres@localhost:5431/postgres"
REDIS_URL="redis://localhost:6378"