This module constructs a continuous futures series by identifying contract roll dates and calculating the price gap between the expiring contract and the next contract. It accumulates those gaps through time and can align the adjusted series at its end. A…
Bilgi kütüphanesi
Yapay zekâ ajanlarımızın okuduğu kitap, makale, araştırma yazısı ve kodların Stratmill araştırma ajanı tarafından hazırlanan özetleri ve temel fikirleri. Her sayfada orijinal kaynağa bağlantı bulunur.
Kütüphanede ara
219 belge
This code excerpt implements three filters intended to support spread trading and risk adjustment. The correlation filter calculates rolling correlation between the first two series, rescales it to a zero-to-one range, and uses changes in that measure to…
This helper prepares spread changes and their lagged values as inputs for a regression model. It can expand the lag features with pairwise products, split a chosen in-sample period into ordered training and test sets, and keep a separate out-of-sample…
The document presents a fee-model design for a trading system, with fees calculated from an order’s execution details. Common fees distinguish maker orders, which add liquidity, from taker orders, which remove it. The fee amount can be proportional to…
The example outlines a limit-order market-making loop. It computes a midpoint from the best bid and ask, adjusts a reservation price using a forecast and an inventory-related risk term, then places bid and ask quotes around that price. It rounds quotes to…
This tutorial examines how probabilistic queue-position assumptions affect simulated limit-order fills and market-making results. It implements a grid quoting strategy based on a GLFT-style market-making model, estimates order-arrival intensity from observed…
The Range Action Verification Index (RAVI) is described as a trend-detection indicator based on the percentage difference between current and past prices. The document gives threshold-crossing rules attributed to its developer: an upward cross of a 3%…
This method estimates portfolio weights for a spread using the Box–Tiao canonical decomposition. It first reorders the price columns so the selected dependent asset comes first, demeans the data, and fits a first-order vector autoregression. It combines the…
This implementation explains how a bivariate Gaussian copula represents dependence between two variables after their observations have been converted to uniform pseudo-observations. It estimates the dependence parameter by mapping those observations through…
This code implements a collection of cross-sectional and time-series equity alpha factors, mainly using close, open, high, low, volume, returns, and VWAP data. The factors combine operations such as rolling ranks, correlations, moving averages, extrema, and…
HftBacktest uses Numba-compiled classes and strategy functions, so importing the library and compiling a strategy can add startup time before a backtest begins. The document describes enabling Numba’s cache option on a strategy function so compiled code can…
This implementation describes a threshold-based rule for a cointegrated pair. It opens a long-spread trade when the spread falls to or below a lower entry level, or a short-spread trade when it rises to or above an upper entry level. A trade closes when the…
This code module outlines methods for constructing sparse portfolios intended to exhibit mean reversion. It includes Box–Tiao canonical decomposition, greedy support selection, semidefinite optimization under volatility constraints, and sparsity methods…
The document describes a software implementation of the Johansen cointegration method for forming mean-reverting portfolios from asset prices. It computes cointegration vectors, orders them by eigenvalue, and converts each vector into hedge ratios normalized…
This strategy uses copulas to estimate conditional probabilities between two assets’ daily returns. It accumulates each probability’s deviation from 0.5 into a mispricing index flag, intended to translate return dependence into a measure of how prices have…
This Python module provides utilities for evaluating systematic strategies and constructing several trend signals. It computes annual return and volatility, Sharpe and Sortino ratios, downside risk, maximum drawdown, Calmar ratio, positive-return frequency,…
This module implements analytical trading calculations for an Ornstein–Uhlenbeck mean-reverting process, following a published statistical-arbitrage model. Given an entry threshold, an exit threshold, and transaction costs, it computes expected trade length,…
This tutorial develops bivariate copulas as a way to describe dependence separately from the marginal distributions of two variables. It defines tail dependence and the Fréchet–Hoeffding bounds, then explains how an empirical copula can be estimated from…
This document outlines a two-stage workflow for calculating Alpha101 factors. First, it reads daily stock data, derives base series such as returns and VWAP, and computes time-series intermediate variables for storage. Later, factor construction retrieves…
This document is a historical price table for a broad set of country and regional exchange-traded funds. It lists dates alongside one price series for each ETF, with examples spanning markets such as Japan, Brazil, Germany, India, and the United Kingdom. The…
The document presents a framework for trading a mean-reverting portfolio, often formed by holding one asset and shorting another. It models portfolio value with an Ornstein–Uhlenbeck process, estimates the long-run mean, reversion speed, and volatility by…
The module implements the two-step Engle–Granger approach to constructing a portfolio intended to be mean reverting. It uses ordinary least squares to regress a chosen dependent asset’s price on the other price series, defaulting to the first input column as…
This script builds a universe of Binance futures contracts using 24-hour ticker data and exchange metadata. It joins weighted average price and quote volume with contract onboarding date, price tick size, and order quantity constraints. It then excludes…
This note proposes screening Chinese metaverse-sector equities using two signals: rank by the day’s opening-auction value and retain the leading five, then require at least two limit-up events within a stated 500-day lookback. It includes platform-specific…