This documentation describes interactive tear sheets for examining pairs research. The cointegration view presents individual asset stationarity test results and normalized prices, then reports Engle–Granger analysis for both portfolio orientations. It…
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
765 documents
This implementation uses a Kalman filter to update the intercept and hedge ratio between two assets as each new observation arrives. It treats one asset as the response and estimates the coefficient for the other, producing a residual spread and its…
This document explains a method for choosing entry boundaries in a cointegration-based pairs trade. The strategy fades a spread when it crosses a preset upper or lower threshold, then closes when it returns to its mean. With position weights set by the…
The code implements an Ornstein–Uhlenbeck model for mean-reverting portfolios and pairs of assets. It fits the model’s long-run mean, reversion speed, and noise variance to historical prices, then uses an optimal double-stopping framework to calculate entry…
This article explains how to compare Bitcoin and Ether options volatility surfaces across strikes and expirations to identify relative-value trades. Traders can examine differences in implied-volatility level, skew, and term structure, then investigate…
The document introduces cointegration as a way to model related time series that are individually nonstationary. If a linear combination of such series is stationary, that combination represents a stable long-run relationship, even though the component…
This code builds a synthetic steel mill profit spread from daily futures prices for rebar, iron ore, and coke. It calculates the spread as rebar minus weighted quantities of the two inputs, smooths it with a 15-day moving average, and estimates a standard…
The document describes a charting indicator for viewing two symbols together. Its main panel overlays their price charts, while a lower panel plots a price spread line adjusted by a spread factor. This layout can help users visually compare relative price…
This discussion explains how to connect a spread-trading strategy with single-contract execution algorithms such as TWAP or best-limit. It distinguishes spread-level execution, which coordinates multiple legs, from algorithms that execute orders for one…
The document describes an indicator that calculates linear regression coefficients between each selected symbol and the other symbols in a user-provided list. It presents the resulting relationships as curves measured in standard deviations. A dashed…
This document describes a Bollinger-style trading rule for a constructed spread, commonly used in pairs strategies. It calculates a z-score by comparing the current spread with its rolling moving average and scaling by rolling standard deviation. A position…
This introduction reviews stochastic control models for allocating wealth between a mean-reverting spread and a risk-free asset. It describes the spread with an Ornstein–Uhlenbeck process and outlines work by Jurek and Yang, which considers investors with…
The module describes a first-stage screening method for pairs trading strategies built around copulas. It compares every two-asset combination in a supplied price panel and ranks the pairs using Spearman rank correlation, Kendall rank correlation, or the…
This module fits an Ornstein–Uhlenbeck (OU) process to either one price series or a spread formed from two asset price series. It estimates the long-run level, reversion speed, and volatility by maximizing a likelihood for discretely sampled observations,…
This module implements analytic methods for selecting entry and exit thresholds for a mean-reverting spread, following a published optimal-threshold framework. It transforms thresholds into dimensionless units using the model’s mean-reversion speed, long-run…
The document describes a bivariate Nelsen 14 copula, a model for dependence between two variables after expressing them on uniform scales. It provides analytical forms for the copula cumulative distribution, density, and conditional probability, along with a…
This forum discussion concerns a spread reversal strategy whose two legs sometimes fill together in backtests and sometimes fill days apart. One reply points to a spread-strategy module as a way to address legging. A longer response suggests possible causes:…
This indicator description explains how to plot the relationship between two broker-listed instruments in a separate chart window. Users specify each instrument by its broker symbol and can apply a multiplier to either leg. A setting selects whether the…
The document summarizes research on pairs trading among liquid large- and mid-cap stocks in Mainland China and Hong Kong from 1996 to 2017. It compares strategies confined to each market with strategies that form pairs across the two markets, assessing…
This introduction explains how copulas separate dependence between variables from their individual marginal distributions, then presents vine copulas as a way to model dependence across many variables. Rather than impose one rigid high-dimensional copula, a…
The document outlines a pairs selection framework that first reduces security-return features with principal component analysis, then clusters the compact representations using OPTICS or DBSCAN. OPTICS can identify clusters without a fixed cluster count;…
This indicator calculates the Pearson product-moment correlation between moving-average values for two selected financial instruments. Its reading ranges from negative one to positive one: positive values indicate that the two series move together linearly,…
The document explains how a spread-trading module can define synthetic combinations of futures legs, calculate their spread price, and execute them through taker, maker, or exchange-spread algorithms. It walks through constructing a spread from leg…
The document introduces a statistical-arbitrage approach to pairs trading. It argues that simple price correlation does not ensure a stable relationship between two assets, and presents cointegration as a basis for expecting a pair’s spread to revert toward…