Log Return
Quick Reference
| Property | Value |
|---|---|
| Dimension | signal |
| Category | momentum |
| Version | v1.0 |
| Output Column | log_return |
Log return of price over a time window: log(price_t / price_{t-window})
Formula
log(trade_price / lag(trade_price, window_seconds))
CDM Inputs
| Column | CDM Table | Description |
|---|---|---|
trade_price | cdm_trade_enriched | Trade data enriched with bar context — price, volume, side, trade type |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
window_seconds | integer [1, 86400] | 60 | Lookback window in seconds |
Output
Column: log_return
Log return over the specified window
Market Intuition & Trading Rationale
Log return computes the continuously compounded return over a time window: log(price_t / price_{t-window_seconds}). Unlike simple returns (price_t / price_{t-1} - 1), log returns are time-additive — the log return over a day equals the sum of log returns over every sub-interval within the day. This mathematical property makes log returns the natural choice for statistical modeling, risk measurement, and multi-period aggregation.
For short windows (30–300 seconds), log_return approximates the instantaneous drift in price. A log return of +0.001 over 60 seconds means the price has increased by roughly 0.1% (continuously compounded) in the last minute. The sign and magnitude directly indicate recent directional momentum. Because log returns are approximately normally distributed (unlike simple returns which are bounded below by -100%), they are the preferred form for z-score normalization, volatility scaling, and parametric risk models.
The choice of window_seconds determines the momentum horizon. Ultra-short windows (1–30 seconds) capture microstructure noise and are suitable for high-frequency mean reversion. Short windows (30–300 seconds) capture order-flow-driven momentum — the persistence of trade imbalance pushing prices. Medium windows (300–3600 seconds) track intraday trends. Long windows (3600–86400 seconds) approach daily horizon returns.
Log returns form the building block for most higher-order statistical features. Realized volatility is computed as the standard deviation of log returns. The Sharpe ratio is mean(log_return) / std(log_return). Correlation and beta between instruments use log returns as inputs. Auto-correlation of log returns measures mean reversion strength. Every feature in the volatility and statistics families depends on log returns as their fundamental input.
Usage Cases
- Momentum signal: The sign and magnitude of log_return over short windows (60–300s) provides a direct momentum signal. Combine with volatility scaling for risk-adjusted entries.
- Volatility input: Feed log_return into realied_volatility, garman_klass_vol, or parkinson_vol for multi-horizon volatility estimation.
- Mean reversion input: Negative autocorrelation of log returns at short horizons signals mean reversion. Compute the lag-1 autocorrelation of log_return as a mean reversion strength indicator.
- Cross-asset correlation: Compute rolling correlation between log_return series of different instruments to measure cross-market linkages.
YAML Definition
name: log_return
description: 'Log return of price over a time window: log(price_t / price_{t-window})'
category: momentum
version: v0.9.0 (Beta)
dimension: signal
required_inputs:
- cdm_trade_enriched.trade_price
output_column: log_return
output_description: Log return over the specified window
tags:
- momentum
- signal
- return
parameters:
window_seconds:
type: integer
description: Lookback window in seconds
required: false
default: 60
constraints:
min: 1
max: 86400
formula: log(trade_price / lag(trade_price, window_seconds))