TradingView Backtesting

Tracking Error for Strategy Research: Alignment and Annualization

Tracking error is the standard deviation of active returns: the strategy return minus its benchmark return for each matching period. It measures how variable that gap is, not whether the strategy outperforms. Calculate it only after matching dates, valuation times, currency and return definitions. Historical tracking error describes a realized sample; forecast tracking error depends on a risk model and current exposures.

See the decision guide

Calculate the variation in active returns

For n matched observations, let a[t] = R_strategy[t] - R_benchmark[t] and mean_a = sum(a[t]) / n. This page uses sample tracking error: TE_period = sqrt(sum((a[t] - mean_a)^2) / (n - 1)), with n at least 2. Enter returns consistently as decimals. Multiplying the final result by 100 displays percentage points of return volatility.

  • An uncentered root mean square, sqrt(sum(a[t]^2) / n), also includes the average gap. It is not the centered sample standard deviation used here.
  • Some reports use a population denominator n. That choice gives a different result, especially in a short sample; record the convention when reconciling reports.
StatisticCalculationInterpretation
Mean active returnAverage of periodic return differencesThe average direction and size of the gap
Tracking errorStandard deviation of periodic return differencesThe variability around that average gap
Cumulative tracking differenceCompounded strategy return minus compounded benchmark return over the same datesThe realized endpoint performance gap
Information ratioMean active return divided by tracking error, using compatible unitsAverage active return per unit of active risk

Align the return series before subtracting them

A common date label alone is insufficient. Both returns must cover the same start and end instants. Choose a benchmark that represents the strategy mandate before inspecting results, then retain the same definition throughout the comparison. The checks below are a reproducible data preparation procedure, not a claim that Pineify performs benchmark alignment automatically.

  • Calculate each series over its actual intervals before joining valid pairs. If Tuesday is missing, a Monday-to-Wednesday return must not be paired with the other series's Tuesday-to-Wednesday return.
  • For a genuine market holiday, decide whether to carry the stale valuation or use less frequent common endpoints. State that policy and its effect; do not silently discard weekdays or crypto weekends.
  • For an unhedged local investment, R_base = (1 + R_local) × (1 + R_FX) - 1, where FX is base-currency units per local-currency unit. A local gain of 2% and an FX decline of 3% produce 1.02 × 0.97 - 1 = -1.06%.
InputRequired decisionFailure to avoid
Frequency and timestampsUse matching daily, weekly or monthly boundaries and document timezone and close.Comparing a US close with an earlier foreign close can move the same market event into different observations.
Missing datesKeep missing observations explicit; repair the source or aggregate both series to common, valid endpoints.Filling a missing price with the previous value creates an artificial zero return followed by a catch-up move.
CurrencyConvert both total-return series into the same reporting currency, or use a stated hedged benchmark.A USD strategy against an unconverted EUR index mixes currency exposure with portfolio selection.
Income and costsState dividends, interest, fees, slippage and financing; select the intended gross or net benchmark variant.A price-only benchmark omits distributions that a total-return account retains.
Account equityUse consistent marked-to-market account values, with deposits and withdrawals removed from performance.Individual trade returns omit idle capital and can overlap in time.

A six-month example you can recalculate

These hypothetical monthly returns use matching month-end valuations in one currency. Strategy returns include assumed trading costs, both series include income, and there are no external cash flows. This small dataset demonstrates the arithmetic; it is not a measured strategy result or a reliable estimate of future risk.

  • Mean active return = (0.70 - 0.30 + 1.20 - 0.80 + 0.70 - 0.30) / 6 = 0.20 percentage points per month.
  • Subtracting 0.20 gives deviations of 0.50, -0.50, 1.00, -1.00, 0.50 and -0.50 percentage points. Their squared sum is 3.00; sample variance is 3.00 / 5 = 0.60.
  • Monthly sample tracking error = sqrt(0.60) = 0.7746 percentage points. The conventional annualized estimate is 0.7746 × sqrt(12) = 2.6833 percentage points, usually displayed as 2.68%.
  • Dividing by n instead gives sqrt(3.00 / 6) = 0.7071 monthly and 2.4495 annualized. The discrepancy is a denominator choice, not a change in the underlying returns.
  • In a spreadsheet, place the six active returns in D2:D7 as numeric percentages. Use =STDEV.S(D2:D7) for monthly TE and =STDEV.S(D2:D7)*SQRT(12) for the annualized estimate.
MonthStrategyBenchmarkActive return
12.20%1.50%+0.70 percentage points
20.20%0.50%-0.30 percentage points
33.20%2.00%+1.20 percentage points
4-1.80%-1.00%-0.80 percentage points
51.20%0.50%+0.70 percentage points
60.20%0.50%-0.30 percentage points

Annualization needs a frequency and a dependence assumption

