Log Return Node

Logarithmic Return — Per-Bar ln(P_t / P_{t-1})

StatisticalReturns

Overview

The Log Return Node computes the natural logarithm of the price ratio between consecutive bars. Log returns are the standard representation used in quantitative finance because they are time-additive, symmetric, and approximately normally distributed for small returns.

They are the preferred input for risk metrics (CVaR, Sharpe, Hurst) and statistical tests that assume normally distributed data.

Formula

logReturn[0] = null   (no prior bar)
logReturn[i] = ln(P[i] / P[i-1])   for i ≥ 1
All input values must be positive (prices, NAV). Zero or negative values produce null output for that bar.

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any positive numeric series (price, NAV, index)
valuesOutput(number | null)[]Log returns per bar; values[0] = null (1-bar warm-up)
timestampsOutputnumber[]Unix timestamps aligned to input

Use Cases

Input to Risk Metrics

Feed log returns into CVaR, VaR, Sharpe, and other risk nodes for statistically sound results.

Strategy Return Analysis

Compute log returns of an equity curve to analyse the distributional properties of strategy performance.

Fractal Analysis Input

Log returns are the recommended input for Hurst Exponent, DFA, and other fractal/statistical indicators.

Tips & Best Practices

Log vs Simple Returns

Log returns are time-additive: sum of daily log returns = total log return. Use for multi-period aggregation. Simple returns are dollar-additive: use for portfolio weighting.

Positive Prices Required

Log return is undefined for zero or negative input. Ensure your price series is strictly positive before connecting to this node.

One Bar Warm-Up

The first output bar is always null because a prior bar is needed for the ratio. Account for this when computing downstream indicators.

Related Indicators