
Clarify learners' goals when they don't know whether this course fits their needs, exploring algorithmic trading with Python.
Apply the nonparametric run test to assess market efficiency by analyzing runs of positive or negative returns, estimating expected runs, and using a z statistic against a null hypothesis.
Explore how behavioral finance explains market inefficiencies through herding, anchoring, regret aversion, and the disposition effect, with examples like the 1987 crash, shaping trading decisions.
Implement a simple momentum, trend-following model called Alexander's filter in Python, trading long or short based on price reversals and running highs and lows on the S&P 500.
Explore Alexander's asymmetric filter with two stop losses—long side at 10.5% and short side at 13.5%—demonstrating in-sample gains and out-of-sample risks, with SciPy optimization for robustness.
Alexander's filter uses dynamic, vix-based stop losses—long side at 0.7 of the vix and short side at 1.2 times the vix—enhancing momentum trades on the S&P 500.
Build a breakout model by defining a binary dependent variable for uninterrupted uptrends or downtrends using a 10% threshold, and compute it with Python in two parts using for loops.
Apply logistic regression to predict binary breakout signals using relative position regressors, set a 0.5 decision threshold, and test predictions on in-sample and out-of-sample data for a breakout trading rule.
Define two-rule trading system from logistic regression signals, entering long at 0.7 and short at 0.3, with exits at 0.3 and 0.7, and optimize in-sample and out-of-sample returns.
Learn a mean reversion pairs trading rule for Brent crude oil and West Texas Intermediate, using logarithmic returns, a 30-day moving average, and a two-sigma trading signal.
Learn a mean-reversion pairs trading rule using standard deviation thresholds to trade Brent and WTI in Python, evaluate wealth index and max drawdown, and test parameter sensitivity.
Compute maximum favorable and adverse excursions in the factor model data frame, derive adjusted u max/min, then calculate u edge and d edge to guide long or short trading signals.
Apply a factor model rule: enter long at 0.9 and short at -0.9, exit at 0.6 and -0.6, with 5% stop, and assess cumulative return and maximum drawdown out-of-sample 2018–2022.
Apply the Kelly criterion to set the optimal bet size in trading, using win probability, capital fraction, and fractional Kelly to avoid ruin.
Backtest a gold-silver pairs trading model using a 120-day moving average and two standard deviations, and assess performance with rolling correlations and trade-level results.
This is a review of the jupyter notebook "Runs Test".
This is a review of the jupyter notebook "Alexander's filter single".
This is a review of the jupyter notebook "Alexander's filter multiple".
Demonstrates a Python-based pairs trading model using Brent and WTI prices, computing log returns, moving averages, and z-scores to generate trading signals and backtest performance.
Explore the factor model for algorithmic trading, detailing data prep with pandas, numpy, and plotly, forward-looking USD/CLP prices, and maximum excursions with percentiles and z-scores.
In the algorithmic trading course you will learn how to build momentum, mean reversion and factor models. This course is different from other algorithmic trading courses where you only learn to code some basic technical indicators such as MACD or Bollinger Bands. Here you will learn succesful real world trading models. You need to know Python. If you are a trader at an institution or an independent investor and you are quantitative oriented, this course is for you. Click on the enroll button and start learning.
If you want to understand the curriculum, the course is divided in 6 different topics:
1. Introduction: You will understand the concept of market efficiency and also why markets don't always behave that way. One of the main causes is related to behavioral biases. You will learn some of them. You will also learn a simple test to see if a market is efficient or not.
2. First Momentum Model - Alexander's filter: This is a trend following system that was proposed by a professor at MIT and was later refined by professional traders. We will explore different variants of the models. Here you will learn how to run optimizations on python to find the best parameters for the model.
3. Second Momentum Model - Break out model: This is a trend following system inspired in a trading rule that was very profitable in commodities markets. The rule was implemented by a group of traders known as the turtle traders. In this model you will learn how to run a logistic regression to predict the direction of a trend.
4. Mean Reversion Model - Pairs Trading: This is a mean reverting strategy using a pair of assets that are fundamentally related.
5. Factor Model: In this model you will learn how to select explanatory variables that can be used to build a successful trading strategy. This kind of models are used in high frequency trading strategies.
6. Final remarks: We will explain how to select optimal trading size based on the Kelly Criteria. We will also revisit backtesting methods.