The common conversion is TE_annual = TE_period × sqrt(m), where m is the number of matching return periods per year. Monthly observations use 12; a daily exchange-session series often uses an explicitly stated 252-session convention. Calendar-day data need their own convention. Never annualize a monthly estimate by sqrt(252).

  • Square-root scaling follows when equal-frequency active returns have stable variance and zero serial covariance. For a sum of m stationary active returns, variance equals m × variance(a) + 2 × sum((m - k) × autocovariance at lag k), for k from 1 to m - 1.
  • Positive serial covariance raises the variance of that sum relative to simple square-root scaling; negative serial covariance lowers it. Stale prices, overlapping observations and persistent positions can make the zero-covariance assumption unsuitable.
  • The conventional annualized TE is a volatility scale. It is not the exact standard deviation of compounded annual strategy returns minus compounded annual benchmark returns.
  • Report a six-observation monthly estimate as six months of evidence. A longer window may stabilize the estimate but can also mix old allocations with the current strategy; show the window and any rule changes.

Separate realized risk from a holdings-based forecast

Ex-post tracking error uses observed strategy and benchmark returns. Ex-ante tracking error estimates the variability of future active returns from current exposures and a risk model. A linear holdings model uses sqrt(dᵀΣd): d contains portfolio weights minus benchmark weights, and Σ is the assumed asset-return covariance matrix for the stated horizon.

  • Hypothetical two-asset model: move 20 percentage points from asset B into A relative to the benchmark. Active weights are +0.20 and -0.20. With each asset at 20% annual volatility and correlation 0.50, TE = 0.20 × sqrt(0.20² + 0.20² - 2 × 0.50 × 0.20 × 0.20) = 4.00% annually.
  • Changing only the assumed correlation to 0.95 reduces that forecast to 1.2649%. This sensitivity is a model scenario, not evidence that correlation will remain high.
  • Concentration alone does not determine tracking error. A concentrated portfolio that exactly matches a concentrated benchmark can have zero active weights and zero modeled TE while retaining substantial absolute risk. A concentrated active position can instead add specific risk.
  • Holdings, derivatives, currency exposure and benchmark weights must use a compatible exposure model. A simple linear covariance calculation does not fully describe nonlinear option payoffs.
MeasureInputsWhat can invalidate the interpretation
Ex-postAligned historical returns and a declared windowFew observations, stale prices, changed strategy rules or a changed benchmark
Ex-anteCurrent active weights and modeled volatility, correlations and specific riskIncorrect exposures, unstable correlations, nonlinear positions or a mismatched forecast horizon

Counterexamples that stop a low number from becoming a verdict

A low tracking error establishes closeness of periodic return fluctuations to the chosen benchmark. It cannot establish profitability, small drawdowns or skill. The following examples are consequences of the formula, not empirical claims about a fund.

  • Constant lag: if the strategy trails its benchmark by exactly 0.10 percentage points every month, all active returns equal -0.10. Their standard deviation is zero although the strategy underperforms each month.
  • Shared loss: identical strategy and benchmark returns produce zero TE even if both lose 30% during the measurement window.
  • Tiny sample: active returns of +0.20 and +0.20 percentage points produce zero sample TE. Two matching observations cannot establish that future deviations will be zero; with only one observation, sample TE is undefined.
  • Benchmark mismatch: comparing a cash-heavy, market-neutral strategy with a fully invested equity index can produce high TE by design. Choose the comparison for its mandate, not because it makes the statistic look favorable.
  • Report average and cumulative active performance beside TE. Inspect absolute drawdown and exposure separately. Avoid computing an information ratio when the TE denominator is zero.

Use TradingView exports without inventing missing observations

Pineify Backtest Deep Report accepts TradingView trade CSV files and calculates supported trade-based return and risk metrics. A closed-trade ledger alone cannot supply the marked-to-market account value at every benchmark timestamp. It also does not provide the benchmark return history required by this calculation.

  • Import the trade CSV to check parsed entries, exits, costs and initial capital. Retain the strategy settings and evaluation dates with the report.
  • For tracking error, obtain a separate account-equity series and the selected benchmark history. Apply the alignment checks above, then calculate the active-return series in a spreadsheet or research script.
  • This workflow does not claim that Backtest Deep Report includes tracking error or an ex-ante covariance model. Its existing trade-based metrics answer different questions.
  • If you need a custom Pine statistic, give Pine Script AI Coding Agent the benchmark, return frequency, equity definition, missing-data policy and sample denominator. Review the generated source and compare each observation with an independent calculation before using the result.
Where Pineify fits

Backtest Deep Report

Import your TradingView trade CSV to inspect supported return and risk metrics. Keep the separate equity and benchmark series needed for tracking error with your research records.

Also useful: Pine Script AI Coding Agent. Describe a custom return statistic with explicit dates, benchmark and missing-data rules. Review the generated Pine Script and reconcile it with a manual calculation.

Explore Backtest Deep Report

Frequently asked questions

Educational information, not investment advice. Numerical examples are hypothetical and do not describe an actual strategy or fund. Historical and modeled tracking error do not guarantee future risk or performance.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.