This notebook connects position sizing with analysis of maximum adverse and favorable excursions. It demonstrates fixed-fractional sizing, where shares are determined by a per-trade risk budget and entry-to-stop distance, subject to a concentration cap. It…
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
742 documents
This notebook explains how to interpret Ridge regression forecasts for an ETF panel with SHAP. For a linear model, each feature’s attribution is its coefficient times the feature’s deviation from its training-background mean, so the attributions can be…
This notebook explains how a conditional autoencoder extends an instrumented principal component model: a neural network maps stock characteristics to factor exposures, while the model retains the same exposure-times-factor-return structure. It fits the…
This notebook compares six allocation methods on crypto perpetual strategies that have already passed a baseline selection funnel. It keeps each strategy’s predictions and entry rules fixed, then changes how capital is assigned: one allocator uses model…
This notebook demonstrates deep hedging for a short European call. It simulates underlying price paths with geometric Brownian motion, calculates Black-Scholes delta as a benchmark, and trains a semi-recurrent neural network to choose hedge positions. The…
This module defines how a holdout selection field is assembled across validation stages and strategy labels. It addresses discrepancies that can make frozen candidate sets and live reconstruction select different configurations, or cause later analysis to…
This notebook shows how to test whether four managed-portfolio strategies add explanatory power for SPY returns after controlling for broad movements captured by ten principal components. The candidate portfolios rank ETFs by recent momentum, low volatility,…
The document explains instrumented principal component analysis for modeling ETF returns. Unlike ordinary PCA, which assigns each fund fixed factor exposures, IPCA makes each fund’s exposures a shared linear function of its observable features. It estimates…
This notebook derives Kelly sizing for a binary wager by maximizing expected log wealth, then illustrates how stake size changes the distribution of simulated wealth paths. It extends the framework to continuous returns and multi-asset portfolios, where the…
This evaluation screens option-surface, price-derived, and conditional-volatility features against forward equity returns. For each session it computes a cross-sectional rank correlation between feature values and subsequent returns, then examines the time…
This notebook evaluates a previously selected ETF strategy on a reserved holdout period. It retrieves the matching predictions from their training identity and checkpoint, applies the strategy specification and trading costs established earlier, and…
This module explains how to prepare historical S&P 500 prices when ticker symbols can refer to different securities over time. It applies corporate-action adjustment factors, tracks security identifiers, and marks identity boundaries. Return calculations are…
This utility describes how to validate a migration that changes backtest identifiers without rerunning the underlying computations. It scans database schemas to discover columns containing registered addresses, including embedded references in text…
This analysis assesses whether signals selected in multiple trading case studies appear dependable enough for further use. It compares validation information coefficients (IC) with holdout evidence, examines stability and reproducibility, and contrasts…
This notebook measures how an S&P 500 options strategy's validation performance changes under different assumed fractions of the quoted spread paid. It selects one baseline strategy per model family, then reruns each across spread-cost assumptions and both a…
This document presents a reusable state machine for automated trading halts, with closed, open, and half-open states. It applies the same transition logic to four risks: account drawdown, daily loss, consecutive losing sessions, and system latency. After a…
This notebook generates predictions for a previously untouched ETF holdout window using the configuration selected on validation data. It rebuilds the training specification to end one label horizon before the window opens, refits the model, preserves the…
This document describes registry checks for deciding whether to reuse or rerun model training and backtests. Runs are identified by hashes derived from their specifications; a run is reusable only when its expected artifacts are present. Missing pieces mark…
This notebook explains why a generic target-weight risk overlay cannot govern the described S&P 500 short-straddle strategy. The options engine allocates fixed capital fractions to weekly cohorts and normalizes weights within each cohort; scaling those…
This notebook studies gradient boosting for cross-sectional prediction of CME futures returns. It varies tree capacity through leaf-count profiles and compares squared-error, absolute-error, and Huber objectives, which differ in how strongly extreme…
This notebook adds a temporal convolutional network (TCN) to a comparison of sequence models for forecasting cryptocurrency perpetual funding premiums. Causal padding ensures each position uses only current and earlier observations, while dilated…
This case study evaluates daily cross-sectional signals across a broad US stock universe and lays out a long research pipeline, from point-in-time data and engineered features through model comparison, portfolio construction, costs, and holdout assessment.…
This notebook organizes cross-case-study comparisons of LightGBM models, using linear models and TabM as reference families where available. It evaluates configurations across tree sizes, regression losses, checkpoints, and classification objectives. The…
This notebook compares LightGBM with an MLP, TabM, and, when available, TabPFN for predicting ETF forward returns from tabular features. Models are evaluated on shared chronological walk-forward folds, with rank information coefficient and training time as…