This module describes a candidate-selection process for pairs trading based on dimensionality reduction and clustering. It starts from a panel of asset prices, converts prices to returns, standardizes them, and applies principal component analysis to create…
Libreria delle conoscenze
Sintesi e idee chiave, redatte dall'agente di ricerca di Stratmill, dei libri, articoli scientifici, articoli e codice letti dai nostri agenti AI. Ogni pagina rimanda all'originale.
Cerca nella libreria
219 documenti
This document describes methods for selecting long-short portfolios that aim to mean-revert while holding only a small subset of assets. Sparsity can reduce trading costs and make portfolio exposures easier to interpret than dense portfolios that include the…
This note explains a long-short pairs strategy that uses a copula to model the dependence between two stocks. After selecting a pair, for example with a cointegration test, the method fits the copula and each stock’s empirical distribution on a formation…
This utility reconstructs an order book from a supplied sequence of market-data files and returns the market-depth state at the end of that data. It configures a backtest asset with the relevant tick size and lot size, and can optionally seed reconstruction…
The method selects hedge ratios for a basket spread by minimizing the absolute estimated half-life of mean reversion. It treats one price series as the target and the remaining series as explanatory assets, forming the spread as the target minus their…
This abstract copula framework provides shared methods for bivariate copula implementations, with named families including Archimedean, Gaussian, and Student forms. It evaluates copula density and cumulative joint probability, and calculates a conditional…
This Python class assembles a subset of Alpha101-style equity signals from price, volume, VWAP, returns, and precomputed factor series. Its methods apply operations such as cross-sectional ranking, rolling correlation, covariance, time-series ranking, decay,…
The document explains a threshold-selection method for pairs trading when the modeled log price follows an Ornstein–Uhlenbeck process. It builds on earlier work by deriving expressions for the expected first-passage time with two-sided boundaries, then uses…
This document defines a common interface for calculating trade amount and account equity, then supplies formulas for linear and inverse assets. For a linear contract, amount scales with contract size, execution price, and quantity; equity adds the marked…
This utility converts Binance historical order-book depth, snapshot, and trade files into an event format used by HftBacktest. It reads CSV data, identifies or infers column headers, maps records to depth, snapshot, or trade events, and assigns exchange and…
This Rust example shows how to wrap HftBacktest’s local processor to add custom handling around market events and order responses. The wrapper implements the local processor interface by forwarding order submission, modification, cancellation, state, depth,…
This document outlines a daily strategy for trading a set of assets using a cointegration vector estimated with the Johansen method on training data. It applies the vector to log prices to form a combined process, then sums its recent changes to determine…
This proposed Chinese equity screen focuses on companies classified in the metaverse industry. It combines a market capitalization below 10 billion yuan, positive recent price return, and a profitability condition described as avoiding losses. The article…
This example generates order-latency records for a crypto trading backtest from historical feed data. It first keeps events that contain both exchange and local timestamps, then aggregates to one record per second using the last timestamps in each interval.…
This implementation describes a pairs strategy that estimates conditional probabilities from a fitted copula applied to each asset’s return ranks. It converts prices to returns, maps returns through marginal cumulative distribution functions, and uses the…
The method searches for hedge ratios that make a portfolio spread more stationary according to the Augmented Dickey–Fuller (ADF) test statistic. It defines the spread as the target asset’s price series minus a weighted sum of the other price series, then…
The code implements a Cox–Ingersoll–Ross model for a mean-reverting portfolio, extending an Ornstein–Uhlenbeck model interface. It supports fitting the model to portfolio prices or to two assets, and estimates the long-run mean, reversion speed, and variance…
The code implements a statistical-arbitrage strategy that uses a fitted C-vine copula to estimate conditional probabilities for a target asset from a panel of returns. It transforms each asset’s returns through fitted cumulative distribution functions,…
The distance approach selects two instruments whose historical price series moved together, then trades when their price spread exceeds a chosen threshold during a later testing period. The strategy buys the instrument with the lower price and shorts the one…
The document lays out a screening process for spreads used in pairs trading and statistical arbitrage. Candidate constituents are tested for cointegration, mean-reverting behavior, practical reversion speed, and frequent crossings of the spread’s mean. It…
This order manager handles exchange order updates arriving through separate REST and WebSocket channels, which may arrive late or out of sequence. It keeps each order’s state and applies an update only when its exchange timestamp is at least as recent as the…
This document develops order book imbalance as an alpha input for a crypto market-making strategy. It defines static and standardized imbalance, then compares related measures: volume-adjusted mid-price (VAMP), weighted-depth order book price, and a hybrid…
This overview introduces neural networks as flexible models for financial prediction and describes multilayer perceptrons, recurrent networks with LSTM cells, and higher-order neural networks. It explains how input, hidden, and output layers combine…
The document outlines an equities statistical arbitrage method that uses principal component analysis to estimate common return factors. Asset returns are standardized, PCA components provide factor weights, and regressions of returns on factor returns…