This notebook describes how to evaluate a selected crypto perpetual funding strategy on a later holdout period. It reuses predictions generated from training data ending before the holdout, carries the chosen signal, allocation method, and exit overlay…
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 introduces path signatures as fixed-length features that preserve the order and joint geometry of observations in a time-series window. The first level records each coordinate's total change; the second captures signed area between coordinate…
This notebook explains how to build and inspect a quarterly US equities fundamentals panel from SEC XBRL data while preserving both the period a fact describes and the date it became public. For a historically valid backtest, the filing or announcement date…
The document demonstrates a VectorBT workflow for a long-only Bitcoin RSI mean-reversion rule. It calculates RSI from daily close prices, enters when the prior day’s reading falls below a lower threshold, and exits when it exceeds an upper threshold.…
This notebook builds N-BEATS for forecasting SPY closing prices. Fully connected blocks process a complete lookback window and each produces a backcast, which is subtracted before the next block, and a forecast for the future horizon. Constrained blocks use…
This tutorial explains how to detect and prevent lookahead bias in ETF and macroeconomic data. It demonstrates that centered moving averages use future observations, while a simple correlation between a feature's level and next-period return can miss…
The document evaluates how trading costs change the validation performance of one previously selected S&P 500 equity and options allocation. It sweeps one-way charges as a fraction of traded value and compares them with a flat per-share commission and…
This notebook uses correlation-based principal component analysis on sector ETF returns to describe common risk factors and sector rotation. Standardizing returns gives each sector unit variance before decomposition, reducing the chance that a more volatile…
The notebook compares Monte Carlo dropout and deep ensembles as ways to estimate uncertainty around daily ETF return forecasts. Dropout remains active across repeated predictions, while ensemble members are separately trained; the spread of predictions from…
This audit compares multiple backtesting engines on shared historical inputs for ETF allocation, CME futures, crypto perpetuals with funding, foreign exchange, and US equities. Each supported pair receives the same content-addressed market data and frozen…
This notebook implements a long-only RSI mean-reversion rule for BTC/USDT perpetuals using an event-driven backtesting engine. It aggregates intraday bars into UTC daily OHLCV data, computes a rolling gain-and-loss RSI, enters when the indicator falls below…
This notebook explains a principal-component baseline for forecasting CME futures returns. PCA is fitted to the training fold’s product-return panel, so its components represent co-movement directions across contracts rather than compressed carry, momentum,…
This notebook compares weekly-grid sequence models for predicting the same five-session forward return used on a daily grid. Sampling on Fridays makes that label approximately a one-step-ahead target, allowing a direct regression formulation to be compared…
This document describes how to select a frozen set of equities for validation and holdout backtests using an estimated round-trip trading cost. The proxy combines estimated per-share costs relative to mean share price with twice the median half-spread, both…
This notebook applies TabM, a weight-sharing neural ensemble, to stock-return targets built from equity-option features. Its members use a common two-layer network backbone, with separate activation scaling vectors and output heads whose predictions are…
This notebook explains how to construct forward price-return labels for an eight-hourly crypto perpetuals panel. It shifts bar-open timestamps to the time completed-bar data becomes available, then calculates future returns on the contract price series…
This chapter surveys ways to generate synthetic financial data and how to decide whether the output is useful. It starts from the limited number of realized market paths and the risk that repeated strategy searches inflate apparent backtest performance. It…
This case study compares declared fixed and trailing stop rules for FX positions. It first selects one parent strategy per label from a sealed validation cohort, then varies only the position risk rule. Because stops respond to price movements within a…
This document explains why a daily constant-maturity option series is not a return series for a position actually held. It selects same-strike, same-expiration call and put legs that pass liquidity, maturity, volatility-estimation, and delta filters, then…
This notebook applies TabM to a flat table of US stock features, positioning it between penalized linear models and tree ensembles. Each ensemble member shares a neural network backbone but has its own scaling vector and output layer; averaging member…
This analysis compares registered ETF prediction models across several families on a shared cross-asset panel. It evaluates how well each model ranks funds by subsequent returns using information coefficients, examines confidence intervals and fold-level…
This utility computes selection-bias and performance uncertainty metrics for groups of strategy backtests. It forms cohorts at family, stage-and-label, and label granularity, then calculates measures including deflated Sharpe ratios, effective trial counts,…
This analysis explains how CME futures data is organized into products, expiring contracts, and volume-rolled continuous series. It uses E-mini S&P 500 data to show how individual contracts have finite trading windows that overlap around a roll, while a…
This document describes implementation principles for a shared backtest runner and focuses on interpreting return grids correctly when annualizing performance. It estimates the observed sampling frequency from typical gaps between return observations,…