This introduction to crypto pairs trading argues that correlation alone does not establish a durable relationship between two assets. A pair may move together because of shared market forces, yet its price spread can continue drifting. Cointegration offers a…
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 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…
This guide outlines a crypto pairs mean-reversion strategy built around cointegration rather than correlation alone. It proposes testing logged price series with the Engle–Granger method, estimating a regression hedge ratio, and checking the resulting spread…
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 explains a spread indicator formed from the quoted prices of two symbols. When the symbols are expected to move inversely, it reverses the second symbol before combining the quotes, effectively turning the calculation into a sum. Inputs include…
This forum exchange concerns tick-level backtesting of a spread between a cash bond instrument and a futures contract. The questioner has externally downloaded tick data in CSV form because the data source lacks cash-bond ticks, and asks how to import and…
The document demonstrates a vn.py workflow for backtesting a statistical arbitrage strategy on a two-leg futures spread. It defines a spread as the price difference between two futures contracts, sets the backtest interval and trading assumptions, loads…
A trader reports an error while running an rb-hc spread strategy in a simulated environment. The failure occurs when the strategy attempts to convert its current grid position into an integer target position, but the value is NaN. The trader suspects that a…
This module describes two ways to estimate hedge ratios from security price data. Ordinary least squares (OLS) treats one selected asset as the dependent variable and fits coefficients for the remaining assets, optionally including an intercept. It returns…
This project outlines a mean-reversion pairs strategy for Chinese futures. It screens candidate contract pairs for cointegration with an Augmented Dickey-Fuller test, estimates a changing hedge ratio with a Kalman filter, and measures spread behavior with…
The study describes a machine-learning approach for classifying the optimal rebalance frequency of a two-asset portfolio strategy. It uses minute-level prices for 50 Binance crypto assets from 2022 and 2023, forms asset pairs, and groups them by correlation.…
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…
The document describes a multicurrency expert advisor that automatically selects and trades currency pairs from a configurable currency list, with the advisor attached to a single chart. Users can reduce the selected currencies to limit the number of open…
This forum exchange clarifies how VeighNa’s spread trading callbacks relate. For live operation, the strategy receives a complete spread data structure through `on_spread_data`; that structure can be converted into a tick before the tick-handling logic is…
This futures strategy tracks the ratio of copper to aluminum contract values, adjusting each contract’s daily close by its volume multiplier. It calculates the historical mean and standard deviation of that ratio, then uses the current ratio’s z-score to…
This forum exchange discusses a VeighNa spread-trading strategy that cannot calculate a historical spread moving average because no data service is configured. A respondent advises checking the data-feed fields in the application’s global configuration. The…
The document explains how to form and evaluate long-short stock portfolios, focusing on pairs trading. It compares hedge-ratio methods: ordinary least squares minimizes portfolio variance under a correlated random-walk and Gaussian framework, while total…
The document introduces cointegration as a long-run relationship in which individually nonstationary series can have a linear combination that is stationary. It explains stationarity through stable statistical properties over time and contrasts it with…
The document describes a mean-reversion strategy for international equity ETFs. It builds dividend-inclusive cumulative return series normalized to a common starting value, ranks candidate pairs by the sum of squared differences between their normalized…
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…
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…
The article describes an intraday pairs strategy for SPY and IWM, using one-minute bars from April 2007 through February 2014. It aligns timestamps, estimates a rolling regression hedge ratio, forms a price spread, and converts that spread to a z-score. The…
This case study follows a live statistical-arbitrage strategy trading the residual between the EWY Korea ETF and Samsung Electronics and SK Hynix. A rolling log-price regression estimates hedge ratios; the residual is standardized into a z-score, with…
The indicator overlays a selected symbol’s price bars in a separate window beneath the chart where it is launched. The displayed symbol can be chosen through an input parameter, and multiple copies can be configured to examine different instruments within…