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 course library

This document describes the data model and calculations behind a synthetic multi-leg spread. Each leg stores its market quotes, contract details, and position state. Configurable price multipliers define the spread price, while trading multipliers define how…

Multi-assetPairs tradingMarket microstructureBacktesting
Quant course library

This guide explains spread trading across related instruments, contrasting it with single-instrument trend strategies. It presents several approaches: latency-sensitive arbitrage between equivalent markets, threshold or Bollinger Band mean-reversion trades…

Pairs tradingArbitrageMean reversionExecution
Quant course library

This document explains how to represent a multi-leg spread using separate price and trading multipliers. It derives synthetic bid and ask prices from each leg’s best quotes, reversing which side of a leg’s market contributes when its price multiplier is…

FuturesPairs tradingMarket microstructurePosition sizing
Quant Q&A

The document considers whether two cointegrated price series can be combined into a stationary spread and modeled with an Ornstein-Uhlenbeck process. The proposed workflow estimates a hedge coefficient through regression, constructs the residual spread, and…

Pairs tradingMean reversionStatisticsEquities
Quant Q&A

The document frames an out-of-sample estimation question for a cointegration pairs strategy. In sample, the proposed workflow applies the Engle–Granger two-step procedure, estimates a hedge coefficient for the spread, and standardizes that spread using its…

Pairs tradingMean reversionStatisticsBacktesting
Quant Q&A

The discussion collects several ways to transform stock prices for analysis. Suggested measures include log prices, price deviations from a mean, standardized deviations using a standard deviation, log-price deviations from a mean, log returns, percentage…

EquitiesStatisticsPairs tradingBacktesting
Quant Q&A

The document asks whether performance statistics such as profit factor and Sharpe ratio should be computed for each leg of a pairs trade separately or for the combined position. Its example shows that the measured profit factor differs depending on whether…

Pairs tradingStatisticsPortfolio construction
Quant Q&A

The document explores exit choices for a crypto pairs trade entered after finding a cointegrated relationship. The trader reports that cointegration tests can stop indicating a relationship and later signal it again, while a simple exit at zero z-score has…

CryptoPairs tradingMean reversionRisk management
Quant Q&A

The document raises a pairs-trading question about estimating hedge ratios with rolling ordinary least squares on two stocks’ log returns. The author observes that when the stocks have very different share prices, the estimated ratio can still be near zero…

EquitiesPairs tradingStatisticsPosition sizing
Quant Q&A

The document addresses how to calculate value at risk for a dollar-neutral long-short position in two correlated stocks. Its central correction is that dollar neutrality does not eliminate risk: the long and short positions are exposures to different assets,…

EquitiesPairs tradingRisk managementStatistics
Quant Q&A

The document compares constructing a pairs trading spread from a price difference with using a price ratio. Its practical answer is to calculate the spread for the position the strategy will actually trade, since alternative leg weightings produce different…

EquitiesPairs tradingStatistics
Quant Q&A

The discussion examines how adjusted and unadjusted stock prices affect backtests, especially cointegrated pairs trading. Adjusted prices can remove artificial jumps from splits and dividends, which helps when measuring returns or momentum. But later…

EquitiesPairs tradingBacktestingExecution
Quant Q&A

The document considers how to automate a spread strategy when the charting platform does not execute the user’s full rules automatically. The example strategy buys one instrument and sells another when their spread falls below a lower Bollinger Band, then…

ExecutionPairs tradingTechnical indicators
Quant Q&A

The document raises a data-continuity question for a pair-trading model using futures contracts. It says the training series for each contract has been forward-adjusted and asks whether live prices should receive the same adjustment when the model is tested.…

FuturesPairs tradingBacktesting
Quant Q&A

The document contrasts two approaches to pairs trading. One estimates a hedge ratio between nonstationary price levels so their linear combination is stationary, then models that spread as autoregressive or mean reverting. The other combines asset returns,…

Pairs tradingMean reversionStatisticsRisk management
Quant Q&A

The document answers a question about how to define entry and exit signals for a pairs trade. It recommends tracking the moving average and standard deviation of the log price ratio between two stocks, rather than comparing a single period’s return…

Pairs tradingMean reversionTechnical indicatorsEquities
Quant Q&A

The document raises a practical issue in a cryptocurrency perpetual-swap pair-trading strategy: a spread estimated by regression on log returns can produce opposite signals in consecutive observations. The author calculates the spread from rolling historical…

CryptoPairs tradingPerpetual futuresMean reversion
Quant Q&A

The discussion explains why cointegration test p-values can change sharply when the start and end dates change. If the underlying data-generating process is stable, using the longest available sample can improve a test’s statistical power. If the process…

StatisticsPairs tradingBacktesting
Quant Q&A

The document explains why cointegration among asset prices does not necessarily conflict with market efficiency. Market efficiency concerns whether future returns can be predicted reliably from available information, while cointegration describes a stable…

StatisticsPairs tradingEquities
Quant Q&A

The document compares two ways to measure a relationship between two stocks for pairs trading. A price ratio represents a dollar-neutral position: the trader invests equal dollar amounts in each asset. A regression-based spread instead uses a hedge ratio,…

EquitiesPairs tradingStatisticsRisk management
Quant Q&A

The document discusses narrowing a large universe of candidate equity pairs after an Augmented Dickey–Fuller test and half-life calculation leave many candidates. Suggested filters include liquidity, trading costs, backtesting with cross-validation, and…

EquitiesPairs tradingMean reversionBacktesting
Quant Q&A

The discussion addresses how to estimate or manage the time a mean-reversion trade takes to return toward its mean. It notes the Ornstein–Uhlenbeck process as one way to model half-life, but shifts attention to whether a candidate spread has a credible…

Mean reversionPairs tradingStatistics
Quant Q&A

The document asks whether potential pairs can be screened faster than testing every stock pair across every tick. It describes a theoretical approach based on fast matrix multiplication, which can reduce the asymptotic cost of computing a correlation matrix.…

Pairs tradingStatisticsEquitiesFutures
Quant Q&A

The document outlines a proposed workflow for applying an Ornstein–Uhlenbeck process to a pair of potentially cointegrated stocks. The suggested steps are to estimate a linear relationship by OLS, form a residual or auxiliary series, fit an AR(1) model to…

Pairs tradingMean reversionStatisticsEquities