For those interested in pursuing a career in
#quant
research, here's a guide to the essential skills and foundational knowledge required:
A) Programming language:
-Python
-C++/Rust/Java
-Bash
-SQL/NoSQL
B) Mathematics:
-Linear algebra
-Probability and statistics
-Multivariate
Did you read "The Man Who Solved the Market" by Gregory Zuckerman hoping to uncover Jim Simons' hidden secrets?
Perhaps you tuned in to Jim discussing Markov Chains, Baum-Welch, and other algorithms in interviews from the early days...
2 facts:
-The first one is a book
Some lessons learned from my
#quant
career:
-Better data before better models
-Edge before win rate
-Antifragility before robustness
-More data, more alpha
-More complexity, more overfitting
-May your training data is not enough
-May your probabilities are not uniform
-In
Some realities about portfolio construction and hedge funds:
A) Markowitz's mean-variance optimization:
-It continuous being the most common technique
-It introduces errors and provides misleading results
-High past returns and low
correlations don't persist over time
-There is
I'll save you time.
This is a list of
#ML
models that don't work or do it pretty poor compared with simple
#trading
models when you use price to feed them:
-Decision trees
-Random forest
-SVMs
-k-Nearest Neighbors
-Logistic regression
-Naive Bayes (Gaussian, multinomial,
Implied volatility is calculated by taking the market price of the option, entering it into the Black-Scholes formula, and back-solving for the value of the volatility. Here the drawbacks of doing in that way:
-Assumes constant values for the risk-free rate of return and
Thorp’s first hedge fund, Princeton Newport Partners, never had a down year. Let's talk about "a man for all markets":
-He discovered an options pricing formula before the Black-Scholes model became public
-He started the first ever quant hedge fund
-He was the first to use
GARCH models are widely used in
#trading
. Indeed a lot of
#QTS
use it but there are multiple pitfalls to take into account:
-It assumes stationarity
-It also assumes deterministic volatility based on past returns
-Model instability facing high volatile conditions
-You can't rely
Market manipulation can be detected using
#ML
techniques. As you know it influences prices and
#trading
activity. Here's a list of most common activities:
-Spoofing
-Layering
-Front running
-Insider trading
-Wash trading
-Marking the open, close, fix
-Pump and dump
-Churning
Companies like Two Sigma, Citadel, AQR, Point72, and others have large numbers of individuals, teams, and diverse profiles. In contrast, small
#trading
firms and family offices typically find their ideal team composition to include the following members:
-A skilled data scientist
The
#ML
models used in prop
#trading
firms rely mainly on the activity and state of the order book to come to the price prediction. They tend to use features such as:
-Quantity in order book
-Price trend
-Volatility
-Order book imbalance
...
Some
#quants
usually approach
#trading
by looking for
#ML
algorithms that allow them to profit from the market. They work at stage 1 (beginner) & level 1 (technology) of structure. However, a true systematic approach involves multiple levels:
-Structure
-Function
-Formalization
#Quants
use
#trading
strategies powered by
#ML
approaches. Here a sequence of the main operational processes of any system:
-Tracking assets
-Identifying potentialities
-Portfolio selection & opt.
-Algorithmic decision
-Triggering multi-signal
-Optimal execution
-Coordinated
Do you want to know why there is so much secrecy in
#trading
? It's the same reason why the education sector, at best, teaches how to get Beta returns. However, they will never teach you how to generate alpha. Today I'm going to tell you something that might upset more than a few
Normally, any quant is more concerned with things like signal, identifying inefficiencies, parameter optimization, the new
#ML
model... and a long etc.
But there are other aspects of trading that are also crucial.
Sometimes I wonder what would happen if brokers, instead of
Everybody knows about
#clustering
. This unsupervised
#ML
technique has many applications in
#trading
(eg. Group features before feature selection). Here a list with the most popular algorithms and the geometry (metric used):
...
In algorithmic
#trading
a portfolio is a type of ensemble that combines the outputs from multiple systems. The question here is what type of outputs?
-Basically the PnLs generated from each system
-The target is:
•To reduce the total variance
•Better performance than
During a recent conversation with a fellow
#quant
, we delved into the potential drawbacks of employing a
#Markovian
model for analyzing a limit order book. Here is a summary of our discussion:
...
The hedge fund industry performed poorly for the past decade, besides management and performance fees have been falling for a long time. You already know what it is, a vehicle that pools capital. Are you interested in creating your own?
First and foremost, there are several
Here are some key considerations regarding feature selection and their impact on the
#ML
model:
-High feature correlation is common in
#trading
-The lower the correlation, the better
-Correlations evolve over time
-Features can be completely orthogonal
-Excessive feature
Many papers in financial
#ML
treat stock returns as i.i.d. data. A simple example is modeling stock prices, Pt, as a random walk:
Pt=Pt−1+ϵt
Where ϵt, the returns, are i.i.d. with mean 0 and variance σ^2 (not necessarily normal). Here some important issues about that:
-Time
If you think that using
#Markov
chains on price is worthy because Jim Simons said he used it for
#trading
in an interview, think twice. Traditional Markovian staff is pretty useless in that way because:
-The standard model sucks
-Price data sucks
If prices were to follow a
To frame
#trading
as a rule extraction problem isn't something new. I know many practitioners applying
#ML
techniques to solve it (even builders) but eventually the result is GIGO. Here the pitfalls:
-Use the wrong factor (only price)
-Use the same factor but transformed multiple
The strategy of Eigenportfolios derived from the principal components of a set of returns and it is based on linear algebra concepts:
-It is constructed by taking an eigenvector and using its components as weights for the assets in the portfolio
-The idea is that each
Bayesianism is the new quant opium, the latest broken toy of
#ML
. Its exquisitely designed models to avoid overfitting will make your
#trading
systems bleed money. Sorry, but someone had to say it.
Bayesian methods have specific features that try to make the system more robust
There are seven easy steps to follow when creating a
#trading
system. If you're starting out in this field, take a look at the common structure that any algorithmic system should have:
A. Data Ingestion and processing:
-Connect to market data sources or APIs
-Receive and parse
Peter Brown, chief executive of
#Renaissance
Technologies, after taking over in 2009 said:
"We discovered that many people were doing jobs that could be automated so Renaissance we set out on a massive campaign to automate back-office operations."
This could remove some of the
Ask most quants or PMs from hedge funds about negatively skewed returns,
and you may be surprised at their aversion to such distribution characteristics.
Negatively skewed returns are typically generated from:
-Strategies that sell volatility
-Strategies that have
positive
In
#trading
, pattern mining research goes further than simply apply a decision tree, random forest, boosting or bagging algorithm.
The common methodology used by
#quants
where
#ML
provides some value is based on 3 key pillars:
-Pattern types --> What
-Mining methods --> How
Nowadays "quant" is a very broad term in the industry and the categories have definitely shifted over the years. Especially since the game is different from 90's (more competition, stricter regulation, stronger AI, smarter people...).
Let's see the typical
#quant
profiles:
-Desk
To make
#trading
systems run as efficiently as possible, you need an IT ecosystem that’s tuned for ultra low-latency communications. The options are:
-First option: A datacenter located in the exchange (Equinix LD4)
-Second option: Your own network switch engineered for high
Is your
#trading
system random? Knowing this information is important. How can traders build trading systems based on
#ML
and be confident that their results aren't random flukes? Let's see:
-Make sure to base your trading system on theoretical principles (before you begin to
Where do you get the data for your models? As a
#quant
, you don't have many choices. The most popular ones are:
-Option 1: You get data from your broker
-Option 2: You get data from free sources
-Option 3: You pay for data
-Option 4: Your organization has data lakes
The most
Mistakes in
#trading
means losses, every insignificant detail counts. When it comes to pre-processing market data in
#ML
there are some typical pitfalls:
-Scaling the entire dataset before splitting it into train and test = leakage of future information into the past
...
Yesterday, I was in a discussion with several members of the trading community about the lack of serious efforts to implement new rule extraction algorithms since 1995. Why is that? Even the current winner of the World Cup
#Trading
Championshipsrelies on this type of algorithm.
Everyone is familiar with Marcos López de Prado's book, Advances in Financial Machine Learning, right!?
What you find on the internet are different opinions about it:
-Good reviews from academics and quants (probably because they feel part of that community and none of them want
Ask any practitioner that is starting using
#ML
in
#trading
, it's always the same: Plug & play. They use XGBoost or similar directly over y=price, X=features from price. The ML technique should be use in a level of abstraction different from the main model. Let's see...
First
As a quant you are always immersed in the cutting-edge landscape of financial technology and data science. Your role involves leveraging mathematical models and algorithms, so in the realm of
#ML
and MLOps, one critical subset that garners significant attention is ModelOps:
-It
If you can't automate your
#trading
, you are probably gambling.
The goal of
#MLOps
teams is to streamline the integration of
#ML
models into the primary software infrastructure, aiming for full automation of the entire trading workflow process:
-Eliminating the need for manual
When any
#quant
develop a
#trading
strategy he is looking for --> Excess of returns / Unit of risk. This is directly connected with two concepts:
-Alpha: Excess return of a strategy relative to the return of a benchmark
-Beta: Strategy's volatility relative to a benchmark
Some facts about
#trading
systems based on
#ML
:
-82% of projects remain unrealized
-Only 20% of signals are successfully brought to market
-78% of projects experience a halt at some point before deployment
-84% of
#QTS
acknowledge the complexity of training ML with price data
The core principles of quantitative
#trading
revolve around utilizing mathematical and statistical models:
-The more structure you impose in the trading model, the fewer parameters you need
-The less parameters, the more efficiently your model cut through noise
...
Everybody knows about the k-means procedure right? A lot of
#quants
use it for their
#trading
systems.
However not all the implementations are the same. I will compare the batch implementation with the online and sequential versión.
Here the standard procedure:
-We have n
Where do you find alpha?
-Alpha is not in the data
-Alpha is not in the model
-Alpha is not in the execution
-Alpha is not in the technology
-Alpha is in relationships
Do you really know what you are mining? Some examples of relationships where one trader gets alpha but not the
Perhaps this scenario rings a bell: someone shows you a backtest that's perfect in-sample, but once the system goes live, it starts losing money.
Have you considered Noise Test Optimization? This method is widely used by
#quants
to randomly add noise to historical price data:
If you are using
#NNets
in your
#trading
system, it is essential to calibrate them properly. Here some techniques that you can use:
-For softmax outputs, divide the logits by a learned temperature parameter
-You can train a separate logistic regression model on top of the neural
Formulaic alphas are mathematical expressions that transform raw financial data into quantitative signals:
-These alphas are constructed using a variety of mathematical operations and are designed to extract meaningful patterns and features
-They are defined as 𝑓(⋅), transforms
Here some advices if you are starting in algorithmic
#trading
using a
#ML
approach:
-Thoroughly plan your trading system from the outset
-Opt for simplicity in your codebase by using fewer libraries wherever possible
-Avoid pandas, as it introduces performance bottlenecks
...
Building
#trading
systems have two basic phases and need two essential roles in MLOps:
-Model development & data scientists
-Model deployment & data engineers
This subfield is based on:
MLOps = DataML + DevOps
Where we have the DataML loop for model development:
-Formulate
Structured prediction in
#trading
requires searching over a combinatorial number of structures. The goal is to predict market micro-structured & trends rather than individual labels. However there are some issues:
...
Traditional
#ML
faces certain limitations when applied in
#trading
, including
-Presuming a fixed, unchanging environment
-Being developed on a static dataset
-Expecting data distribution to remain unchanged post-deployment
-Struggling to incorporate new information and adapt to
Many
#trading
practitioners may think that a backtest alone is sufficient for transitioning from development to live. Neglecting to assess the strategy from multiple perspectives can result in significant and rapid losses.
First a definition: A backtest is a historical
Uncertainty pervades every stage of the
#ML
pipeline, including:
-Data preprocessing
-Feature engineering
-Model training
-Model prediction
-Model deployment
In data-driven ML methods, uncertainty arises from:
-The intrinsic ambiguity in the data
-Variations in sampling
-Flawed
Here a list of common lessons observed in
#trading
systems utilizing
#ML
approaches:
-ML models provide no easy paths to profitability or improved execution
-It provides a powerful and principled framework for trading optimization, system coordination, meta-systems...
-Price
There is a bad habit among quants that can be defined with one word: Parameters... parameters, parameters, and more parameters:
-As the parameters increase, the
#trading
model becomes more and more complex (=overfitting)
-However, not having parameters doesn't help either
In algorithmic
#trading
, particularly for
#HFT
, several key issues arise:
-Determining the most effective order size for execution
-Identifying the optimal strategy for order placement over a specified time period
-Understanding the effects of executing these orders
To delve
Let's review the Avellaneda-Stoikov market-making algorithm:
-Stoikov addressed the inventory risk problem in
#MM
-It calculates a new reference price for creating buy and sell orders
-It considers the execution probability, price impact, and inventory risk to determine this
I will try to remove
#HFT
hype.
Nowadays it is based on:
-The use of extremely high-speed infrastructure for generating, routing, and executing orders
-The use of individual data feeds from exchanges as well as co-located servers in order to minimize network and other types of
When we talk about algorithmic
#trading
there are so many problems to solve. The most typical are related to:
-Market impact and liquidity
-Execution and latency
-Data quality and integrity
-Operational costs
-System reliability
-Portfolio management and turnover
-Quantitative
Here a summary of the
#Markovitz
's curse. One of the biggest failures in
#portfolio
#optimization
.
#PMs
know about it, but who cares, right? Let's see the pitfalls:
-It computes multiple objective functions, weighted by coefficients where the choice of these weights influences
Some realities about portfolio construction and hedge funds:
A) Markowitz's mean-variance optimization:
-It continuous being the most common technique
-It introduces errors and provides misleading results
-High past returns and low
correlations don't persist over time
-There is
A complete
#trading
project consists of numerous components and can be quite intricate. Here is a brief compilation of key considerations to keep in mind when implementing the
#ML
side:
A) Pre-modeling
-Validity of scientific question
-Unrepresentative samples
-Sample size
Predicting confidence intervals & mean reversion
#trading
strategies are 2 faces of the same coin. Here the most popular methods and some considerations to take into account:
-Bayesian methods: No marginal validity, only scalable with approximate inference, no validation set
...
Imagine you're running a Python-based prototype of a potential
#trading
system. After hours of operation, the OS begins to slow down, which is quite annoying (overall when using unefficient
#ML
libraries). This slowdown is often related to how Python handles memory management.
One key concept in
#ML
applied to
#trading
is the stability-plasticity dilemma:
-Plasticity refers to the ability of a learning model to quickly adapt to changes in the market data. It is related to the speed at which the model can adjust its parameters because of drift
...
In the initial stages of designing low-latency
#trading
systems, every quant faces similar questions:
-Is more efficient to process labels as integers, floats, or strings (1, 1.0, or '1')?
-What about the features? {1,0,1}, {1.0,0.0,1.0}, 101, '101', etc ?
-May a mix of numbers
Today is about one simple approach that you can find in any
#ML
and econometric arsenal: Penalized regression**
When running a regression, especially one with many predictors, the results have:
-A tendency to overfit the data
-Reduce out-of-sample predictive properties
#Trading
rules extracted from
#ML
algorithms, such as Random Forest, are often deemed spurious due to the inherent characteristics of non-stationary and non-I.I.D. data, which exhibit dynamic temporal shifts and evolving patterns. Strategies based solely on such rules fail to
#Trading
model drift can be categorized into several broad categories:
-Concept drift:
a) Posterior class probability P(Y|X)
b) Conditional covariates: P(X|Y)
-Data drift: covariates P(X)
-Label drift: prior probabilities P(Y)
To deal with them you need to understand
Ask any quant or discretionary trader; they are all focused on how to set up a strategy, how to test it, what data to use, on which assets, risk management... and there is one point that always gets left out, the hierarchy of the strategies and their degree of formalization to
In the contexts of
#trading
and
#ML
, alpha, edge, and expected value are interconnected concepts that help in assessing the potential success and profitability of strategies or models. Here’s how they relate to each other:
Edge → Expected value → Alpha
In other words:
Let's say we have a bunch of market features represented as a feature vector x = [x1, x2, ... , xd]. Often, many of these features don't add much value in telling apart different classes.
For example, we might have d = 100 features, but we might be able to classify X just about
Correct me if I'm wrong but every
#quant
wants:
-Suitable
#trading
model
-Successful architecture
-Best hyperparameters
But it depends strongly on:
-The trading task
-Data domain
-Available market data
So maybe you're wondering, "why has my
#DL
model stopped learning?" Let's
A fellow told me once: "You might run out of money, but never out of memory". Though said in jest, there's truth to it:
-Every
#quant
needs to build models that are efficient in memory usage
-Effective memory management is crucial for achieving low latency
-Speed is directly
The first line of defense against uncertainty is diversification. It is a risk management strategy used to reduce your chances of experiencing large losses and risk exposure:
-Market risk
-Liquidity risk
-Model risk
-Data risk
-Systematic risk
-...
The literature is quite
It is quite common to find quants overusing ensemble methods, regardless of whether they are junior or senior. However, it is much rarer to see them designing multi-agent
#trading
systems based on cooperation. So let's talk about it, because it's on everyone's lips.
Multi-agent
#Trading
systems are distributed systems, that means they work by sending and receiving information between independent units (data vendors, brokers, platforms...). This fact has created two interconnected paradigms:
-Message centric --> Order routing
-Data centric --> Modeling
May one of the hottest topics in
#trading
is eFPGA or embedded FPGA:
-It embeds one or more FPGAs in the form of IP into chips such as ASIC, ASSP, or SoC
-This IP can be licensed for use, and its use is similar to other IPs used in semiconductor design
In other words, an eFPGA
There are multiple
#trading
styles, some of them more effective than others. If I were to choose two top guys for learning and embarking on a new career as a
#quant
, they would be:
-Jim Simons because of the quantitative models (& talented team)
-Navinder Singh Sarao because of
I read this sentence today: "
#Trading
is less about knowledge and more about being attentive; to the market, to the price, and to oneself..." and I couldn't help but remember the book Fooled by Randomness by Nassim Taleb.
Here are some of my favorite quotes that make this
Every
#quant
wants to know how risky their system is and what is the chance to lose a part of the account or the entire balance. This situation is called the risk of ruin and it is a well known problem in probability theory.
Many of them talk about maximum drawdown, as if there
There is only one premise when you try to apply
#ML
to
#trading
: Always start with a basic model, no exceptions.
Let's start with the fundamentals. In most quantitative approaches:
-If a basic model performs well, you avoid the hassle of setting up a more complex model
-If it
The value formula in the
#trading
business is based on:
(Trackrecord • current ROI)
V = -----------------------------
(Speed • Risk)
Let's talk about the denominator:
-Speed = Faster
-Risk = Riskless
The best way to face this problem is based on a
You might want to hire for your
#trading
business roles like:
-Data Engineers
-Data Scientists
-Data Architects
That will mean creating a "talent pipeline". But what is a data architect? And how does he fit in this field?
-A data architect is an IT professional role responsible
During the last two decades
#quants
have promoted the use of custom hardware to efficiently drive
#trading
systems based on compute-intensive
#ML
tasks.
However this type of trading models compute using floating-point arithmetic. The pitfall here is that floating-point formats
Boosting and bagging are both ensemble techniques used by
#quants
. Probably the most popular ones...
Both of them are
#ML
approaches that use multiple learners to solve the market direction. Let's start with boosting:
-Combines weak learners sequentially into a strong learner
Price transformations as features -> Price as labels or targets -> Feed your
#ML
model and voila = Loses
Why? The "only" reason is noise.
In ML, "noise" is defined as:
-Random or unpredictable variations in data
-Disruptions in identifying target patterns or relationships
Yesterday, I was talking with a fellow about how absurd it is to learn
#trading
in courses. There are interesting topics with extremely high utility but whose application is intended for other contexts:
-In general terms, trading books are no better
-It makes more sense to read a
To effectively deploy your
#trading
system amidst a high volume of incoming data, robust processing techniques are essential.
The true value lies in the efficiency of this processing, presenting two distinct paths in
#ML
:
-Lambda architecture
-Kappa architecture
The basic
The volatility of a portfolio that is compound with multiple independent
#trading
systems can be influenced by various factors. Here are some of them and the reason why you may experience a wide range of non-linear volatility conditions:
-Correlation among systems
-Asset
Monte Carlo method can be used for
#trading
simulation. The popular applications are:
-For the robustness test
-To add disturbances while keeping the structural shape
-To create specific scenarios and regimes
-To avoid historical data
-To optimize parameters based on noise
Dichotomic pattern mining is a specific area within the field of data mining that focuses on identifying patterns in data that can be split into two distinct labels {-1,1}:
-This method is particularly useful to extract alpha from events
-The goal is to identify relationships
Different
#quants
might have different understanding of the terms statistical models,
#ML
and data-driven models. First things first:
-All Statistical models are data-driven
-All ML models are data-driven
-Not all data-driven models are ML
So basically data-driven is a category
Why are traders making more money than others? Because of these four reasons:
-More predictive factors
-More effective models
-Faster execution
-Lower costs
Let's focus on the second aspect. So the question is: Why are models better than others?
Better learning --> Better loss
Thinking about applying
#ML
to your
#trading
workflow? Ok, here some tips:
-Avoid using ML at the beginning
-Explainable ML means no edge
-Money is in unexplainable patterns
-Focus on non-intuitive trading signals
-Avoid understandable technical rules
-Searched for “overlooked”
There are 5 key areas in
#trading
where
#ML
makes a real difference. The integration of them in your system will redefine your strategies and streamlines operations:
-Systems selection
-Switch off systems
-Auto-repair systems
-Systems coordination
-Efficient order execution
Economic data stinks, period. Especially time series data. They’re not like the toy datasets you find in other sectors:
-If your data isn’t I.I.D., forget about modeling it with
#ML
-If it’s not interchangeable, forget about modeling it with ML
Using features based on technical
From time to time, some troll with a bruised ego always writes to me, telling me that "algorithmic
#trading
doesn't work, that I've lost money applying
#ML
to OHLC" and such... Do they really think they are right? Let's see!
Algorithmic trading utilizes software and hardware to