This notebook explains when a trading strategy is clearer to simulate bar by bar with evolving state than to express as precomputed signals or weights. It contrasts array-based backtests, which can be fast and convenient for parameter sweeps, with sequential…
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 exhaustive grid search with Optuna’s TPE Bayesian sampler for tuning a LightGBM model on an ETF forward-return prediction task. It first gives both methods the same trial budget over a small categorical grid, where exhaustive search…
This chapter presents strategy research as the design and evaluation of an executable decision process, from the initial economic idea through position sizing, constraints, costs, and live-like testing. It recommends classifying strategy families and…
This notebook defines forward-return labels for a US equities panel and explains why their construction affects every downstream model and backtest. It specifies adjusted-price return windows in trading sessions, checks that each stock has the required…
This notebook trains TabM neural networks to rank ETFs using the same flat feature table as linear and boosted models. Each ensemble member shares a two-layer backbone but has its own scaling vector and output layer, allowing predictions to be averaged with…
This notebook describes fitting PatchTST to one-minute NASDAQ-100 data to predict returns over several forward horizons. The model groups consecutive observations into patches and applies attention across them, reducing the number of items compared while…
This notebook checks whether historical ETF data can support a monthly ranking strategy before fitting a model or making forecasts. It tests the tradable universe using prior-year liquidity, counts eligible funds on rebalance dates, converts per-share…
This notebook compares ways to allocate capital across US equity positions while holding the model, checkpoint, rebalance dates, and selected stocks fixed. It examines weights based on prediction strength, prediction-interval width, individual stock…
This notebook explains an unconditional signature-based Wasserstein GAN for generating financial time series. It transforms returns into augmented paths, computes truncated path signatures, and trains an LSTM generator driven by Brownian noise to match…
This notebook evaluates stop losses, trailing stops, and fixed-duration exits on selected US equity strategies. A stop loss responds to losses from entry, a trailing stop responds to declines from a position’s peak, and a time exit closes after a set holding…
This notebook evaluates TSMixer as a global sequence model for an ETF panel. The model shares parameters across funds while using each fund’s own history and covariates; its mixing layers learn temporal and within-series relationships without combining one…
This notebook defines forward-return targets for a cross-sectional futures strategy that ranks products by term structure, going long those with stronger carry and short those with weaker carry. It distinguishes roll-adjusted prices, appropriate for…
This notebook describes using TSMixer to predict stock returns from ordered windows of each stock’s features. Each example contains 60 consecutive sessions; windows that cross gaps in a stock’s history are excluded, so the number of usable examples varies…
This notebook turns validation predictions from multiple model families into equal-weight, long-short portfolios. It ranks stocks by predicted return, buys the top names and shorts the bottom names, and sweeps several portfolio concentrations using a shared…
This notebook compares equity and futures commission models alongside several slippage models, emphasizing that their units and assumptions differ. Percentage fees stay constant as a share of notional, while minimums, fixed charges, per-share fees, and tier…
This document explains a supervised autoencoder factor model for predicting stock returns in an equity option analytics research setting. Unlike PCA, IPCA, and an unsupervised conditional autoencoder, its training objective combines reconstruction of the…
This document describes a fixed out-of-sample backtest for a selected CME futures strategy. The configuration, predictions, allocator, rebalance cadence, concentration, and transaction-cost assumptions are inherited from earlier research steps and applied…
This notebook studies linear prediction models for a cross-section of CME futures products using feature columns grouped into related families, including carry, momentum, volatility, and rolling risk measures. Because columns within a family are often…
This educational analysis compares four neural network designs on the same task: predicting the next daily return from a recent window of returns. A pooled set of eight exchange-traded funds provides varied market exposures. The models differ in how they…
This notebook audits the complete set of canonical validation predictions for an FX pairs study. It checks model identity, artifact availability, completeness, configured-label coverage, and whether the assembled configurations match the declared menu.…
This notebook audits the registered validation predictions for an FX pairs study. It checks that the catalog includes the configured model population, complete prediction sets, available artifacts, and current model identities. It then summarizes predictive…
This notebook evaluates NLinear, a simple sequence model that subtracts the latest observed level from a lookback window and maps the resulting sequence to a forecast with a linear transformation. It fits the ETF model population on walk-forward folds and…
This case study fits linear models to predict returns and direction in crypto perpetual futures. Its feature matrix is dominated by variations of the perpetual premium, the gap between the contract and spot price that drives funding payments. It contrasts…
This notebook presents a conditional autoencoder for equity returns in which a neural network maps stock characteristics to nonlinear factor loadings, while another network extracts contemporaneous latent factors from characteristic-managed portfolio…