Algorithms are an excellent way to invest without feelings taking over. One of the biggest disadvantages of trading is that emotions, such as panic or excessive enthusiasm, can trigger big mistakes. When we use mathematical or automated calculations, we can discount feelings. Here are some of the best quantitative trading techniques.
Algorithms based on order books.
There are several ways to know which orders are executed in the market or which ones are pending to be executed. In the blockchain economy they are public and easy to extract, to later make analysis or strategies, in relation to those orders. In contrast, when it comes to the stock market, these orders are not always public. There are companies that are dedicated to sell that information to investors and brokers. For example, Bloomberg or LSEG Data & Analytics, which sell this service, among others.

The sources from which these data are acquired can be very difficult to access. These types of algorithms, based on the order book, used in algorithmic trading and quantitative finance, can cost millions of dollars and the developers who make them earn large salaries. There are also cheating techniques to manipulate order books, such as Spoofing or simulating false trends. Other less ethical strategies can also be carried out, such as the identification of patterns of other investors or bots, in order to copy their strategies or invest against them, thanks to reverse engineering or retro-engineering.
An example of the advantage of having this information, could be the ability to make a large sale divided into several parts, taking into account the order book data, so that it affects as little as possible the value of the asset. Raising less suspicion on the trading volume.
For high-frequency trading, order book information is also used, taking advantage of small changes in price, finding moments to make arbitrage and more strategies based on the liquidity of the stock market.
Calculations based on mean reversions.
When calculating mean reversion, what is sought is to detect a certain change in the average price. After detecting that change, one sometimes looks for strategies that are based on the price returning to a situation closer to the mean or predicting changes in the price. Some calculations to find mean reversion:
- Simple moving average: the average of the prices of an asset, over a specific period of time, is calculated.
- Exponential moving average: similar to the simple moving average, but giving greater importance to prices of closer periods.
- Standard deviation: measures the dispersion of prices with respect to the moving average.
- AI algorithms: based on Machine Learning or Deep Learning. To determine when a price is not at its average and make price predictions.
- Based on Bollinger Bands: using a combination of moving average and standard deviation.
Stochastic calculation algorithms.
Stochastic calculus is part of a branch of mathematics, which is used to work with random systems. This branch is studied in the main universities of finance, especially in those that seek to teach quantitative finance. Since when it comes to making predictions with derivatives, it has been proven to be effective and has even been awarded to the wise men who made it public for the first time. Something that excites me and is very interesting to me is that there are probably a lot of mathematical techniques for making predictions that never come to light. That’s why I think that even though this has been made public, it doesn’t mean that there are thousands of private calculations and algorithms that are effective in the world of algorithmic trading.

Mathematics using stochastic calculus can also be used in other fields such as biology, in the development of Artificial Intelligence or physics, even Albert Einstein in 1905, was a pioneer in its application in physics. However, the first known use of stochastic calculus, was for the branches of finance, thanks to Louis Bachelier, who published in his thesis called: The theory of speculation (It is in French).
Time Series Analysis.
Simply put, one looks for patterns that are related to temporality, such as seasonality of harvests, trends in certain periods, cycles or periodic events in general. Without eating my head too much, I can share some assets on an impromptu basis, it could be Amazon shares at Christmas or commodities related to agriculture.
An infinite number of mathematical formulas can be used for this, such as seasonal decompositions or classification trees, among many other techniques. With a decomposition technique, trend, seasonality and residuals can be analyzed. Without getting too complicated, you can also calculate percentage returns and make a comparison.
The SARIMA (Seasonal Autoregressive Integrated Moving Average) model is used to make predictions of time series and seasonal factors. It is used to analyze the seasonal fluctuations of certain values. For example, applying this algorithm to a hotel business, we could calculate when it is in high season.
Time series with Prophet (Code)
Meta has developed its own library for time series forecasting. This technology can be used for businesses that have very seasonal sales, for the stock market, meteorology and more cases that include seasonality.
import io, os, sys, setuptools, tokenize
!pip install prophet
import pandas as pd
import yfinance as yf
from prophet import Prophet
import matplotlib.pyplot as plt
# Download stock price data
ticker = 'AAPL'
data = yf.download(ticker, start='2020-01-01', end='2024-08-26')
# Prepare data for Prophet
data.reset_index(inplace=True)
data = data[['Date', 'Close']]
data.columns = ['ds', 'y']
# Make sure 'ds' column has no timezone information
data['ds'] = data['ds'].dt.tz_localize(None)
# Create and tune the Prophet model
model = Prophet()
model.fit(data)
# Create a dataframe for the next 30 days
future = model.make_future_dataframe(periods=30)
# Make forecasts
forecast = model.predict(future)
# View forecasts
fig = model.plot(forecast)
plt.title(f'Pronóstico de Precios de Acciones de {ticker} para los Próximos 60 Días')
plt.xlabel('Fecha')
plt.ylabel('Precio en USD')
plt.show()
# Show forecasts
print(forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(60))
I have tested this code with Apple stock and it has been quite effective. It may have been a fluke, but it surprised me.
Relative Volume (RVOL).
Compares the current volume, with volumes from previous periods. When this calculation rises, it indicates that there is more liquidity than normal, around that value and this means that it could rise in price, for reasons such as “whales” are buying in recent days, as large investors who use a lot of volume, usually have insider information or better predictive tools. Different periods can be selected, such as, for example, comparison with 30 or 60-day periods.
Making predictions in relation to the level of volume is not always accurate. However, I can personally affirm that when the volume rises a lot, the price of the asset in question generally rises. It is important to anticipate and volume is a good way to do this.
It is not necessarily necessary to use this algorithm or indicator, you can make other calculations based on statistics or Machine Learning, which have the volume as an analysis factor. What I want to convey is that it is important to look at the volume and from there, create our own algorithms.
Pairs Trading Algorithms (Correlations)
One of the ways in which I have earned more money with trading and have had a higher success rate, is playing with correlations. For example, if there is a day that Bitcoin goes up a lot, with a small delay, Coinbase or MicroStrategy shares go up across the board. This is not a joke, you can get to earn very juicy amounts in a single day, with which to buy whims. If you have the mental fortitude to do swing trading, the profits can be impressive.

