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,…
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.
Search the library
34 documents
This implementation describes convergence trading for two cointegrated assets as a portfolio optimization problem. It estimates error-correction speeds and other model parameters from price data, then computes portfolio weights under both unconstrained and…
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…
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,…
This overview describes research on forecasting and trading commodity spreads, including gasoline crack, soybean-oil crush, and corn-ethanol crush spreads. It explains why spreads can be less exposed to market-wide information shocks and speculative bubbles…
This module describes ways to select groups of stocks for vine copula analysis, a component of a statistical arbitrage approach. It starts from price histories, calculates daily returns and ranked returns, and narrows candidate partners for each target stock…
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…
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…
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;…
The Pearson approach forms equity pairs by ranking stocks on the correlation of their monthly returns during a formation period. For each stock, it selects the most highly correlated peers and combines their returns into a benchmark portfolio, using either…
This module describes selecting three partner stocks for each target in a four-stock vine-copula statistical arbitrage framework. It compares four approaches using ranked daily returns: a baseline that sums pairwise Spearman correlations, a multivariate…
This implementation describes a distance-based statistical arbitrage method for forming and trading equity pairs. In a training period, each price series is scaled using its own minimum and maximum, and candidate pairs are ranked by the sum of squared…
This implementation describes a bivariate Student-t copula for modeling dependence between two variables represented by uniform pseudo-observations. It explains sampling from a correlated Student-t distribution, evaluating copula density and cumulative…
This method adapts mean-reversion pairs trading to the risk that a spread shift reflects a lasting structural change rather than a temporary deviation. It models the pair spread as having two Markov-switching states, each with its own mean and volatility,…
This code describes a C-vine copula wrapper intended for statistical arbitrage research. It fits candidate vine structures to quantile-transformed data, restricts the candidate ordering according to a chosen target variable, and selects the structure with…
The introduction presents a machine-learning framework for selecting securities for pairs trading. It frames pair discovery as a search-space problem: limiting candidates to securities in the same sector may exclude useful relationships, while searching…
The module implements a finite-horizon dynamic allocation approach for a mean-reverting arbitrage spread, drawing on a published model by Jurek and Yang. It constructs total-return indices from two price series, estimates cointegrating spread weights, and…
This note explains a long-short pairs strategy that uses a copula to model the dependence between two stocks. After selecting a pair, for example with a cointegration test, the method fits the copula and each stock’s empirical distribution on a formation…
This document outlines a daily strategy for trading a set of assets using a cointegration vector estimated with the Johansen method on training data. It applies the vector to log prices to form a combined process, then sums its recent changes to determine…
The method searches for hedge ratios that make a portfolio spread more stationary according to the Augmented Dickey–Fuller (ADF) test statistic. It defines the spread as the target asset’s price series minus a weighted sum of the other price series, then…
The code implements a statistical-arbitrage strategy that uses a fitted C-vine copula to estimate conditional probabilities for a target asset from a panel of returns. It transforms each asset’s returns through fitted cumulative distribution functions,…
The distance approach selects two instruments whose historical price series moved together, then trades when their price spread exceeds a chosen threshold during a later testing period. The strategy buys the instrument with the lower price and shorts the one…
The document lays out a screening process for spreads used in pairs trading and statistical arbitrage. Candidate constituents are tested for cointegration, mean-reverting behavior, practical reversion speed, and frequent crossings of the spread’s mean. It…
The document outlines an equities statistical arbitrage method that uses principal component analysis to estimate common return factors. Asset returns are standardized, PCA components provide factor weights, and regressions of returns on factor returns…