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
Binance API docs
45 documents
Quantopian lectures
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

765 documents

Quant Q&A

The document raises a diagnostic question about a pair-trading setup: after using linear regression to estimate a hedge ratio, the residuals appear stationary but visually resemble the price series of the dependent asset. It asks what this appearance means…

Pairs tradingStatisticsMean reversion
Quant Q&A

The document explains a simple way to generate two non-stationary time series that are cointegrated. Start with a series containing a unit root, such as a random walk, then form a second series by adding a stationary process. The shared stochastic trend…

StatisticsPairs tradingBacktesting
Quant Q&A

The document explains a bootstrap comparison designed to test whether pairs trading returns reflect pair-specific reversion or simply the tendency of recent losers to rebound and recent winners to fall. On each historical date when a selected pair opens, the…

EquitiesPairs tradingMean reversionBacktesting
Quant Q&A

The document asks how to classify a strategy that goes long in the cheaper of two markets and short in the more expensive one after their prices diverge beyond a threshold. The assets are described as fungible, but the strategy does not move them between…

ArbitragePairs tradingMarket microstructureExecution
Quant Q&A

The document outlines a basic covariance hedge for two securities believed to move together. It first converts each price series into daily percentage returns, then estimates each return variance and their covariance. The hedge ratio is the covariance of the…

Pairs tradingEquitiesStatisticsRisk management
Quant Q&A

The document compares ways to estimate a hedge ratio for two cointegrated price series, including when their ordinary correlation is low. One answer recommends regressing one series on the other and using the estimated slope as the hedge ratio. Another…

Pairs tradingStatisticsMean reversion
Quant Q&A

This discussion explains the basic direction of a pair trade when two stocks diverge from a relationship assumed to persist. Under that assumption, the trader shorts the stock judged relatively overpriced and goes long the one judged relatively underpriced.…

EquitiesPairs tradingMean reversionBacktesting
Quant Q&A

The document asks how to size two stock positions in a long-short portfolio intended as a hedge, rather than as a cointegration-based pair trade. One response gives the basic beta hedge rule: set the hedge position opposite to the original position and scale…

EquitiesPairs tradingPosition sizingRisk management
Quant Q&A

The discussion explains how the sign of a cointegration coefficient affects the positions implied by a spread. With the stated spread defined as Stock A minus beta times Stock B, a negative beta makes the second term positive, so a long spread corresponds to…

EquitiesPairs tradingStatisticsRisk management
Quant Q&A

The document asks how to compare company performance while reducing the influence of macroeconomic changes such as interest rates, crises, and inflation. It also raises the idea of expressing company financial metrics relative to other companies instead of…

EquitiesPairs tradingFactor investing
Quant Q&A

The document outlines how to build an equity curve for a two-stock pair-trading backtest. It starts from entry and exit signals, assigns long and short portfolio weights, and estimates share quantities using initial capital and prices at entry. It then…

EquitiesPairs tradingBacktestingExecution
Quant Q&A

The discussion addresses a backtest in which a mean-reversion pairs strategy scales positions as the spread moves farther from its mean. Its central recommendation is to track daily profit and loss in currency terms, reflecting the strategy’s actual position…

Pairs tradingMean reversionBacktestingRisk management
Quant Q&A

The document formulates a fit between a target time series and a linear combination of two other series. It minimizes the sum of absolute residuals, the L1 norm, while constraining both coefficients to lie between minus one and one. This differs from…

StatisticsMean reversionPairs trading
Quant Q&A

The question considers three stocks where X is cointegrated with Y and Y with Z, but X and Z are not reported as cointegrated and no three-variable cointegrating relation is available. It asks whether the two pair relationships can support a dynamic…

EquitiesPairs tradingStatistics
Quant Q&A

The document explains why a rolling regression can make a pairs spread appear stationary even when the apparent mean reversion comes from repeatedly updating the hedge ratio. A short lookback window can adjust the ratio to recent price movements, pulling the…

Pairs tradingMean reversionStatistics
Quant Q&A

The discussion distinguishes portfolio volatility from portfolio return measurement for a long position in one stock and an equal short position in another. A covariance-based volatility formula can produce a small value when the assets have similar…

Pairs tradingEquitiesRisk managementStatistics
Quant Q&A

The document describes estimating a hedge ratio for a pairs trading spread from two aligned price series. Ordinary least squares regresses one security’s prices on the other, and the fitted slope is used to scale one leg when calculating the spread. A Java…

Pairs tradingEquitiesStatistics
Quant Q&A

The document compares two ways to estimate a current fair price for one instrument from the historical prices of a correlated instrument pair. One method multiplies the current price of the target instrument by the ratio of the two instruments’ average…

StatisticsPairs tradingArbitrageEquities
Quant Q&A

The document raises a practical sizing and spread-construction question for a pairs trade involving one Brent contract and one Gasoil contract. Although the two contract prices are of a similar scale, their minimum price fluctuations have different monetary…

Pairs tradingFuturesCommoditiesRisk management
Quant Q&A

The document outlines a two-step way to apply an error correction model to a candidate pair of nonstationary price series. It assumes the series are integrated to the same order, commonly first order. First, estimate a long-run relationship by regressing one…

Pairs tradingEquitiesStatistics
Quant Q&A

The document discusses a pairs strategy that recalculates a hedge ratio from a rolling window of prices, forms a spread, and tests it for stationarity with the augmented Dickey–Fuller test. The central question is whether a failed test should force an exit…

Pairs tradingStatisticsRisk management
Quant Q&A

The document compares the continuous-time Ornstein–Uhlenbeck (OU) process with the discrete-time AR(1) model for stationary, mean-reverting data such as a spread. It presents OU as a continuous-time model with an analytic solution and explains that a simple…

StatisticsMean reversionPairs trading
Quant Q&A

The document outlines an empirical sequence for assessing whether two price series are cointegrated. First, test each series for a unit root. If both are stationary, model them in levels; if only one is nonstationary, difference that series. If both are…

StatisticsMean reversionPairs tradingEquities
Quant Q&A

The document considers how to analyze price histories for a company with no trading record by using similar firms whose shares trade thinly across two exchanges. Stale prices and differing market conditions make direct time-series modeling difficult, and the…

EquitiesStatisticsMarket microstructurePairs trading