This notebook builds forward return labels for short at-the-money straddles on S&P 500 stocks. Because the daily 30-day straddle panel rolls to a different strike or expiration each session, a shifted price series would compare different contracts. Instead,…
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 compares equal weight, inverse volatility, minimum variance, and hierarchical risk parity using the same ETF universe, forecasts, rebalance schedule, and backtest protocol. A rolling Ridge model ranks ETFs from momentum, moving-average…
This utility module provides statistical helpers for diagnosing trading-data panels. Its autocorrelation method computes a curve within each entity before pooling results across entities, avoiding spurious dependence between the end of one entity’s series…
The notebook explains Value at Risk (VaR), which marks a loss quantile, and Conditional Value at Risk (CVaR), which averages losses beyond that threshold. Using daily ETF returns, it compares historical, Gaussian, Cornish–Fisher-adjusted, and Student-t Monte…
This teaching notebook compares target-label methods for supervised trading models using ETF data. It covers fixed-horizon returns and direction labels, rolling time-series percentiles, cross-sectional percentiles, triple-barrier labels with fixed or…
This notebook demonstrates checks for lookahead bias using ETF prices and macroeconomic series. It shows that a centered moving average includes future observations, can track price turns too closely, and has a missing recent tail because its future inputs…
This exploratory analysis profiles a four-hour OANDA panel of 20 currency pairs and explains how to interpret its data. It distinguishes direct, indirect, and cross pairs by the dollar’s position, showing why direct quotes must be inverted before combining…
This shared modeling module supports quantitative research workflows by loading features, labels, temporal data, and configuration, then preparing walk-forward cross-validation folds. Its design emphasizes reproducibility and data lineage: hashes capture…
This notebook shows how to turn quarterly SEC 10-Q Management’s Discussion and Analysis text into two candidate equity signals. FinBERT scores text chunks for positive, neutral, or negative tone; chunk scores are aggregated into average sentiment and…
This notebook compares three ways to use market regimes in forecasting: a baseline model without a regime input, a single model given the filtered probability of a volatile state, and separate models trained within hard regime assignments. To avoid…
This notebook checks whether the data can support a weekly, cross-sectional futures strategy before any model is fitted. It describes a design that ranks CME products, takes long positions in the highest-ranked contracts and short positions in the lowest,…
This notebook uses Double Machine Learning (DML) to estimate the adjusted effect of a continuous ETF momentum measure on subsequent returns, controlling for recent and longer-term volatility, market regime, and yield-curve slope. It compares unadjusted…
This notebook explains Hierarchical Risk Parity (HRP), a portfolio construction method designed to limit sensitivity to noisy covariance estimates. It describes its three stages: cluster assets by correlation distance, reorder them according to the resulting…
This notebook assesses registered ETF backtests across the strategy pipeline, from signals and allocation through costs and risk overlays. It reads existing predictions and backtests rather than fitting models or adding new backtests, while deriving cohort…
This notebook sets up an LSTM forecasting run for an FX-pairs case study. The model carries a hidden state through a lookback sequence, and the notebook resolves architecture and training settings through the shared configuration and study-planning tools. It…
This notebook compares six ways to weight ETF portfolios selected by the same predicted ranking: equal weight, score weighting, inverse volatility, risk parity, mean-variance optimization, and hierarchical risk parity. It varies the number of selected funds…
This notebook gathers registered double machine learning estimates from multiple trading case studies and compares their uncertainty and diagnostics. It loads current rows from each study’s registry, checks registry integrity and label uniqueness, makes…
This notebook fits a declared LSTM model for forecasting in an S&P 500 options study. The network receives chronological windows of each symbol’s history and uses gated recurrent state to represent information across sessions, rather than relying only on…
This notebook trains a PPO agent to schedule a parent sell order across hourly perpetual-futures bars. It augments price and volume history with the perpetual premium and time to the next funding settlement, while lagging information that would not yet be…
This notebook explains how to build and inspect a quarterly equity fundamentals panel from SEC XBRL data. Each observation carries both the fiscal period it describes and the filing date when the information became public. That distinction is essential in…
This notebook evaluates accounting and price-based characteristics as standalone predictors of next-month US stock returns. It computes monthly cross-sectional rank correlations between each characteristic and the return label, then summarizes them across…
This notebook screens candidate features for a CME futures case study against forward returns. For each feature, it computes cross-sectional rank correlations between feature values and subsequent returns, summarizes the correlation over dates, adjusts…
This notebook presents a diagnostic framework for an ETF allocation backtest. It calculates risk and return measures such as Sharpe, Sortino, Calmar, volatility, value at risk, and maximum drawdown; tracks rolling performance and drawdown recovery; and…
This notebook introduces vectorized backtesting with VectorBT through a long-only RSI mean-reversion rule on Bitcoin perpetual market data. It calculates a close-based RSI, enters when the prior day’s reading is below a lower threshold, and exits when it is…