Skip to content

Knowledge library

Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.

Quant Q&A
20,364 documents
SuperMind
12,226 documents
OKX Learn
8,431 documents
Strategy library
7,910 documents
MQL5 code base
7,090 documents
BigQuant
3,481 documents
Bitget Academy
3,298 documents
MQL5 articles
3,012 documents
TradingView scripts
1,976 documents
ProRealCode
1,507 documents
Deribit Insights
1,232 documents
Machine Learning for Trading
1,124 documents
arXiv papers
1,033 documents
Amberdata research
766 documents
FMZ forum
682 documents
FMZ digest
662 documents
vn.py community
560 documents
QuantInsti blog
511 documents
Galaxy Research
340 documents
QuantStart
246 documents
Stratmill research code
219 documents
Robot Wealth
195 documents
NautilusTrader
191 documents
Hummingbot docs
181 documents
Paradigm research
175 documents
Lumibot
164 documents
Kraken Learn
163 documents
Quant course library
157 documents
OctoBot
152 documents
Cryptohopper blog
144 documents
Systematic trading blog (Rob Carver)
132 documents
Qlib
116 documents
TqSdk
86 documents
Quantpedia
86 documents
Hyperliquid docs
79 documents
Freqtrade
68 documents
Hudson & Thames
62 documents
Awesome Systematic Trading
61 documents
backtrader
54 documents
vn.py
50 documents
Quantopian lectures
45 documents
Binance API docs
45 documents
FMZ guides
38 documents
pysystemtrade
34 documents
Freqtrade docs
32 documents
quant-trading
31 documents
FinRL
28 documents
Zipline
22 documents
FMZ live strategies
21 documents
Jesse
17 documents
pyfolio
16 documents
Alphalens
14 documents
WonderTrader
14 documents
backtesting.py
11 documents
Technical Analysis
9 documents
QTPyLib
8 documents
QuantRocket
7 documents
Lumibot strategies
7 documents
Awesome Quant
1 documents

Search the library

63 documents

Stratmill research code

This implementation describes a threshold-based rule for a cointegrated pair. It opens a long-spread trade when the spread falls to or below a lower entry level, or a short-spread trade when it rises to or above an upper entry level. A trade closes when the…

Pairs tradingMean reversionRisk managementExecution
Stratmill research code

This code module outlines methods for constructing sparse portfolios intended to exhibit mean reversion. It includes Box–Tiao canonical decomposition, greedy support selection, semidefinite optimization under volatility constraints, and sparsity methods…

Mean reversionPortfolio constructionStatisticsMachine learning
Stratmill research code

The document describes a software implementation of the Johansen cointegration method for forming mean-reverting portfolios from asset prices. It computes cointegration vectors, orders them by eigenvalue, and converts each vector into hedge ratios normalized…

Mean reversionStatisticsPortfolio construction
Stratmill research code

This strategy uses copulas to estimate conditional probabilities between two assets’ daily returns. It accumulates each probability’s deviation from 0.5 into a mispricing index flag, intended to translate return dependence into a measure of how prices have…

Pairs tradingStatisticsMean reversionBacktesting
Stratmill research code

This module implements analytical trading calculations for an Ornstein–Uhlenbeck mean-reverting process, following a published statistical-arbitrage model. Given an entry threshold, an exit threshold, and transaction costs, it computes expected trade length,…

Mean reversionArbitrageStatisticsRisk management
Stratmill research code

The document presents a framework for trading a mean-reverting portfolio, often formed by holding one asset and shorting another. It models portfolio value with an Ornstein–Uhlenbeck process, estimates the long-run mean, reversion speed, and volatility by…

Mean reversionPairs tradingStatisticsRisk management
Stratmill research code

The module implements the two-step Engle–Granger approach to constructing a portfolio intended to be mean reverting. It uses ordinary least squares to regress a chosen dependent asset’s price on the other price series, defaulting to the first input column as…

Pairs tradingMean reversionStatisticsPortfolio construction
Stratmill research code

This introduction explains how cointegration can help create a mean-reverting portfolio from price series that are not themselves mean-reverting. By combining multiple assets with suitable weights, a trader may construct a spread or portfolio whose value…

Mean reversionStatisticsPortfolio constructionPairs trading
Stratmill research code

