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…
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
The document introduces stationarity as a time series property in which statistical characteristics remain stable over time, then contrasts it with nonstationary series whose means can drift. It explains that a stationary series may tend to return toward its…
This guide explains how to construct, monitor, and trade synthetic spreads in the VeighNa SpreadTrading module. A spread can combine several contract legs using a formula, including pricing legs that are not traded, which supports relationships involving…
This overview outlines a quantitative workflow: collect and clean data, develop a strategy, manage risk, backtest on historical data, and automate execution. It then sketches strategies for Chinese equities and futures, including Turtle-style breakouts,…
This page introduces a lesson on using correlation coefficients to identify stock candidates for pairs trading and then building a strategy to trade them. It frames correlation as a screening tool for finding potentially suitable arbitrage pairs, followed by…
The script describes a spread-trading approach linking methanol futures with polyethylene and polypropylene futures. It estimates an MTO production margin by valuing the two polymer contracts together and subtracting the methanol input cost, adjusted for…
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…
The article develops a relative-value framework for Chinese rebar and iron ore futures. Because iron ore is a major steelmaking input, their prices are linked, but the author argues that simple steel-margin formulas can be distorted by coke prices,…
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 explains statistical arbitrage as a family of strategies that trade relative mispricing across related instruments. It distinguishes cross-market, cross-asset, ETF, and market-neutral approaches, and gives pairs trading as a central example:…
This document describes an automated or manual pair-trading robot that opens positions in two symbols when their correlation meets a configured threshold. It distinguishes pairs, whose charts move similarly, from mirror symbols, whose charts move in opposite…
The strategy rotates among China’s four largest banks using each stock’s current price relative to the previous close. When flat, it buys the bank with the weakest ratio if the spread between the strongest and weakest ratios exceeds a preset threshold. When…
This research note introduces time-series stationarity as preparation for studying pairs trading in cryptocurrency futures. It explains weak stationarity through stable mean and variance and covariance that depends on the time gap rather than the observation…
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…
A VeighNa community thread addresses why the official spread backtesting example cannot read data even though the same data source works in CTA backtesting. The response explains that spread-trading backtests require their own prepared dataset: data must…
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…
A VeighNa community exchange answers whether the `self.sync_data()` method is available in version 2.5.7 spread-trading strategies. A user reports that the method works in CTA strategies but raises an error when called from a spread strategy while attempting…
This overview explains how unsupervised learning finds structure in unlabeled data, contrasting it with supervised prediction. It presents K-means clustering and principal component analysis (PCA) through equity examples. K-means groups stocks using scaled…
This module fits a bivariate mixture of Clayton, Student-t, and Gumbel copulas, motivated by a mixed-copula pairs trading approach. It first maps each input series to empirical cumulative probabilities, then estimates component parameters and mixture weights…
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…
This strategy forecasts the future value of a spread between cointegrated assets, then compares the forecast with the current spread to generate trades. The document describes three approaches: trading predicted spread returns directly, following spread…
This document describes an indicator that can display stochastic values for a user-selected symbol, rather than only for the chart’s current instrument. Multiple instances can be added with different symbol inputs, allowing a trader to view several pairs…
The script demonstrates a calendar spread strategy for two nearby equity index futures contracts. It calculates the spread between their closing prices over a rolling window, estimates the mean and standard deviation, and sets upper and lower thresholds two…
The script describes a mean-reversion strategy that trades a spread between two steel futures contracts. It collects daily closes, standardizes each contract’s recent prices over a rolling window, and subtracts the standardized series to form a spread. A…