
Follow three guidelines to succeed: use the q&a for any question, meet the prerequisites, and stay engaged by handwritten notes for conceptual lectures and coding for coding lectures.
Explore pairs trading intuition with mean reversion, using the price difference between two stocks as a signal to short one and long the other when they converge.
Fix the z-score computation by using rolling means and standard deviations for each asset, compute the spread's z score, and align long/short signals with Bollinger band bounds.
Rerun the code to validate the pair trading strategy, plot the asset positions, diagnose a bug in the spread z-score and bounds, correct normalization, and observe improved returns.
Extend the trading signal by maintaining long and short positions through mean reversion around Bollinger bands. Use pandas to replace zeros with NaNs and forward fill to sustain positions.
Learn why a long-only strategy fits mean-reverting signals, avoiding short selling risks with margins, and how Bollinger band rules trigger long entries and selling to close positions.
The long-only strategy, implemented in code, sets negative positions to zero and compares performance against buy-and-hold, showing reduced losses and outperformance versus short selling on several pairs.
Learn how to code a ChatGPT driven pairs trading bot by analyzing AI-generated code, fixing errors, and understanding synthetic data, publication bias, and common AI misconceptions.
Adopt test driven development to design a robust API, writing tests first to drive theory and code, balancing intuition, implementation, and self-directed learning.
Ask questions in the Q&A to stay on track, meet the course prerequisites, and implement state of the art algorithms in code to prove your understanding.
Hello friends!
As one of the original artificial intelligence and machine learning instructors on this platform, how could I not create a course on ChatGPT?
ChatGPT and its successor, GPT-4, have already begun to change the world. People are excited about new opportunities, and terrified of the potential impacts on our society.
This course combines 2 of my favorite topics: AI and finance (algorithmic trading).
The premise of this course is simple: use ChatGPT to build a trading bot (specifically, using pairs trading which is what I was interested in at the time).
Throughout the course, we will learn about the amazing capabilities of ChatGPT and GPT models in general, such as GPT-3, GPT-3.5, GPT-4, etc. We will learn about the many pitfalls of these models, and why you need to keep your guard up. These models do make mistakes, but we will learn how to deal with them. We will learn the best ways to make use of ChatGPT to help us be more efficient and productive.
Important consideration: Why not just ask ChatGPT yourself and forego this course? Sure, you can tell ChatGPT if you get an error and maybe it'll fix it, but that only works for syntax errors (errors that break the rules of the Python language). What you'll miss, if you don't have foundational knowledge in Python, finance, and statistics, is semantic errors (errors in logic and reasoning), because you won't even notice them in the first place. That is what it means to "keep your guard up", and that is one of the major lessons in this course, which I'm already seeing is very easy for people to miss!
So what are you waiting for? Join me now on this exciting journey! ( And maybe learn how to make some money in the process :) )
Suggested Prerequisites:
Decent understanding of Python and data science libraries (Numpy, Matplotlib, Pandas)
Basic understanding of finance (stock prices, returns, log returns, cumulative returns)