Log Spread
Quick Reference
| Property | Value |
|---|---|
| Dimension | execution |
| Category | statistics |
| Version | v0.9.0 (Beta) |
| Output Column | log_spread |
Calculate log spread (log(ask/bid))
Formula
log((best_ask_price / best_bid_price))
CDM Inputs
| Column | CDM Table | Description |
|---|---|---|
best_bid_price | cdm_* | CDM source table |
best_ask_price | cdm_* | CDM source table |
Parameters
This FeatureType has no configurable parameters.
Output
Column: log_spread
Logarithmic spread
Market Intuition & Trading Rationale
Log spread transforms the quoted spread into a symmetric, scale-free measure: log(ask / bid). A stock at $10 with a $0.01 spread and a stock at $1000 with a $1 spread both produce log(1.001) ≈ 0.001 — the same proportional cost. This makes log spread directly comparable across instruments, venues, and time periods without needing to normalize by mid-price.
Because log(ask/bid) ≈ (ask - bid) / mid_price for small spreads (first-order Taylor approximation), log spread approximates the relative spread in basis points while being mathematically cleaner — it avoids the division by mid_price that can be noisy at high frequency. For larger spreads (illiquid names, stressed markets), the log form remains well-behaved while the linear approximation breaks down.
Log spread is also more normally distributed than raw spread, making it better suited for statistical models that assume Gaussian residuals — z-score normalization, regime detection, and outlier filtering all perform more reliably on log-transformed spreads.
Usage Cases
- Cross-sectional comparison: Compare execution costs across a multi-asset portfolio. Log spread normalizes away price-level differences, so a $10 stock and a $500 stock can be ranked on the same scale.
- Regime detection input: Feed log_spread into
spread_regime_indicatororliquidity_regime_classifier. The log transform makes the distribution closer to normal, improving the z-score based regime detection. - Statistical arbitrage filtering: Screen out pairs or baskets where one leg has systematically wider log spreads. Asymmetric execution costs erode the edge in stat-arb strategies — log spread makes the asymmetry visible.
- Execution algo parameterization: Use log spread as a dynamic threshold for aggression. When log_spread exceeds a rolling percentile, switch from aggressive to passive execution — the cost of crossing the spread outweighs the urgency benefit.
YAML Definition
name: log_spread
description: Calculate log spread (log(ask/bid))
category: statistics
version: v0.9.0 (Beta)
dimension: execution
status: Pre-release
required_inputs:
- best_bid_price
- best_ask_price
output_column: log_spread
output_description: Logarithmic spread
tags:
- spread
- log
- composition
- quote
- normalized
- simple
parameters: {}
formula: log((best_ask_price / best_bid_price))