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.…
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
100 documents
The notebook trains a vanilla autoencoder on standardized hourly returns for a group of crypto perpetual markets. Its encoder compresses the cross-asset return vector into a two-dimensional latent representation, and its decoder reconstructs the input. The…
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 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 notebook compares three ways to convert signed return predictions into binary positions: a fixed zero cutoff, a trailing percentile of each symbol’s own scores, and a cross-sectional percentile across symbols. It measures signal activation and state…
This case study selects one configuration from a frozen pool of crypto perpetual futures strategies spanning multiple return and direction labels, portfolio sizing methods, and risk overlays. It chooses the highest validation Sharpe, then examines…
This notebook uses double machine learning to estimate whether deviations in perpetual-futures premiums relate to subsequent eight-hour returns, and whether the estimated relationship differs between high- and low-volatility markets. It describes a panel…
This notebook trains a Proximal Policy Optimization agent to liquidate a fixed order over a set horizon. It compares the learned pacing policy with TWAP and an Almgren–Chriss schedule, measuring implementation shortfall and examining when each strategy…
This notebook estimates whether a crypto perpetuals premium z-score is associated with subsequent eight-hour returns under an intervention, adjusting for price volatility, funding rate, and the premium’s deviation from its recent mean. Double machine…
This notebook isolates results for the LEAN engine from an audit comparing retained real-strategy runs with matching ML4T Backtest profiles. It identifies four supported workloads: ETF allocation, crypto perpetual funding, USD-quoted FX allocation, and a US…
This notebook describes how to produce holdout predictions for a selected crypto perpetuals funding strategy. It resolves the configuration from validation results, carries its checkpoint choice forward, and builds a new training specification using data…
This document studies position-level exits added to an existing crypto perpetual strategy: fixed stop losses, trailing stops, and time-based exits. It explains that these controls only close positions selected by the underlying strategy, and evaluates them…
This notebook compares DQN, PPO, and A2C in a simulated cryptocurrency trading environment. It calibrates a GARCH(1,1) volatility process on hourly Bitcoin perpetual-futures returns, then simulates paths that preserve volatility clustering while leaving…
This notebook describes how to generate holdout predictions for a crypto perpetual funding strategy after its configuration has been selected using validation results. It resolves the highest-Sharpe eligible validation backtest, carries over the model…
This module defines a point-in-time simulation environment for executing a large sell order in crypto perpetual futures. Its observations combine remaining inventory and time with market volatility, premium index, relative volume, hour of day, and time to…
This document describes a pipeline for downloading official Binance USD-M perpetual funding records, normalizing them, and caching them in a columnar file. Monthly archives are fetched concurrently for the requested symbols and date range. The records are…
This analysis selects one configuration from a frozen pool of crypto perpetual-futures candidates spanning four prediction labels and multiple strategy stages. It chooses the highest validation Sharpe and treats label, split, and execution details as part of…
This notebook compares gradient boosting configurations for crypto perpetual futures using features built around the premium of perpetual contracts over spot. It varies tree capacity and loss function, including squared, absolute, and Huber losses, and…
This notebook develops model-based features for crypto perpetual futures: per-asset conditional volatility forecasts from GJR-GARCH and a market-wide stressed-regime probability from a two-state Gaussian hidden Markov model fitted to funding settlements.…
This case study lays out a research pipeline for crypto perpetual futures, treating funding payments exchanged between long and short positions at regular settlements as a potential return source. It describes data and model stages from label construction…
This notebook evaluates a DeFi total value locked series as alternative data for trading ether. It organizes the review around four questions: whether the series relates to forward returns, whether the data is sound and reconstructible, whether its use is…
This demo outlines an always-on crypto trading loop connected to Alpaca’s USD spot market. It maps a perpetual-futures case-study universe to the venue’s supported spot pairs, making clear that only a subset can be traded there. The example signal is a…
This notebook demonstrates covariate-drift monitoring for ETF momentum features and crypto perpetual futures features across contrasting market windows. It compares Population Stability Index, which measures changes in individual feature distributions, with…