This utility describes a method for explaining strategy returns with Fama–French three-factor or five-factor models, optionally including momentum. It aligns daily factor data with strategy returns, detects the return frequency, and compounds factor returns…
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
5,922 documents
This document describes dataset utilities for preparing time-series panels for model training and rolling inference. The training dataset returns sliding sequences of features, forward returns, volatility scales, and masks, with configurable sequence length,…
This chapter presents risk management as part of strategy design and live operations. It covers tail risk measurement with value at risk and conditional value at risk, drawdown depth and recovery, exposure decomposition, stress testing, adaptive controls,…
This notebook evaluates published factor returns as potential portfolio building blocks. It separates three questions: whether a factor’s average return clears a demanding statistical bar, whether factors diversify one another for reasons that may persist,…
This notebook compares risk overlays across case-study backtests, including stop, trailing-stop, loss-limit, drawdown-breaker, and volatility-target rules. It loads each study’s overlay results, selects a baseline from an allocation-stage backtest where…
This notebook traces ETF ranking signals through portfolio formation and a simplified backtest. Ridge regression and logistic classification are trained with walk-forward splits, then compared with momentum and equal-weight portfolios. At monthly rebalances,…
This notebook shows how to use an estimation-window correlation network to describe an equity universe and build a network-diversified portfolio. It selects liquid symbols using only data available before evaluation, converts return correlations to…
This notebook builds an LSTM allocator that maps sequences of ETF returns and rolling volatility features directly to long-only portfolio weights. A softmax output keeps weights nonnegative and fully invested. Instead of forecasting returns and feeding those…
This notebook compares PyPortfolioOpt, Riskfolio-Lib, and skfolio by fitting portfolio allocators on a shared ETF return panel and evaluating their frozen weights on later observations. It covers mean-risk, tail-risk, hierarchical risk parity, and penalized…
This shared allocation module turns cross-sectional predictions into portfolio weights. It ranks assets by score to select long positions or top and bottom baskets for long-short portfolios. Position weights can reflect conformal prediction widths, where…
The document introduces latent factors as shared return drivers inferred from co-movement across futures rather than supplied as named predictors. It compares two approaches fitted within each training fold. Principal component analysis (PCA) finds linear…
This notebook applies one monthly ETF momentum and yield-curve regime strategy in two ways: vectorized return arithmetic and a sequential account simulation. Both use the same target weights, assets, dates, and total trading cost, allowing the comparison to…
This document describes the architecture of a neural policy network that maps asset-level time series and context into bounded portfolio risk weights. Its per-asset backbone combines context embeddings, feature-wise modulation, variable selection, an LSTM,…
This notebook compares portfolio sizing methods for leading S&P 500 equity signal configurations. It first selects each configuration’s strongest full-coverage checkpoint using validation Sharpe, then applies alternative allocators—including score weighting,…
This notebook turns institutional 13F disclosures into a bipartite graph linking managers to stocks, then derives stock-level ownership features. It aggregates duplicate manager-stock positions, normalizes issuer labels, excludes option rows, and uses…
This notebook demonstrates a deployment boundary between an offline machine-learning pipeline and QuantConnect's LEAN engine. It selects a prediction set through the ETF case study registry, verifies training and prediction provenance, and exports…
This document explains a run-log system for recording model training, predictions, causal estimates, and backtests across trading case studies. It describes how configurations flow from case-study settings through training menus and model presets, then…
This notebook turns institutional 13F holdings into a graph connecting managers and stocks, with sector relationships and holdings edges that carry shares, value, reporting period, and public filing date. It demonstrates graph queries for shared ownership…
This demonstration extends a single-order workflow into a daily rebalance for a fixed universe of large-cap US stocks. It explains how to compare current broker positions with model targets, construct orders for the differences, and optionally submit the…
This chapter argues that durable trading research depends on a disciplined process that can adapt to changing markets, noisy evidence, and implementation costs. It introduces distinctions among structural breaks, regimes, data drift, and concept drift, then…
This notebook applies a previously selected ETF configuration to its reserved holdout window. It derives the matching holdout predictions from the selected training identity and checkpoint, then uses the strategy's existing concentration, allocation, risk…
This benchmark-generation method creates an equal-weighted daily return series from the declared assets in a case study. It first takes each symbol’s last close for each session, then calculates close-to-close returns and averages the available returns…
This notebook builds the long-only, fully invested mean-variance framework for a diversified ETF universe. It constructs feasible portfolios and an efficient frontier, then solves for maximum-Sharpe and minimum-variance weights using estimated returns and…
This notebook reprices leading ETF allocation configurations across two cost grids while holding predictions, concentration, and allocation rules fixed. It compares the case study's per-share commission and half-spread model, which reflects how ETF trading…