top of page

Algorithmic Trading using Python

60 horas = 20 encontros de 3 horas cada.

REUNIÃO 1 - Introdução ao Python - Part 1

1 - Chapter 1. Why Python for Finance

2 - Chapter 2. Python Infrastructure

3 - Chapter 3. Data Types and Structures

4 - Chapter 4. Numerical Computing with NumPy

​

​

REUNIÃO 2 - Introdução ao Python - Part 2

1 - Chapter 5. Data Analysis with pandas

2 - Chapter 6. Object-Oriented Programming

3 - Chapter 7. Data Visualization

​

​

REUNIÃO 3 - Chapter 8. Financial Time Series - Part 1

1 - Financial Data

2 - Rolling Statistics (a decades-old trading strategy based on technical analysis is using two simple moving averages (SMAs). The idea is that the trader should go long on a stock (or financial instrument in general) when the shorter-term SMA is above the longer-term SMA and should go short when the opposite holds true)

3 - Logarithmic Returns

4 - OLS Regression

​

​

REUNIÃO 4 - Chapter 8. Financial Time Series - Part 2

1 - Correlation Analysis

2 - High-Frequency Data

 

​

REUNIÃO 5 - Chapter 9. Input / Output Operations  and  

                       Chapter 10. Making Python Code Fast

1 - Chapter 9. Input / Output Operations

2 - Chapter 10. “Loops” (Python loops and how to speed them up)

3 - Chapter 10. “Algorithms” (standard mathematical algorithms that are often used for performance benchmarks, such as Fibonacci number generation)

4 - Chapter 10. “Binomial Trees” (The binomial option pricing model is a widely used financial model)

 

​

REUNIÃO 6 - Chapter 10. Making Python Code Fast

1 - Chapter 10. “Monte Carlo Simulation” (Similarly, Monte Carlo simulation is widely used in financial practice for pricing and risk management. It is computationally demanding)

2 - Chapter 10. “Recursive pandas Algorithm” (This section addresses the speedup of a recursive algorithm based on financial time series data. In particular, it presents different implementations for an algorithm calculating an exponentially weighted moving average (EWMA)).

​

​

REUNIÃO 7  - Mathematical Tools in Finance

1 - Chapter 11. “Approximation” (Regression and interpolation are among the most often used numerical techniques in finance)

2 - Chapter 11. “Convex Optimization”

3 - Chapter 12. “Random Numbers”

​

​

REUNIÃO 8  - Python to Implement Methods from Stochastics

1 - Chapter 12. “Simulation” (In finance, two simulation tasks are of particular importance: simulation of random variables and of stochastic processes)

2 - Chapter 12. “Valuation” (valuation of derivatives with European exercise and American exercise)

3 - Chapter 12. “Risk Measures” (Simulation lends itself pretty well to the calculation of risk measures like value-at-risk, credit value-at-risk, and credit valuation adjustments).

 

REUNIÃO 9 - Statistical and Machine Learning Approaches - Part 1

                        (Chapter 13. Statistics)

1 - “Normality Tests” (a large number of important financial models, like modern or mean-variance portfolio theory (MPT) and the capital asset pricing model (CAPM), rest on the assumption that returns of securities are normally distributed. Therefore, this chapter presents approaches to test a given time series for normality of returns)

​

​

REUNIÃO 10 - Statistical and Machine Learning Approaches - Part 2

                         (Chapter 13. Statistics)

1 - “Portfolio Optimization” - PARTE 1 (MPT (Modern Portfolio Theory) can be considered one of the biggest successes of statistics in finance. Starting in the early 1950s with the work of pioneer Harry Markowitz, this theory began to replace people’s reliance on judgment and experience with rigorous mathematical and statistical methods when it comes to the investment of money in financial markets. In that sense, it is maybe the first real quantitative model and approach in finance.)

​

​

REUNIÃO 11 - Statistical and Machine Learning Approaches - Part 3

                         (Chapter 13. Statistics)

