
Explore algorithmic trading and time series analysis with Python and R, covering moving averages, RSI, backtrader testing, volatility models, mean reversion, and machine learning.
Learn why Python is the go-to high-level, readable language for algorithmic trading and time series analysis, backed by vast libraries for scientific computing, machine learning, and data science.
Install python from python.org on windows, using the default option for version 3.11.1, add python to the path, and verify it via environment variables.
Install python, set up PyCharm as the integrated development environment, download the community version, configure the python 3.11 interpreter, create a new project, and run a script that prints hi.
Install the R programming language and the RStudio integrated development environment, following step-by-step Mac OS download and install procedures, then verify with a simple print test.
Identify and compare fundamental, technical, and quantitative analyses in trading, analyzing intrinsic value, price patterns, and mathematical models like stochastic differential equations and Black-Scholes to manage risk.
Define stocks as ownership and shares as units, showing capital raised through future profits and how stock prices fluctuate with supply and demand, volatility, and dividends.
Explore commodities like oil, gold, and natural gas and their volatile prices. Understand futures contracts, future markets, and diversification with mining shares to hedge inflation.
Explore currencies and the forex market, define exchange rates, and analyze how central banks influence currencies, using a two-dimensional currency table and a graph-based arbitrage detection with negative cycles.
Compare long and short positions, showing how buying aims to profit from rising prices while short selling profits from declines, with risks in bear and bull markets.
Explore how the simple moving average indicator smooths price data, filters noise, and signals bullish or bearish trends using fast and slow moving averages.
Learn to download stock data from Yahoo! Finance using Python, install yfinance, and fetch adjusted closing prices for a ticker between set dates, exporting to a pandas dataframe.
Learn how simple moving averages identify trend directions and define support and resistance levels, with uptrends showing support and downtrends defining resistance.
Implement moving average indicators in Python by downloading adjusted closing prices from Yahoo Finance and computing short and long simple moving averages. Analyze crossovers and visualize results with plots.
Apply exponential weighting to compute the exponential moving average with a recursive formula, where recent prices carry more weight than earlier ones, helping identify trend directions and support or resistance.
Implement exponential moving average using pandas ewm with a span and adjust to be false, deriving alpha from the span and computing the weighted mean; apply to IBM stock data.
Implement a moving average crossover strategy with fast and slow moving averages. Open long positions on bullish crossovers and close on the next crossover, illustrating the golden cross.
this lecture implements the moving average crossover trading strategy by fetching data from Yahoo! Finance, computing long and short moving averages, and simulating trades to build an equity curve.
Construct fast and slow moving average indicators from adjusted closing prices using exponential weighted moving averages, generate crossover signals, and visualize a moving average crossover trading strategy.
Implement a moving average crossover trading strategy in Python and R by simulating long positions, opening on a short-to-long MA cross and closing on cross, tracking the equity curve.
Plot the equity curve from a moving average crossover strategy, calculate profit from capital changes, and explore how time series analysis and autocorrelation reveal when this approach works.
Explore the relative strength indicator, a 0-100 momentum oscillator that uses a 14-day average gain and loss to reveal bullish or bearish momentum and overbought or oversold conditions.
Implement a from-scratch relative strength index using Yahoo! Finance data, computing log daily returns, moves, and 14-day average gains and losses to derive RSI and identify overbought or oversold conditions.
Compare arithmetic and logarithmic returns, define daily returns from stock prices, and explain how logarithmic returns normalize data and yield stationary series for machine learning and time series analysis.
Combine moving average and relative strength indicators into an RSI trading strategy using short and long EMAs and Yahoo Finance adjusted prices to generate signals and track equity.
Demonstrates building a moving average crossover system with RSI, generating and plotting signals, and evaluating equity and profit for IBM data.
Combine moving average crossovers with the relative strength index to trigger long positions when RSI signals oversold (below 30), tested on IBM 2015–2020.
Understand the Sharpe ratio as a risk-adjusted performance measure for trading strategies, linking excess return, risk-free rate, and volatility to portfolio quality.
Compute the Sharpe ratio of a moving-average–RSI trading strategy using daily returns, annualize over 252 trading days, and assess profitability from equity and profit data.
Explore backtrader, a Python open-source framework for strategy development on historical data for testing, with indicators like moving averages and RSI, and Cerebro to compute Sharpe ratio and annualized return.
Install the backtrader library, configure the project interpreter, and import backtrader. Instantiate Cerebro, brain of the backtrader framework, feed Yahoo Finance data, and run the strategy to analyze Sharpe ratio.
Learn to build a Backtrader strategy by subclassing the Strategy class, initialize a 15-period simple moving average, and implement the next method to process data fed through Cerebro.
Apply the Backtrader moving average indicators to implement a fast and slow crossover strategy, using buy and close signals on Yahoo Finance data to manage long positions.
Analyze a moving average crossover strategy with Backtrader and print results using Cerebro analyzers, including the Sharpe ratio, annualized return, and maximum drawdown.
Learn to customize the backtrader framework by setting initial capital with cerebro broker, overriding cash, and retrieving portfolio value. See how 0.01% commissions affect final capital in a practical example.
combine momentum and simple moving average indicators to build a long-only strategy on s&p 500, ranking stocks by 90-day exponential regression momentum and sizing positions with the average true range.
Learn how the average true range indicator measures volatility and guides position sizing, using true range calculations and a 14-period average to adjust investment size and avoid highly volatile assets.
This course is about the fundamental basics of algorithmic trading. First of all you will learn about stocks, bonds and the fundamental basic of stock market and the FOREX. The main reason of this course is to get a better understanding of mathematical models concerning algorithmic trading and finance in the main.
We will use Python and R as programming languages during the lectures
IMPORTANT: only take this course, if you are interested in statistics and mathematics !!!
Section 1 - Introduction
why to use Python as a programming language?
installing Python and PyCharm
installing R and RStudio
Section 2 - Stock Market Basics
types of analyses
stocks and shares
commodities and the FOREX
what are short and long positions?
+++ TECHNICAL ANALYSIS ++++
Section 3 - Moving Average (MA) Indicator
simple moving average (SMA) indicators
exponential moving average (EMA) indicators
the moving average crossover trading strategy
Section 4 - Relative Strength Index (RSI)
what is the relative strength index (RSI)?
arithmetic returns and logarithmic returns
combined moving average and RSI trading strategy
Sharpe ratio
Section 5 - Stochastic Momentum Indicator
what is stochastic momentum indicator?
what is average true range (ATR)?
portfolio optimization trading strategy
+++ TIME SERIES ANALYSIS +++
Section 6 - Time Series Fundamentals
statistics basics (mean, variance and covariance)
downloading data from Yahoo Finance
stationarity
autocorrelation (serial correlation) and correlogram
Section 7 - Random Walk Model
white noise and Gaussian white noise
modelling assets with random walk
Section 8 - Autoregressive (AR) Model
what is the autoregressive model?
how to select best model orders?
Akaike information criterion
Section 9 - Moving Average (MA) Model
moving average model
modelling assets with moving average model
Section 10 - Autoregressive Moving Average Model (ARMA)
what is the ARMA and ARIMA models?
Ljung-Box test
integrated part - I(0) and I(1) processes
Section 11 - Heteroskedastic Processes
how to model volatility in finance
autoregressive heteroskedastic (ARCH) models
generalized autoregressive heteroskedastic (GARCH) models
Section 12 - ARIMA and GARCH Trading Strategy
how to combine ARIMA and GARCH model
modelling mean and variance
+++ MARKET-NEUTRAL TRADING STRATEGIES +++
Section 13 - Market-Neutral Strategies
types of risks (specific and market risk)
hedging the market risk (Black-Scholes model and pairs trading)
Section 14 - Mean Reversion
Ornstein-Uhlenbeck stochastic processes
what is cointegration?
pairs trading strategy implementation
Bollinger bands and cross-sectional mean reversion
+++ MACHINE LEARNING +++
Section 15 - Logistic Regression
what is linear regression
when to prefer logistic regression
logistic regression trading strategy
Section 16 - Support Vector Machines (SVMs)
what are support vector machines?
support vector machine trading strategy
parameter optimization
APPENDIX - R CRASH COURSE
basics - variables, strings, loops and logical operators
functions
APPENDIX - PYTHON CRASH COURSE
basics - variables, strings, loops and logical operators
functions
data structures in Python (lists, arrays, tuples and dictionaries)
object oriented programming (OOP)
NumPy
Thanks for joining my course, let's get started!