Build and backtest your own trading strategies in Python.

Turn a trading idea into rules, test it against historical data, and automate paper trades. Follow the Masterclass’s recorded lessons from Python foundations to a complete momentum bot, with code you can run and adapt.

$599 once. Immediate access to the complete course.

New to Python? Start with the foundations. Already coding? Jump into market data, backtesting, and trading automation.

500+
students
6
course sections
66
lessons

momentum_backtest.ipynb

In [12]: run_backtest(strategy, prices)

return

24.8%

drawdown

-9.6%

trades

148

Out [12]: costs applied, no lookahead flags

paper orders

timesymbolsidestatus
09:31:04SPYbuyfilled
09:31:08TLTsellfilled
09:32:11GLDholdchecked
Example output. Not a performance record.

What students say

★★★★★
“As a beginner in algorithmic trading, I was surprised how quickly it was possible to automatically backtest a trading strategy and to create a trading bot in Python. The bot already works and executes orders (on a demo account).”
DDanielPython for Traders student
★★★★★
“I recently joined the Python for Traders course, and I have to say it's one of the best structured and professionally presented courses I've come across in the trading space. The content is well-organized, making it much easier to apply Python to real trading scenarios.”
MMoritzPython for Traders student

Projects you’ll build

Build a market-data database, a backtest report, a broker connection, and a complete paper-trading bot.

PROJECT 01

Daily price warehouse

SQLite / scheduled

symboldateopenclose
AAPL2026-08-20230.41234.12
MSFT2026-08-20507.22509.78
NVDA2026-08-20181.06183.44

5,700

symbols

OHLCV

history

Daily

updates

PROJECT 02

Backtest report

A repeatable process for measuring performance and checking the mistakes that can make a result look better than it is.

  1. 01Trading costs appliedPASS
  2. 02Signals shifted before entryPASS
  3. 03Drawdown measured from equityPASS
  4. 04Lookahead bias checkedPASS

PROJECT 03

Broker API layer

GET/v2/account200
GET/v2/positions200
GET/v2/stocks/quotes200
POST/v2/orders201

PROJECT 04

Momentum trading bot

  1. 01Select the stock universe
  2. 02Update and clean prices
  3. 03Calculate the signal
  4. 04Size positions and check risk
  5. 05Send and reconcile paper orders

config.py

UNIVERSE = 500

POSITIONS = 20

MAX_WEIGHT = 0.05

PAPER = True

The six-section roadmap

Start with Python, then work through trading concepts, market data, broker APIs, backtesting, and the final bot project. Expand a section to see the lesson titles.

Section 1

17 lessons

Python Foundations

A working research environment and your first market-data notebook.

Set up Python, notebooks, packages, and the core libraries used for market work.

Lessons

  1. Python 101
  2. Editors + Notebooks
  3. Package Managers
  4. Version Control
  5. AI Assistants
  6. Expressions + Variables
  7. Control Flow
  8. Data Structures
  9. Functions
  10. Classes
  11. List Comprehensions
  12. Pandas (Data Analysis)
  13. YFinance (Data Collection)
  14. Matplotlib (Data Visualization)
  15. Seaborn (Data Visualization)
  16. Sklearn (Machine Learning)
  17. Cheatsheet Download

Section 2

9 lessons

Quant Concepts

A framework for turning a trading idea into a testable rule.

Learn where systematic returns can come from and what the main strategy families are testing.

Lessons

  1. Excess Returns
  2. Risk Factors
  3. Mean Reversion
  4. Trend Following
  5. Growth + Value
  6. Sentiment Analysis
  7. Seasonality Effects
  8. Statistical Arbitrage
  9. Market Making

Section 3

15 lessons

Market Data

A reusable SQLite warehouse with daily prices for 5,700 stocks.

Design a database, build the data pipeline, and put daily updates on a schedule.

Lessons

  1. Data Providers
  2. Files and Databases
  3. Analyzing Market Data
  4. Database + Pipeline Project
  5. SQLite from Python
  6. DB Connection + Running SQL
  7. Designing Relational Tables
  8. Solution - Designing Relational Tables
  9. Creating the Full Schema
  10. Data Pipeline Design
  11. Extracting Data for 5700 Stocks
  12. Cleaning and Processing
  13. Loading into the Database
  14. Bringing It All Together
  15. Automating Collection with Cron

Section 4

9 lessons

Trading Automation

A broker layer connected to an Alpaca paper-trading account.

Read account data, positions, and quotes, then submit market and limit orders through an API.

Lessons

  1. Alpaca Markets
  2. Account and Position Data
  3. Real-Time Quotes and Trades
  4. Market and Limit Orders
  5. Architecture Overview
  6. Data Management
  7. Signal Generation
  8. Risk Management
  9. Trade Execution

Section 5

9 lessons

Backtesting

A backtest with performance reporting and bias checks.

Measure returns and risk, include costs, catch common biases, and test on a hosted engine.

Lessons

  1. Strategy Performance Metrics
  2. Avoiding Common Pitfalls
  3. Pandas + QuantStats
  4. QuantConnect Onramp
  5. Testing Simple Buy and Hold
  6. Our News-Based Strategy
  7. Adding Sentiment Analysis
  8. Constructing a Portfolio
  9. Putting Everything Together

Section 6

6 lessons

Capstone Project

A complete momentum bot that runs through a paper-trading workflow.

Combine the data, signal, portfolio, risk, and execution pieces in one final project.

Lessons

  1. Capstone Project
  2. Bot Configuration
  3. Stock Universe
  4. Data Manager
  5. Portfolio Management
  6. Putting Everything Together

66 self-guided lessons, including 64 videos totaling about 13 hours, with code examples and 15 downloadable references.

Tools used in the course

Use Python and pandas for research, yfinance for market data, QuantConnect for hosted backtests, and Alpaca for paper trading.

Python
pandas
yfinance
QuantConnect
Alpaca

Build a process you can use for your own ideas

Work through a complete trading project, then change the data, the dates, or the strategy rules. Understand each piece well enough to make it your own.

  • Collect and organize market data for repeatable research
  • Test a strategy with trading costs and risk in view
  • Connect the pieces in a working paper-trading bot

Start with Python foundations or go straight to the topics you need. Every section is available as soon as you join.

Frequently asked questions

Do I need to take the Challenge first?
No. The Masterclass starts with Python foundations. The Challenge is an optional smaller project if you want to try the teaching approach first.
How do I access the course?
Your purchase gives you immediate access to the full course library. Payhip emails your receipt and access instructions. Use My courses to return to your lessons whenever you want.
How are the lessons taught?
Follow the recorded videos, run the code examples, and use the notes and downloads as you build. Work through the course on your own schedule; live teaching and coaching are not part of the course.
How long does it take?
There are about 13 hours of video. Allow additional time to run the code and complete the projects. Work through the six sections on your own schedule.
Do I need a paid data subscription?
No. The course uses free data sources. It also explains when a paid source may be worth using.
What kind of strategy will I build?
The final project is a momentum trading bot that runs on a paper-trading account. You’ll learn to evaluate performance, costs, and risk, then adapt the process to research your own ideas. The examples are educational; profitability is not guaranteed.
Which broker do you use?
Alpaca. You use a free paper-trading account.

Put your next trading idea to the test

Build the skills to research a strategy, evaluate the results, and automate paper trades—with the complete Masterclass to guide you.

$599

One payment. Immediate access to every section.

$599

One payment. Full access.

Get the masterclass