This notebook clusters monthly macroeconomic indicators to describe market conditions independently of equity returns. It aligns FRED series to month-end observations, standardizes unemployment, the federal funds rate, the yield-curve spread, and…
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
124 documents
This notebook adapts Diffusion-TS to generate synthetic daily ETF return sequences. Its denoiser predicts the original series and decomposes that prediction into a polynomial trend, selected Fourier components, and a residual. A combined time-domain and…
This notebook connects position sizing with analysis of maximum adverse and favorable excursions. It demonstrates fixed-fractional sizing, where shares are determined by a per-trade risk budget and entry-to-stop distance, subject to a concentration cap. It…
The document derives European call and put prices under Black-Scholes, checks their relationship through put-call parity, and computes implied volatility by numerically solving for the volatility that matches an observed option price. It also defines Delta,…
This feature-engineering module prepares daily price data for systematic macro portfolio models. It creates horizon returns scaled by estimated volatility, several multi-scale MACD signals, and rolling z-scores of log prices. The return horizons can use a…
This tutorial surveys features built from asset price and volume histories, including returns across horizons, trend and reversal measures, several volatility estimators, volatility regimes, liquidity, tail risk, and cross-sectional normalization. It…
This notebook explains three ways to turn minute-level NASDAQ-100 data into model-based features: a rolling HAR regression for variance forecasts and forecast errors, a Fourier transform for recent volume patterns, and depth-two path signatures for the order…
This module estimates parameters for simulated crypto markets used in reinforcement-learning environments. It loads hourly perpetual-market data for a selected symbol, computes close-to-close log returns, and fits a GARCH(1,1) volatility model. If the…
This document describes a Gymnasium environment for training an agent to liquidate a position over a fixed horizon. The observation combines remaining inventory and time with spread, market depth, volatility, and a normal or stressed regime. A continuous…
This notebook separates continuous price variation from discrete jumps in intraday equity returns. It estimates daily realized variance from squared log returns and uses bipower variation as a jump-robust estimate of the continuous component; their…
This chapter surveys ways to turn fitted statistical procedures into features for trading models. It covers diagnostics and stationarity, structural breaks, fractional differencing, Kalman filtering, spectral and path-signature methods, ARIMA and GARCH…
This configuration specifies a historical macroeconomic dataset from FRED for regime filtering and cross-asset analysis. It organizes series by daily, weekly, monthly, and quarterly frequency, including Treasury yields, the federal funds rate, the VIX, labor…
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…
The document explains how uncertainty from a model can provide information beyond its point estimate. It contrasts GARCH, which defines volatility from past returns, with a stochastic volatility model that treats volatility as a latent autoregressive process…
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 presents a workflow for deciding how financial time series should be modelled. It begins with plots of SPY prices and returns, VIX levels, and the return distribution to identify drifting levels, clustered moves, and heavy tails. It then…
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 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 compares ways to exit long ETF trades: fixed profit targets and stops, trailing stops, ATR-scaled barriers, machine-learning signals, and combinations. It builds indicators and trade simulations, then summarizes trade returns, win rates,…
This notebook explains how to inspect a shipped panel of economic series from FRED and interpret its calendar-day grid, metadata, and derived columns. Because the panel has been flattened onto a daily calendar, row counts conceal the source release…
This notebook treats ARIMA forecasts as input columns for later models rather than as standalone predictions. It fits models to ETF returns, uses stationarity checks and autocorrelation diagnostics to propose orders, and compares candidate orders with an…
The document explains two ways to estimate bid-ask spreads when only daily OHLCV data is available. Corwin-Schultz compares high-low ranges over adjacent one-day and two-day intervals, using the different behavior of volatility and spread to separate them;…
This notebook presents a workflow for characterizing market series before modeling. It begins with plots of SPY prices and returns, VIX levels, and the return distribution to identify trends, volatility clustering, and heavy tails. It then explains how to…
This notebook uses SPY daily returns to explain frequency-domain analysis and its limits as a source of trading features. A wavelet decomposition separates variation into bands at successively slower time scales, while spectral estimates describe how return…