Log Returns computes ln(close[t] / close[t-N]). Logs make returns
additive: the log return over 10 bars equals the sum of the
ten single-bar log returns. Plain returns compound, log returns
add - that's the whole point.
Formula
log_returns[t] = ln(close[t] / close[t-N])Params
period- lookback in bars. Required.
Output
Single column named after your indicator (e.g. log returns over 5 bars).
When to pick log returns
- Cross-window aggregation: sums of log returns are meaningful; sums of percent returns aren't.
- Volatility math: stddev of log returns approximates annualized vol cleanly. Stddev of percent returns is noisier.
- Statistical models: most academic factor and risk models work on log returns.
When to stick with Returns
When the threshold you care about is "did the market move 5%?" plain returns are more intuitive. For most trading rules, the two are interchangeable.
Pitfalls
For small price changes, log returns and percent returns are
basically equal. For large moves they diverge - a +100% percent
return is ln(2) = 0.69 in log space, not 1.0.
