Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.48 KB

File metadata and controls

53 lines (38 loc) · 2.48 KB

Build an AI Trading Bot with Python (Backtesting, No Real Money)

Companion repository for the Code with Antonio video course · Watch on YouTube.

Build an AI trading bot with Python and backtest it with no real money: yfinance data, a classic strategy and GPT-6 Luna.

What you'll build

A bot that downloads real S&P 500 prices, tests a classic moving-average strategy, asks GPT-6 Luna every day whether to buy, sell or hold, and puts both against buy & hold in an honest backtest with $10,000 of fake money.

Lessons

# Lesson Video Folder
1 What is an AI trading bot? 0:00 lessons/01-what-is-an-ai-trading-bot
2 Real market data with yfinance 3:00 lessons/02-real-market-data-with-yfinance
3 A classic strategy and your first backtest 6:01 lessons/03-a-classic-strategy-and-your-first-backtest
4 Let the AI decide 9:42 lessons/04-let-the-ai-decide
5 Don't let the AI cheat 13:29 lessons/05-don-t-let-the-ai-cheat
6 AI vs. the classics: the backtest 17:02 lessons/06-ai-vs-the-classics-the-backtest
7 Read the results honestly 19:21 lessons/07-read-the-results-honestly

Requirements

  • Python 3.14 · uv 0.12.21 · yfinance 1.7.0 · Backtesting.py 0.6.6 · pandas 3.0.6 · openai 3.22.1 · gpt-6-luna · Ubuntu (Linux)
  • Python 3.12+ and uv

Run the final project

cd app
uv sync
uv run data.py
uv run backtest.py
cp .env.example .env   # add your OPENAI_API_KEY
uv run --env-file .env signals.py

Repository structure

README.md          this file
lessons/           one folder per lesson: goal, timestamp, commands and files exactly as in the video
app/               the final working project
assets/            thumbnail

License

MIT — use it for anything, credit appreciated.


Generated on 2026-10-02 from the course scripts. Code with Antonio · AI tutor.