1 - “Bayesian Statistics” (on a conceptual level, Bayesian statistics introduces the notion of beliefs of agents and the updating of beliefs to statistics. When it comes to linear regression, for example, this might take the form of having a statistical distribution for regression parameters instead of single point estimates)

​

​

REUNIÃO 12 - Statistical and Machine Learning Approaches - Part 4

                         (Chapter 13. Statistics)

1 - “Machine Learning” - PARTE 1 (Machine learning (or statistical learning) is based on advanced statistical methods and is considered a subdiscipline of artificial intelligence (AI). Like statistics itself, machine learning offers a rich set of approaches and models to learn from data sets and create predictions based on what is learned)

​

​

REUNIÃO 13 - Chapter 15. Trading Strategies - Part 1

1 - Trading Strategies (focuses on the use of methods from statistics and machine learning to derive algorithmic trading strategies; also shows how to use vectorized backtesting)

2 - “Simple Moving Averages” (this section focuses on an algorithmic trading strategy based on simple moving averages and how to backtest such a strategy)

3 - “Random Walk Hypothesis” (this section introduces the random walk hypothesis)

​

​

REUNIÃO 14 - Chapter 15. Trading Strategies - Part 2

1 - “Linear OLS Regression” (this section applies linear OLS regression to predict the direction of market movements based on historical log returns. Log returns — in contrast to prices — are stationary in general, which often is a necessary condition for the application of statistical and ML algorithms. The basic idea behind the usage of lagged log returns as features is that they might be informative in predicting future returns)

 

​

REUNIÃO 15 - Chapter 15. Trading Strategies - Part 3

1 - “Mean Reversion” (for example, one might hypothesize that after two downward movements an upward movement is more likely (“mean reversion”), or, to the contrary, that another downward movement is more likely (“momentum” or “trend”). The application of regression techniques allows the formalization of such informal reasonings)

2 - “Clustering” (in this section, we explore using unsupervised learning algorithms to derive algorithmic trading strategies)

​

​

REUNIÃO 16 - Chapter 15. Trading Strategies - Part 4

1 - “Frequency Approach” (this section introduces a simple frequentist approach for algorithmic trading)

2 - “Classification” (here we look at classification algorithms from machine learning for algorithmic trading)

3 - “Deep Neural Networks” (this section focuses on deep neural networks for algorithmic trading)

 

​

Reunião 17 - Chapter 16. Automated Trading - Part 1

1 - “Basic Concepts” (the chapter assumes that a single automated algorithmic trading strategy only shall be deployed. This simplifies, among others, aspects like capital management, backtesting for performance and risk, online algorithms, and deployment)

2 - “Capital Management” (as this section demonstrates, depending on the strategy characteristics and the trading capital available, the Kelly criterion helps with sizing the trades)

​

​

Reunião 18 - Chapter 16. Automated Trading - Part 2

1 - “ML-Based Trading Strategy” (to gain confidence in an algorithmic trading strategy, the strategy needs to be backtested thoroughly both with regard to performance and risk characteristics; the example strategy used is based on a classification algorithm from machine learning as introduced in Chapter 15)

​

​

Reunião 19 - Chapter 16. Automated Trading - Part 3

1 - “Online Algorithm” (to deploy the algorithmic trading strategy for automated trading, it needs to be translated into an online algorithm that works with incoming streaming data in real time)

2 - “Infrastructure and Deployment” (to run automated algorithmic trading strategies robustly and reliably, deployment in the cloud is the preferred option from an availability, performance, and security point of view)

​

​

Reunião 20 - Chapter 16. Automated Trading - Part 4

1 - “Logging and Monitoring” (to be able to analyze the history and certain events during the deployment of an automated trading strategy, logging plays an important role; monitoring via socket communication allows one to observe events (remotely) in real time)

Referência: 

 

Yves Hilpisch, “Python for Finance: Mastering Data-Driven Finance”, O'Reilly Media; 2nd Edition (January 8, 2019).

​

​

bottom of page