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

4,613 documents

Quant Q&A

This example shows how to calculate realized and unrealized profit and loss for a position over time from a trade journal and a sequence of valuation prices. The sample trade records an entry and exit, while hourly index closes provide prices for marking the…

Risk managementPosition sizingExecution
Quant Q&A

The note outlines ways to offset interest-rate exposure in a corporate bond using interest-rate futures or swaps. For a futures hedge, it recommends comparing the bond’s DV01 with the DV01 of the futures contract’s cheapest-to-deliver bond, using a contract…

Fixed incomeFuturesRisk managementPosition sizing
Quant Q&A

The document describes a proposed daily long-only stock strategy with three percentage-based thresholds: an entry below the opening price, a stop loss below the entry, and a profit exit above the entry. Each threshold triggers when the observed price crosses…

EquitiesBacktestingPosition sizingRisk management
Quant Q&A

The document asks how a return model with low R² could still support profitable decisions. It considers using predicted returns as expected returns for directional trades and Kelly sizing, then raises two concerns: predictions may cluster near zero, and…

Machine learningStatisticsPosition sizingBacktesting
Quant Q&A

The document addresses why ordinary percentage returns can become misleading when a long-short strategy’s recorded P&L or value crosses zero. It presents a net asset value approach: account for the value of long holdings, short-sale proceeds, and the current…

EquitiesPairs tradingBacktestingPortfolio construction
Quant Q&A

The document describes a challenge in training a model to classify stock news as a long, short, or no-bet opportunity while producing usable probabilities. Expected-value optimization can favor taking bets even when the estimated edge is tiny, because…

EquitiesMachine learningSentimentRisk management
Quant Q&A

The document addresses how to size the swap and bond legs of a swap spread position. Its practical guidance is to match the legs by DV01 rather than by notional when the aim is to capture changes in the spread measured in basis points. Since instruments with…

Fixed incomePosition sizingRisk management
Quant Q&A

The document explains how to hedge a fixed position in one asset using positions in two correlated hedging assets. Write the total portfolio variance as a function of the hedge holdings, then set its partial derivatives with respect to those holdings to…

Risk managementPortfolio constructionStatisticsPosition sizing
Quant Q&A

The document presents several ways to estimate whether a price reaches a take-profit level before a stop-loss. One practical approach is Monte Carlo simulation, modeling price paths and applying both barriers to each path; its probability estimate depends…

StatisticsBacktestingRisk managementPosition sizing
Quant Q&A

The document asks how to reproduce the profit and loss of a USDCHF position with a stated size of 1,000 by trading USDEUR and EURCHF instead. It notes the triangular exchange-rate relationship: USDCHF is the product of USDEUR and EURCHF. The practical…

ForexPosition sizingPortfolio constructionArbitrage
Quant Q&A

The question considers how to apply the Kelly criterion when capital is allocated across several trading rules that generate multiple trades. It asks whether to assign capital to each rule in advance, size each trade according to its changing outlook, or…

Position sizingPortfolio constructionRisk managementStatistics
Quant Q&A

To update portfolio weights after a period of asset returns, multiply each starting weight by one plus that asset’s return. These products represent the assets’ ending values relative to the portfolio’s initial total value. Sum the products to find the…

Portfolio constructionPosition sizingMulti-asset
Quant Q&A

The document frames a problem in which a trader chooses among candidate forward trades with known expected profits and maturity dates while operating under a finite capital limit. Since positions tie up capital until maturity, taking a profitable trade now…

FuturesPosition sizingPortfolio constructionRisk management
Quant Q&A

This note addresses minimum-variance hedging for vanilla options in a binomial-model setting. When the hedging stock is the option's own underlying, the response recommends using the option position's net delta to determine the stock hedge. The binomial…

OptionsEquitiesDerivatives pricingRisk management
Quant Q&A

The document explains how to compare pip moves in two currency pairs that share the same base currency. It frames the calculation in terms of profit and loss: for a fixed base-currency trade size, the same pip move produces the same amount in the quote…

ForexPosition sizingStatistics
Quant Q&A

The document explains why a long-short portfolio’s return depends on the capital assigned to support its positions. With a short sale, the amount invested in securities does not directly represent the investor’s capital, so return calculations need a…

Portfolio constructionRisk managementPosition sizing
Quant Q&A

This note examines whether the optimal Kelly betting fraction should change when the number of rounds is finite. For independent bets with fixed win and loss sizes, it derives expected utility across repeated rounds under several utility functions. With…

Position sizingRisk managementStatistics
Quant Q&A

The discussion addresses how an automated strategy can manage repeated order signals, including cases where execution algorithms generate many child orders. It recommends assigning each requested order a unique identifier and storing its parameters against…

ExecutionRisk managementPosition sizing
Quant Q&A

The document considers writing a call against an existing long stock portfolio. The short call premium provides income and cushions some decline in the stock’s value, while the call obligation limits gains once the share price exceeds the strike. The…

OptionsEquitiesRisk managementPosition sizing
Quant Q&A

The document raises two practical questions about turning cointegration relationships into a pairs trading portfolio. It compares a regression of log prices with one using raw prices, each expressed as a fitted relationship between assets and a residual…

Pairs tradingStatisticsPortfolio constructionPosition sizing
Quant Q&A

The discussion compares buying in-the-money (ITM) and out-of-the-money (OTM) calls when anticipating a large upward stock move. ITM calls cost more because they include intrinsic value and generally have higher delta, so they can participate more if the…

OptionsEquitiesVolatilityPosition sizing
Quant Q&A

The question concerns portfolio optimization over a large investment universe under long-only, equal-weight, and asset-count restrictions. It seeks both a maximum-Sharpe portfolio and a minimum-standard-deviation portfolio at a target return, and reports…

Portfolio constructionPosition sizingRisk managementBacktesting
Quant Q&A

The document presents an approach to allocating partial fills across a sequence of stock trades when the final position must stay within a fixed share limit. The original formulation uses dynamic programming over possible positions and execution amounts, but…

EquitiesPosition sizingExecutionPortfolio construction
Quant Q&A

The document explains how to choose a risky-asset weight for a one-period portfolio when the investor has power utility, a risk-free return, and a probability distribution for the risky asset’s return. The return distribution is represented by possible…

Portfolio constructionPosition sizingOptionsStatistics