This notebook compares two simulations of the same monthly ETF momentum strategy. Both use identical target weights, universe, dates, and total trading cost. One computes returns from lagged weights and asset returns; the other processes orders sequentially…
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
566 documents
This notebook distinguishes predicting returns from claiming that momentum causes them. It treats a stock’s prior-year return, excluding the latest month, as the treatment and forward return as the outcome. Recent volatility, illiquidity rank, and volume…
This notebook aggregates LightGBM results across multiple trading case studies and compares them with linear and TabM baselines. It examines the highest-IC configuration for each case study, reports heteroskedasticity-and-autocorrelation-consistent…
This notebook tests whether learned graph embeddings add predictive information to a tabular model for US stocks. It builds a network from absolute return correlations measured before the target period, constructs momentum, volatility, and trend features…
This notebook compares ways to measure volatility and develops heterogeneous autoregressive (HAR) volatility models alongside roughness analysis. It uses intraday returns to estimate session realized variance, distinguishes intraday movement from overnight…
This document describes an LSTM sequence model for an S&P 500 options study. Unlike cross-sectional models that rely on engineered features to summarize a symbol’s history, the LSTM receives chronological windows and learns which parts of the sequence…
This notebook compares CSV, Parquet, Feather, and HDF5 storage using a deterministic one-million-row OHLCV panel. It measures write time, materialized read time, file size, and reads that select only two columns. The timing policy uses a single write…
This notebook presents a pipeline for turning financial headlines into stock-level signals. It cleans and standardizes a news corpus, removes exact and prefix-matched duplicates within ticker-date groups, and uses sentence embeddings to represent headline…
This notebook explains a market data lifecycle for daily OHLCV data: load an initial history, fetch a small overlapping delta, detect missing sessions, and summarize each symbol’s freshness and validation issues. It describes why the update window should…
This notebook diagnoses how a fixed, long-only ETF momentum baseline performed across market conditions from 2010 to 2024. It labels each daily return using volatility and trend measures known before that return began, with expanding historical medians…
This notebook applies previously selected firm-characteristic predictions and a fixed portfolio configuration to a one-year holdout period. It makes no new choices about predictions, allocation, concentration, rebalancing, or transaction costs, preserving…
This notebook examines information-driven sampling by constructing tick and volume imbalance bars from trade data. It verifies a manual tick-imbalance implementation against a library sampler, then sweeps expected bar sizes and adaptation settings to compare…
This notebook demonstrates a read-only question-answering workflow over an institutional holdings graph built from 13F filings. Instead of generating database queries from natural language, it routes exact supported questions to hand-written Cypher templates…
This notebook evaluates position-level stop-losses, trailing stops, and time exits on top allocation-stage configurations in a NASDAQ-100 intraday strategy. Decisions occur every fifteen minutes while the backtest engine monitors positions every minute, so…
This notebook describes a patched transformer for sequence prediction in an S&P 500 equity and options study. It divides a time window into contiguous blocks and represents each block as a token, allowing attention to compare distant parts of the window…
This notebook explains instrumented principal component analysis (IPCA) for a changing US equities panel. Traditional PCA assigns each stock a fitted loading, which cannot naturally cover names absent from the training sample and stays fixed as a company's…
This ETF feature notebook explains how fitted statistical models can leak future information through their estimated parameters, even when their formulas use past observations. Its remedy is a walk-forward refit schedule: allow an initial burn-in, fit using…
This notebook studies gradient boosting for a US equities panel, varying tree capacity, objective function, and training checkpoint across three forward-return horizons. It explains how shallow trees can learn feature interactions, while increasing capacity…
This notebook demonstrates SHAP explanations for a LightGBM model predicting ETF forward returns. TreeSHAP supplies feature contributions for individual predictions and aggregate importance summaries. Beeswarm and dependence plots show how feature values…
This chapter presents market data as the result of trading rules, liquidity, and participant behavior. It surveys data from top-of-book quotes through order-level feeds, then describes parsing exchange messages and replaying them into a venue-local limit…
This case study constructs features for comparing variance risk premiums across S&P 500 stocks using 30-day at-the-money straddles and underlying price data. It measures implied volatility against realized volatility at several horizons, adds option-market…
This case study explains how to generate predictions for a holdout period after model and strategy choices have been made on validation data. It resolves the previously selected configuration, reconstructs its training specification, and fits it again using…
This notebook introduces EdgarTools for exploring SEC filings by company and filing type. It demonstrates looking up issuers using stable CIK identifiers, retrieving annual and quarterly reports, extracting XBRL financial statements, and inspecting insider…
This notebook describes an LSTM sequence model for predicting stock returns from ordered windows of recent features. Each example uses 60 consecutive sessions for one stock; windows that cross listing gaps, halts, or other interruptions are excluded so that…