This notebook uses maximum favorable excursion (MFE) and maximum adverse excursion (MAE) to ground triple-barrier label widths in observed price paths. For a position entered at a bar’s close, it measures the best favorable and worst adverse movement over a…
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
87 documents
This case study compares alternative position sizing methods for CME futures against an equal weight baseline. It explains how inverse volatility sizing uses each contract’s own volatility, while covariance based methods also account for relationships…
This notebook explains how to build a continuous futures price history from individual expiring contracts. It identifies front-month contracts using trading volume, applies a no-rollback constraint to avoid spurious switches, and compares calendar-based roll…
This proof script exercises a reduced CME futures research workflow from model predictions through portfolio weights and backtesting. It checks that predictions cover exactly the expected product, timestamp, and fold keys, that fitted states and prediction…
This notebook establishes a signal-stage baseline for evaluating model predictions on CME futures. At each weekly decision, it ranks products by predicted return, buys the top group, shorts the bottom group, and gives each position equal weight. It varies…
The document sets out how to construct forward-return labels for a cross-sectional futures strategy that ranks products by term structure. It distinguishes roll-adjusted prices, which are appropriate for returns across contract rolls, from raw settlement…
The document describes three model-based features built from futures carry: an ARIMA forecast of next-session carry, rolling Fourier measures of selected cycle lengths, and a two-state hidden Markov model that infers the market regime from average carry. Its…
This document explains a validation baseline for model predictions on CME futures. At each weekly decision, products are ranked by predicted return; the top group is held long and the bottom group short, with equal weight within each leg. The number of…
This analysis compares registered double machine learning treatment effects from nine trading case studies. It loads current results from each study’s registry, checks registry integrity and duplicate labels, and makes coverage explicit. Effects and…
This notebook introduces futures backtesting mechanics through a long-short momentum example across several asset classes. It explains how contract specifications convert price movements into dollar profit and loss through multipliers, and how notional…
This document describes a dataset and workflow for studying cryptocurrency perpetual futures alongside their premium index. It outlines hourly OHLCV observations and eight-hour premium readings across a configured universe, with download, loading, filtering,…
This notebook assesses how transaction costs affect a fixed CME futures configuration selected elsewhere in the research process. It applies an all-in cost grid, splitting each level evenly between commission and slippage, and carries the selected risk…
This document describes a CME futures dataset with hourly and daily bars, continuous front-month contracts, and two deferred tenors across several product groups. It explains the dataset’s coverage, fields, loading options, and related weekly CFTC…
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 a previously selected CME futures configuration to holdout predictions, using the established allocator, rebalance schedule, concentration rules, and transaction cost assumptions. Its central methodological point is to freeze those…
This notebook describes how to select a CME futures case-study configuration from registered validation backtests. It pools candidates across signal, allocation, and risk-management stages, then chooses the configuration with the strongest validation Sharpe.…
This notebook reports parity comparisons between Backtrader, Zipline Reloaded, and an internal trading framework on selected real case-study strategies. It includes ETF and US equity-panel comparisons for both external engines, plus CME futures and…
This case study evaluates TabM, a parameter-efficient neural ensemble, on the same point-in-time CME futures feature rows and walk-forward folds used by other model families. It motivates TabM as a way to average across model variation while sharing most…
This notebook builds a reusable diagnostic survey for financial datasets before preprocessing or feature engineering. It checks time-index dtype, null timestamps, ordering and uniqueness; finds exact and key-based duplicates; measures missing values by…
This feature evaluation screens financial and model-derived candidates against forward returns for CME futures. For each feature, it checks data coverage and staleness, measures daily cross-sectional rank correlation between feature values and forward…
This notebook studies how regularization affects a CME futures model built from correlated feature families, including carry, rolling Sharpe, momentum, and volatility measures. It compares Ridge, Lasso, and ElasticNet: Ridge shrinks coefficients while…
This notebook applies configured stop-loss, trailing-stop, and time-exit rules to the strongest validation-ranked signal or allocation strategy for each futures return horizon. Each rule is assessed on its own parent strategy, with parameters fixed in…
This notebook develops a unit-aware framework for estimating trading costs across equities, ETFs, futures, foreign exchange, and crypto perpetuals. It first distinguishes traded volume from activity measures that cannot be converted into dollar turnover,…
This notebook evaluates LSTM and NLinear sequence models for futures forecasting. Unlike models that use one feature row per decision, sequence models consume ordered windows of past observations, potentially learning patterns that fixed summaries miss.…