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…
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 turn fitted GJR-GARCH and hidden Markov models into trading features while controlling look-ahead bias. GJR-GARCH estimates conditional volatility and captures the greater impact of negative return shocks; a two-state Gaussian…
This notebook turns currency-pair prediction rankings into a traded baseline. At each decision time, it forms equal-sized long and short sleeves from the highest- and lowest-ranked pairs, then evaluates them with an FX backtest engine. Equal weighting is…
This utility prepares prediction artifacts for live-demo notebooks by normalizing differing column names and date formats into a common timestamp, asset, and prediction structure. It groups duplicate timestamp-asset observations and averages their scores.…
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 compares two Transformer designs for forecasting 21-day ETF returns from trailing momentum features. PatchTST groups consecutive days into patches, placing short sequences of local shape in each token. iTransformer instead treats each feature’s…
This notebook sets out a descriptive way to translate gross returns into net performance by modeling trading frictions, financing, and fund expenses separately. Its parameterized cost stack calculates trading costs from turnover and trade size, financing…
This module describes a search interface for research agents, with a live provider and a deterministic mock provider. Searches can limit result counts and apply a publication-date cutoff, supporting point-in-time research by removing results dated on or…
This notebook explains how a conditional autoencoder extends instrumented PCA for ETF return modeling. Both methods map fund features to factor exposures and combine those exposures with factor returns; the autoencoder replaces IPCA’s linear…
This case study explains why stop-losses, trailing stops, and other position-level overlays cannot be tested for US firm-characteristics portfolios built from monthly observations. The vectorized backtest applies one weight vector to a realized forward…
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…
This notebook uses linear regression as a baseline for forecasting NASDAQ-100 returns from minute-level microstructure features. Because spread and order-imbalance measures overlap across lookbacks, the feature matrix is highly collinear: ordinary least…
This configuration specifies a long-only ETF ranking and rebalancing experiment. It defines a broad 100-ETF universe spanning equity, bond, commodity, and regional exposures, with monthly decisions and next-open execution. The main label forecasts a 21-day…
This notebook builds prediction intervals around gradient boosting forecasts and compares split conformal prediction with quantile regression, conformalized quantile regression, and adaptive conformal inference. Split conformal uses a chronological training…
This US equities panel study uses a penalized linear model as a baseline for forecasting forward returns from features observed at the close. Its feature set contains overlapping momentum and volatility measurements, creating multicollinearity that can make…
This benchmark compares CSV, Parquet, Feather (Arrow IPC), and HDF5 using the same deterministic OHLCV panel. It measures write time, materialized read time, file size, and the effect of reading only selected columns. The timing policy uses a single write…
This ETF feature study builds three model-derived inputs: a hidden Markov model (HMM) that estimates market regime, fractionally differenced prices for reference funds, and per-ETF GARCH(1,1) conditional volatility. It emphasizes that avoiding look-ahead…
This tutorial compares fixed stop-loss and take-profit barriers, trailing stops, ATR-scaled exits, a machine-learning exit signal, and combinations of these approaches on daily SPY data. Fixed barriers are simulated from entry prices, with overnight gaps…
This study compares gradient-boosted trees with a penalized linear model for ranking currency pairs by future returns. Its motivation is that trees can represent conditional relationships, such as using momentum in one market regime and carry in another,…
This notebook assembles a forecasting agent from a language-model client, a search tool, and a bounded turn loop. The agent searches for evidence and returns a binary probability with a rationale. Its response parser handles common formatting failures and…
This notebook applies Bayesian structural time-series event-study methods to estimate the impact of Federal Reserve announcements on a bond ETF. It builds a counterfactual from pre-event relationships between the target’s daily log returns and returns on…
This notebook compares DQN, PPO, and A2C in a shared simulated trading environment calibrated to hourly Bitcoin perpetual-futures returns. A GARCH(1,1) model supplies volatility clustering, while the environment charges for position changes and applies an…
This notebook explains why raw equity prices can produce misleading returns when they cross stock splits or cash dividend dates. It describes backward adjustment, which scales historical prices for later corporate actions, and distinguishes raw prices for…
This notebook tests whether model-based position sizing improves on equal weighting in a US firm characteristics strategy. It compares score weighting, which allocates more to names with higher predicted scores, with conformal weighting, which reduces…