OPEN-SOURCE SCRIPT
Cumulative % Change & Inflation-Adjusted (Auto CPI by Currency)

This indicator tracks an asset’s cumulative performance from a user-defined start date (T0) and compares nominal returns with inflation-adjusted (“real”) returns, automatically selecting the appropriate CPI series based on the asset currency (USD or EUR).
What it shows
Nominal cumulative return (%) from T0, based on the selected price series.
Inflation change (%) from T0, using a monthly CPI index:
USD assets: US CPI (FRED CPIAUCSL)
EUR assets: Euro Area CPI (TradingView Economics EUCPI)
Real cumulative return (%) from T0, i.e., nominal return deflated by cumulative CPI.
Key inputs
T0 (start date): Year / month / day used as the reference point.
Asset currency (USD/EUR): Drives automatic CPI selection.
Initial capital: Starting value expressed in the asset’s currency; used to display current nominal and real (inflation-adjusted) portfolio value.
Performance ticker (optional): Lets you compute performance using a different symbol than the chart (e.g., a total-return series or an accumulating ETF). If left empty, the script uses the chart’s symbol.
Outputs
Plots
Nominal cumulative % change
Real (inflation-adjusted) cumulative % change
CPI % change
Summary table
Nominal return %
Real return %
CPI change %
Reference date (T0)
Initial value
Current nominal value
Current inflation-adjusted value
Performance ticker used
Notes
CPI is monthly, so the inflation line updates in steps.
If you use a price series that does not include dividends (standard “close”), nominal/real returns may underestimate total return for dividend-paying assets.
What it shows
Nominal cumulative return (%) from T0, based on the selected price series.
Inflation change (%) from T0, using a monthly CPI index:
USD assets: US CPI (FRED CPIAUCSL)
EUR assets: Euro Area CPI (TradingView Economics EUCPI)
Real cumulative return (%) from T0, i.e., nominal return deflated by cumulative CPI.
Key inputs
T0 (start date): Year / month / day used as the reference point.
Asset currency (USD/EUR): Drives automatic CPI selection.
Initial capital: Starting value expressed in the asset’s currency; used to display current nominal and real (inflation-adjusted) portfolio value.
Performance ticker (optional): Lets you compute performance using a different symbol than the chart (e.g., a total-return series or an accumulating ETF). If left empty, the script uses the chart’s symbol.
Outputs
Plots
Nominal cumulative % change
Real (inflation-adjusted) cumulative % change
CPI % change
Summary table
Nominal return %
Real return %
CPI change %
Reference date (T0)
Initial value
Current nominal value
Current inflation-adjusted value
Performance ticker used
Notes
CPI is monthly, so the inflation line updates in steps.
If you use a price series that does not include dividends (standard “close”), nominal/real returns may underestimate total return for dividend-paying assets.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.