This example builds a BTCUSDT futures market-making strategy whose fair price is estimated from a spot reference price plus a smoothed spot–futures basis. It resamples spot and futures book-ticker mid-prices, carries observations forward, and calculates a…

CryptoFuturesMarket makingMean reversion
Stratmill research code

This document describes a trading rule that measures a spread’s latest value against its recent average and standard deviation. It uses separate lookback windows for the mean and standard deviation, then calculates a z-score to identify unusually high or low…

Mean reversionTechnical indicatorsStatisticsRisk management
Stratmill research code

The distance approach forms pairs by rescaling each asset’s training-period prices to a common range, calculating the sum of squared differences between each pair’s normalized series, and selecting the closest matches. In the cited original study, the…

Pairs tradingMean reversionArbitrageStatistics
Stratmill research code

This documentation landing page introduces ArbitrageLab, a Python library covering end-to-end pairs-trading strategies and tools for developing strategies. It organizes its subject matter around multiple approaches, including distance methods, cointegration,…

Pairs tradingMean reversionArbitrageMachine learning
Stratmill research code

The document implements a threshold autoregressive model for testing whether a spread adjusts differently after positive and negative deviations. It first differences the input series to form changes, lags the spread by one period, and assigns each lagged…

StatisticsMean reversionPairs trading
Stratmill research code

The document introduces copulas as a way to model how two or more random variables depend on each other separately from their individual distributions. It explains transforming observations through their marginal cumulative distribution functions into…

StatisticsPairs tradingMean reversion
Stratmill research code

This strategy turns changes in a spread series into long and short entry thresholds. It separates historical spread changes into positive and negative values, then calculates a chosen upper quantile of positive changes and a lower quantile of negative…

Pairs tradingMean reversionStatisticsMachine learning
Stratmill research code

This guide explains how unit-root and cointegration tests can help identify mean-reverting combinations of asset prices. It presents the Augmented Dickey–Fuller test as a test of whether price changes depend on the current level, and relates the estimated…

Pairs tradingMean reversionStatisticsBacktesting
Stratmill research code

This document explains a method for selecting profit-taking and stop-loss boundaries for a mean-reversion strategy modeled with an Ornstein–Uhlenbeck process. A position is closed when it reaches either boundary or when its maximum holding horizon expires.…

Mean reversionStatisticsRisk management
Stratmill research code

This document describes an analytical method for choosing entry and exit levels in a statistical arbitrage strategy whose log price follows an exponential Ornstein–Uhlenbeck process. The trade cycle runs from an entry level to an exit level and back to the…

Mean reversionArbitrageStatisticsRisk management
Stratmill research code

The introduction frames pairs trading as a way to create a mean-reverting portfolio by holding one risky asset and shorting another correlated or co-moving asset. Such a spread may offer statistical arbitrage opportunities, but the central challenge is…

Mean reversionPairs tradingArbitragePortfolio construction
Stratmill research code

This document describes a class for applying an exponential Ornstein–Uhlenbeck model to mean-reverting portfolio prices. It inherits fitting and portfolio construction from an OU model, then works in log-price space to estimate optimal liquidation levels,…

Mean reversionStatisticsPortfolio constructionRisk management
Stratmill research code

This implementation describes a pairs-trading method based on modeling the log price relationship between two stocks as an Ornstein–Uhlenbeck process. It constructs the spread as the difference between the stocks’ log prices, fills missing observations…

EquitiesPairs tradingMean reversionStatistics
Stratmill research code

This module describes a trading rule built around a pre-estimated multivariate cointegration vector. It calculates the weighted sum of log prices, differences that series across recent observations, and uses the sign of the summed changes to set trade…

Pairs tradingMean reversionPosition sizingPortfolio construction
Stratmill research code

This method uses principal component analysis to separate broad equity return drivers from stock-specific residuals, then trades residual portfolios expected to revert toward equilibrium. Returns are standardized before estimating their correlation matrix;…

EquitiesMean reversionArbitrageStatistics
Stratmill research code

This example shows how to combine a spot BTCUSDT mid-price series with US dollar margined futures order book data in an hftbacktest simulation. It parses spot book ticker messages into local timestamps and mid prices, then, at each backtest timestamp,…

CryptoFuturesSpot marketsMean reversion