From Python from scratch to trading on a real broker
Advanced · Technical track · levels 1–13
Level 1: Foundations of Algorithmic Trading
Before any strategy you have to understand the playing field: how an algorithmic trading system is designed from end to end, which variables really move the price, what alternative data is, the two great schools of financial modeling, and who is competing against you in the market every single day.
- 1. Designing an algorithmic trading system: the ten stages
- 2. Price, volume and return: the three variables you will see on every chart
- 3. Volatility, the spread and the order book: the price of buying right now
- 4. Alternative data: the edge off the price chart
- 5. Two ways of understanding the market: mathematical models and statistical models
- 6. Who really moves the market: the types of investor
- 7. Twelve trading approaches: which tool each type of strategy uses
Level 2: Python from Scratch for Finance
All the Python you need before touching a single strategy: variables, data structures, control flow, functions and classes, and the two libraries you will be using constantly — NumPy for vectorized computation and matplotlib for visualizing your data.
- 1. Setting up your environment: Python and its tools
- 2. Variables, data types and operators
- 3. Data structures: strings, lists, tuples and dictionaries
- 4. Control flow: loops and list comprehensions
- 5. Functions, classes and error handling
- 6. NumPy: arrays and vectorized computation on prices
- 7. Visualizing data with matplotlib: your first price chart
Level 3: Market Data and APIs
From nothing to real prices on your own machine: downloading and plotting data with yfinance, generating your first trading signal with the MACD, working with all 500 companies in the S&P 500 at once, and connecting to cryptocurrency exchanges safely.
- 1. Downloading historical prices with yfinance
- 2. Candlesticks, moving averages and your first technical chart
- 3. Your first real trading signal: the MACD crossover
- 4. Professional data providers: beyond Yahoo Finance
- 5. Downloading the full S&P 500: web scraping and data cleaning
- 6. Cryptocurrency trading with Python: ccxt, the universal exchange translator
- 7. The Binance API and keeping your keys safe
Level 4: Stock Screening
Turn a trading criterion into a programmed filter: Mark Minervini's Trend Template step by step, a bounce screener built on EMAs and the stochastic, a third filter combining momentum and value, and an honest look at what a screener can and cannot tell you.
- 1. What a stock screener is and why it saves you time
- 2. Mark Minervini's Trend Template: the 8 conditions of a strong trend
- 3. Computing the Relative Strength Rating: comparing each share with the market
- 4. Programming the full Minervini filter: from 500 shares to a short list
- 5. Oscillators: EMA and stochastic to spot bounces
- 6. Combining momentum and value: MACD, RSI and the P/E ratio
- 7. The limits of any screener: what a list of tickers does not tell you
Level 5: Momentum, Mean-Reversion and Pairs Trading Strategies
The major families of algorithmic strategies: trend and momentum (betting that the move continues), and mean reversion and pairs trading (betting that it comes back). You will code your first complete strategy with a backtest, a z-score applied to a single asset, and a screener for cointegrated pairs.
- 1. Trend strategies: going with the market's flow
- 2. Momentum: betting that what goes up keeps going up
- 3. Your first complete strategy: the moving average crossover
- 4. Two moving average crossover: the dual strategy
- 5. Mean reversion: the price returns to its average
- 6. Z-score: when a price is too high or too low
- 7. Pairs trading: the difference, not the direction
Level 6: Regression and Pricing Models
From fitting a line in Python to the models that explain why an asset returns what it returns: regression channels in technical analysis, the CAPM, factor investing and the Fama-French model, estimated with statsmodels on real market data.
- 1. Linear regression in Python: three libraries, three philosophies
- 2. Regression channels: the trend and its volatility
- 3. The linear regression indicator against the moving average
- 4. CAPM: the price of systematic risk
- 5. Factor investing: the Fama-French models
- 6. statsmodels in practice: from prices to factor regression
- 7. Reading the output: coefficients and t-stats
Level 7: Rigorous Statistical Diagnostics
The assumptions holding up a regression and how to check whether your model meets them: the Gauss-Markov theorem, standard errors, confidence intervals, hypothesis testing, R squared and residual diagnostics (heteroscedasticity, autocorrelation and normality).
- 1. The key assumptions of regression
- 2. Properties of OLS and the Gauss-Markov theorem
- 3. Standard errors and confidence intervals
- 4. Hypothesis testing: the null, t and the p-value
- 5. Goodness of fit and the traps of R squared
- 6. Residual diagnostics and heteroskedasticity
- 7. Autocorrelation, normality and standardized residuals
Level 8: Time Series - Stationarity
The real playing field of any quantitative strategy: how to prepare a financial time series, build features with lags and rolling windows, read an autocorrelation plot, and decide with the augmented Dickey-Fuller test whether a series is stationary or whether you are simply looking at a random walk dressed up as a signal.
- 1. Preparing time series data: from price to return
- 2. Feature engineering: lags and rolling windows
- 3. Visualization: distributions and scatter plots
- 4. Autocorrelation plots: ACF and PACF
- 5. Moving averages and the parts of a time series
- 6. Stationarity, Dickey-Fuller and cointegration
- 7. Evaluating models: persistence and residuals
Level 9: Time Series - ARIMA and GARCH
From the linear trend to autoregressive models, ARIMA and the ARCH/GARCH family, all the way to building an ARIMA+GARCH strategy on the S&P 500 with walk-forward validation.
- 1. From the linear trend to autoregressive AR(p) models
- 2. Fitting an AR in Python: order with AIC and BIC
- 3. Forecasting with AR: intervals and walk-forward
- 4. Moving average (MA) models: modeling the error, not the level
- 5. ARIMA: integration, fitting and rolling-window forecasting
- 6. Conditional heteroskedasticity and ARCH(p) models
- 7. GARCH(p,q) and the ARIMA+GARCH strategy on the S&P 500
Level 10: Machine Learning Applied to Trading
The serious entry into machine learning for trading: why almost every ML algorithm is at heart an optimization problem, how the goals of econometrics differ from those of ML, how the terminology of one discipline translates into the other, and the four broad types of learning (supervised, unsupervised, semi-supervised and reinforcement). We finish by coming back to linear regression with machine learning eyes and stretching it as far as polynomial regression.
- 1. Optimization, the heart of machine learning
- 2. Econometrics versus machine learning: two different goals
- 3. What machine learning is, exactly
- 4. Supervised learning: learning with a teacher
- 5. Unsupervised and semi-supervised learning
- 6. Reinforcement learning: agent, environment and reward
- 7. From linear regression to polynomial regression
Level 11: Neural Networks for Trading
Neural networks properly explained: what they are, how they are fitted, and how backpropagation works from the inside. You will code a network from scratch in NumPy and another with Scikit-Learn, understand autoencoders versus PCA, and build three complete strategies: a neural network that predicts a stock's move, an SVM that classifies market regimes, and a KNN of daily signals.
- 1. Beyond linearity: what a neural network is
- 2. The sigmoid and the error function you are going to minimize
- 3. Backpropagation: gradient descent and chain rule
- 4. A network in NumPy and another with Scikit-Learn
- 5. Autoencoders and PCA: reducing dimensions
- 6. Case study 1: a neural network for one stock
- 7. Case studies 2 and 3: SVM for regimes and a KNN strategy
Level 12: Backtesting and Real Risk Metrics
Learn to simulate a strategy on historical data with Backtrader, to read the results chart, and to judge it with honest performance and risk metrics. This is the level where you stop fooling yourself with backtests that look too good.
- 1. Optimizing without fooling yourself: what a backtest really is
- 2. Anatomy of a backtest with Backtrader
- 3. Real costs: commissions, slippage and position sizing
- 4. Reading the backtest chart: price, trades and equity
- 5. A complete case: Bollinger Bands with RSI
- 6. Performance and risk metrics that actually matter
- 7. Analyzers, pyfolio and out-of-sample validation
Level 13: Connecting to Real Brokers
The final step of the course: going from simulation to the market. REST, FIX and WebSocket APIs, signed authentication, sending limit orders, paper trading, error handling, monitoring, and the checklist to run before trading with real money.
- 1. From backtest to market: what changes when the money is real
- 2. APIs and communication protocols: REST, FIX and WebSocket
- 3. Authentication: signing every request with HMAC
- 4. Placing a limit order on Coinbase Pro
- 5. Paper trading, sandbox and the first real money
- 6. Errors, retries and reconnection in production
- 7. Logging, monitoring and final checklist: closing the course