Correlations are easy to calculate, no advanced calculations are needed. The NumPy library is used in Python. Investors who are in the currency market, also tend to do so with countries that have a lot of wealth in commodities. For example, if one day gold or oil prices rise sharply, it is normal for countries with a lot of mining or oil deposits to see this reflected in their respective currencies. Even mining or oil shares, although this is not always the case. If we use algorithms to make correlations, we can measure correlations according to time bands and also detect them in a faster or automated way.
A company’s shares may be correlated with other shares. This can happen because one of them owns a large percentage of shares of the other or because they have common interests.
Can quantitative trading beat the indices?
Yes, there are several famous investors who have managed to outperform major indices such as the SP500 or the Nasdaq. One of the most famous has been Jim Simons, with his fund called Medallion (Renaissance Technologies), achieving an average annual return of 60%. Instead of hiring economists and accountants, he employed mathematicians and statisticians. Unfortunately, this fund is closed to retail investors, so ordinary people cannot take advantage of these great returns.

Jim Simons was a senior mathematician of Jewish origin, who had been a code breaker in the Cold War era. He later worked as a professor of mathematics at the most prestigious universities, such as Harvard and MIT, among others. He received awards for discovering important theories on the applications of geometry, which have served for the development of quantum physics and String Theory. After all, in the late 1970s, he decided to set up his own investment company (Renaissance Technologies LLC).
How to work in quantitative finance?
Before thinking about what to study to work in quantitative trading, it is necessary to know that there are different roles within this branch of work. The most popular roles are: quantitative trader in Front Office (they execute operations on the front line); Researchers who research the development of new strategies; Developers, who develop the software to perform operations, data analysis and other functions; risk managers who use quantitative analysis, portfolio managers and validators of quantitative strategy models. Not to mention the role of professors at top finance universities, some of which are very expensive and select.
Depending on each role, you will be required to study one thing or another. Generally it is necessary to learn English, with a C1 level, be a graduate with a high knowledge of mathematics and statistics, in addition to having specializations for the financial sector and mastery of programming languages such as Python, R or C++.
There is also the option of working as a freelancer, as a developer of automated systems, as a private tutor, in funding accounts or by making a direct return on private capital.
Tools and technologies for quantitative trading.
Some tools can help us improve our efficiency, compatibility and productivity.
Programming languages.
- C++: it is used in high frequency trading and algorithmic trading. This language is very fast. Speed can become very important in certain strategies. Even if it is milliseconds.
- Python and R: are languages widely used and compatible with mathematics, data analysis and Artificial Intelligence. Python is currently the most widely used language in the world, at the backend level (internal architecture).
- Databases: both SQL and NoSQL are essential for some strategies.
Platforms and utilities.
- Anaconda: it is a suite that gives us a better compatibility with some libraries and tools, when we want to run programs in Python or R. Especially for Data Analysis functions and scientific uses. Its package manager (Conda) is really useful, giving less problems when installing conflicting libraries.
- Claude, ChatGPT and Copilot: there are very good reviews of Claude, from people who are very much into the world of quantitative finance. These AI tools save a lot of time on the development side.
- Visual Studio: is an IDE for software development, with great support for plugins and programming languages.
- Excel: still used in the financial and corporate industry. It is still very useful and has new improvements.
- MetaTrader: trading software that supports automated algorithms and its own programming language (MQL).
Bloomberg Terminal.

With a cost of approximately $25,000 per year, it is the most widely used tool in the investment world. Let’s say that it is the working machine of the main companies and investment banks. It offers an infinite number of utilities, from sending orders, accessing exclusive data and information, obtaining important notifications and calendars, to chatting with other professionals in the sector or even making restaurant reservations.
My personal opinion.

My personal opinion about quantitative trading and its application in investment strategies is not entirely positive. Since we should not forget that other simpler methods can also offer great benefits, such as those shared by Warren Buffet. However, I am also a geek of software development and philosophy, so I find it a very interesting world. What does philosophy have to do with all this? Philosophers like Pythagoras or René Descartes, looked for the meaning of life in mathematics.