Inflation-Adjusted Price IndicatorThis indicator allows traders to adjust historical prices for inflation using customizable CPI data. The script computes the adjusted price by selecting a reference date, the original price, and the CPI source (US CPI or custom input) and plots it as a line on the chart. Additionally, a table summarizes the adjusted price values and average and total inflation rates.
While the indicator serves as a standalone tool to understand inflation's impact on prices, it is a supportive element in more advanced trading strategies requiring accurate analysis of inflation-adjusted data.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
CPI
[Comparative CPI SGM]Code Explanation
User Inputs:
len: Defines the period over which CPI changes are calculated, with selectable options of 12, 6, and 3 months.
CP1 and CP2: These are the economic zones whose CPI data are being compared. The options include CPI from various regions like the EU, USA, UK, etc.
Calculating and Comparing Changes:
Calculates the annual change for each CPI and then computes the difference between these two changes.
Trading Utility
In trading, CPI variations are key indicators of inflation within different economic regions. Monetary policy decisions by central banks, heavily influenced by these data, significantly impact financial markets, especially in forex and bond markets.
Monetary Policy Forecasting:
If inflation in one region is significantly higher than in another, the central bank might raise interest rates, potentially strengthening that region's currency.
Currency Trading Strategy:
Traders might use this indicator to speculate on currency pair movements. For example, if US CPI is rising faster than the EU CPI, this might suggest a potential appreciation of the USD against the EUR.
Macroeconomic Analysis:
Understanding where inflation pressures are strongest can guide longer-term investment decisions, such as choosing between emerging and developed markets.
[BT] NedDavis Series: CPI Minus 5-Year Moving Average🟧 GENERAL
The script works on the Monthly Timeframe and has 2 main settings (explained in FEATURES ). It uses the US CPI data, reported by the Bureau of Labour Statistics.
🔹Functionality 1: The main idea is to plot the distance between the CPI line and the 5 year moving average of the CPI line. This technique in mathematics is called "deviation from the moving average". This technique is used to analyse how has CPI previously acted and can give clues at what it might do in the future. Economic historians use such analysis, together with specific period analysis to predict potential risks in the future (see an example of such analysis in HOW TO USE section. The mathematical technique is a simple subtraction between 2 points (CPI - 5yr SMA of CPI).
▶︎Interpretation for deviation from a moving average:
Positive Deviation: When the line is above its moving average, it indicates that the current value is higher than the average, suggesting potential strength or bullish sentiment.
Negative Deviation: Conversely, when the line falls below its moving average, it suggests weakness or bearish sentiment as the current value is lower than the average.
▶︎Applications:
Trend Identification: Deviations from moving averages can help identify trends, with sustained deviations indicating strong trends.
Reversal Signals: Significant deviations from moving averages may signal potential trend reversals, especially when combined with other technical indicators.
Volatility Measurement: Monitoring the magnitude of deviations can provide insights into market volatility and price movements.
Remember the indicator is applying this only for the US CPI - not the ticker you apply the indicator on!
🔹Functionality 2: It plots on a new pane below information about the Consumer Price Index. You can also find the information by plotting the ticker symbol USACPIALLMINMEI on TradingView, which is a Monthly economic data by the OECD for the CPI in the US. The only addition you would get from the indicator is the plot of the 5 year Simple Moving Average.
🔹What is the US Consumer Price Index?
Measures the change in the price of goods and services purchased by consumers;
Traders care about the CPI because consumer prices account for a majority of overall inflation. Inflation is important to currency valuation because rising prices lead the central bank to raise interest rates out of respect for their inflation containment mandate;
It is measured as the average price of various goods and services are sampled and then compared to the previous sampling.
Source: Bureau of Labor Statistics;
FEATURES OF INDICATOR
1) The US Consumer Price Index Minus the Five Year Moving Average of the same.
As shown on the picture above and explained in previous section. Here a more detailed view.
2) The actual US Consumer Price Index (Annual Rate of change) and the Five year average of the US Consumer Price Index. Explained above and shown below:
To activate 2) go into settings and toggle the check box.
HOW TO USE
It can be used for a fundamental analysis on the relationship between the stock market, the economy and the Feds decisions to hike or cut rates, whose main mandate is to control inflation over time.
I have created this indicator to show my analysis in this idea:
What does a First Fed Rate cut really mean?
CREDITS
I have seen such idea in the past posted by the institutional grade research of NedDavis and have recreated it for the TradingView platform, open-source for the community.
Temporal Value Tracker: Inception-to-Present Inflation Lens!What we're looking at here is a chart that does more than just display the price of gold. It offers us a time-traveling perspective on value. The blue line, that's our nominal price—it's the straightforward market price of gold over time. But it's the red line that takes us on a deeper journey. This line adjusts the nominal price for inflation, showing us the real purchasing power of gold.
Now, when we talk about 'real value,' we're not just philosophizing. We're anchoring our prices to a point in time when the journey began—let's say when gold trading started on the markets, or any inception point we choose. By 'shadowing' certain years—say, from the 1970s when the gold standard was abandoned—we can adjust this chart to reflect what the inflation-adjusted price means since that key moment in history.
By doing so, we're effectively isolating our view to start from that pivotal year, giving us insight into how gold, or indeed any asset, has held up against the backdrop of economic changes, policy shifts, and the inevitable rise in the cost of living. If you're analyzing a stock index like the S&P 500, you might begin your inflation-adjusted view from the index's inception date, which allows you to measure the true growth of the market basket from the moment it started.
This adjustment isn't just academic. It influences how we perceive value and growth. Consider a period where the nominal price skyrockets. We might toast to our brilliance in investment! But if the inflation-adjusted line lags, what we're seeing is nominal growth without real gains. On the other hand, if our red line outpaces the blue even during stagnant market periods, we're witnessing real growth—our asset is outperforming the eroding effects of inflation.
Every asset class can be evaluated this way. Stocks, bonds, real estate—they all have their historical narratives, and inflation adjustment tells us if these stories are tales of genuine growth or illusions masked by inflation.
So, as informed traders and investors, we need to keep our eyes on this inflation-adjusted line. It's our measure against the silent thief that is inflation. It ensures we're not just keeping up with the Joneses of the market, but actually outpacing them, building real wealth over time
1995-Present - Inflation and Purchasing PowerGood day, everyone! Today, we're going to look at a chart that's a bit different from the usual price charts we analyse. This isn't just any chart; it's a lens into the past, adjusted for the reality of inflation—a concept we often hear about but seldom see directly applied to our trading charts.
What we have here is an 'Inflation Adjusted Price' indicator on TradingView, and it's doing something quite special. It's showing us the price of our asset, let's say the S&P 500, not just in today's dollars, but in the dollars of 1995. Why 1995, you ask? Well, it's the starting point we've chosen to measure how much actual buying power has changed since then.
So, every point on this red line we see represents what the S&P 500's value would be if we stripped away the effects of inflation. This is the price in terms of what your money could actually buy you back in 1995.
As traders and investors, we're always looking at prices going up and thinking, 'Great! My investment is growing!' But the real question we should ask is, 'Is my money growing in real terms? Can it buy me more than it did last year, or five, ten, or twenty-five years ago?'
This chart tells us exactly that. If the red line is above the actual price, it means that the S&P 500 has not just grown in nominal terms, but it has actually outpaced inflation. Your investment has grown in real terms; it can buy you more now than it could back in 1995.
On the flip side, if the red line is below the actual price, that's a sign that while the nominal price might be up, the real value, the purchasing power, hasn't grown as much or could even have fallen.
This view is crucial, especially for the long-term investors among us. It gives us a reality check on our investments and savings. Are we truly growing our wealth, or are we just keeping up with the cost of living? This indicator answers that.
Remember, the true measure of financial growth is not just the numbers on a chart. It's what you can do with those numbers—how much bread, or eggs, or yes, even houses, you can buy with your hard-earned money
BTC Purchasing Power 2009-20XX! Hello, today I'm going to show you something that shifts our perspective on Bitcoin's value, not just in nominal terms, but adjusted for the real buying power over the years. This Pine Script TAS developed for TradingView does exactly that by taking into account inflation rates from 2009 to the present.
As you know, inflation erodes the purchasing power of money. That $100 in 2009 does not buy you the same amount in goods or services today. The same concept applies to Bitcoin. While we often look at its price in terms of dollars, pounds, or euros, it's crucial to understand what that price really means in terms of purchasing power.
What this script does is adjust the price of Bitcoin for cumulative inflation since 2009, allowing us to see not just how the nominal price has changed, but how its value as a means of purchasing goods and services has evolved.
For example, if we see Bitcoin's price at $60,000 today, that number might seem high compared to its early years. However, when we adjust this price for inflation, we might find that in terms of 2009's purchasing power, the effective price might be somewhat lower. This adjusted price gives us a more accurate reflection of Bitcoin's true value over time.
This script plots two lines on the chart:
The Original BTC Price: This is the unadjusted price of Bitcoin as we typically see it.
BTC Purchasing Power: This line shows Bitcoin's price adjusted for inflation, reflecting how many goods or services Bitcoin could buy at that point in time compared to 2009.
By comparing these lines, we can observe periods where Bitcoin's purchasing power significantly increased, even if the nominal price was not at its peak. This can help us identify moments when Bitcoin was undervalued or overvalued in real terms.
This analysis is crucial for long-term investors and traders who want to understand Bitcoin's value beyond the surface-level price movements. It helps us appreciate Bitcoin's potential as a store of value, especially in contexts where traditional currencies are losing purchasing power due to inflation.
Remember, investing is not just about riding price waves; it's about understanding the underlying value. And that's precisely what this script helps us to uncover
Inflation IndicatorThis script provides a great view of Year-over-Year (YoY) inflation rates for key countries.
The inflation data used per default are TradingView Tickers, but you can change them to anything you want from the settings.
There is no calculation in this script, all it does is providing a overview of inflation rates in a single indicator.
Inflation data for the USA, European Union, Australia, Canada, Switzerland, Japan, United Kingdom, and New Zealand (Inflation Symbols editable in the settings)
Customizable static line to indicate a specific threshold value (default: 2.0).
Table displaying country flags, names, and the latest inflation rates.
Country-representative colors for easy identification.
Offset ProjectIntended for use with CPI symbols like:
CPIAUCNS (all items)
CPILFENS (core)
Shows the CPI values from a year ago, next to the current values. This makes it easier to visualize the base effects .
Has a ' max inflation rate ' parameter. This is shown as a red line. So for example, if it's set to 3, then CPI must stay below the red line in in order for the inflation rate to stay below 3.
Odd_mod Econ CalendarA modification of Economic Calendar Events: FOMC, CPI, and more written by jdehorty . Please send all tips his way as he is maintaining the underlying data for the Calendar and the original concept.
List of changes:
Optimized code, will only run once on initialization now(No random line in middle of screen on bar change)
Legend - Added short names
Legend - Removed header
Legend - Made repositionable with selectable top margins
Legend - Removed data name from legend when it is disabled
Legend - Removed border
Original Description by jdehorty :
This script plots major events from the Economic Calendar that often correspond to major pivot points in various markets. It also includes built-in logic to retroactively adjust larger time intervals (i.e. greater than 1 hour) to be correctly aligned with the interval during which the event occurred.
Events are taken from the Economic Calendar and will be updated periodically at the following library:
EconomicCalendar
The above library can be used to conveniently access date-related data for major Meetings, Releases, and Announcements as integer arrays, which can be used in other indicators. Currently, it has support for the following events:
FOMC Meetings
The FOMC meets eight times a year to determine the course of monetary policy . The FOMC's decisions are based on a review of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
FOMC Minutes
The FOMC minutes are released three weeks after each FOMC meeting. The minutes provide a detailed account of the FOMC's discussion of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
Producer Price Index (PPI) Releases
The Producer Price Index (PPI) measures changes in the price level of goods and services sold by domestic producers. The PPI is a weighted average of prices of a basket of goods and services, such as transportation, food, and medical care. PPI is a leading indicator of CPI .
Consumer Price Index ( CPI ) Releases
The Consumer Price Index ( CPI ) measures changes in the price level of goods and services purchased by households. The CPI is a weighted average of prices of a basket of consumer goods and services, such as transportation, food, and medical care. CPI is one of the most widely used measures of inflation .
Consumer Sentiment Index ( CSI ) Releases
The University of Michigan's Consumer Sentiment Index ( CSI ) is a measure of consumer attitudes about the economy. The CSI is based on a monthly survey of U.S. households and reflects the consumers' assessment of present and future economic conditions. The CSI is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Consumer Confidence Index ( CCI ) Releases
The Consumer Confidence Index is a survey that measures how optimistic or pessimistic consumers are regarding their expected financial situation.
Non-Farm Payroll (NFP) Releases
The Non-Farm Payroll (NFP) is a measure of the change in the number of employed persons, excluding farm workers and government employees. The NFP is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Economic Calendar (Import from Spreadsheet)This script draws vertical lines to mark Economic Calendar Events.
Datetime of events is defined by user in Settings via a standardized line of text.
Motivation for coding this script:
All traders should be aware of economic calendar events. At times, when you really need to pay attention to an upcoming major event, you might even decide to use the vertical-line drawing tool to mark it. However, this takes manual effort.
This script provides a solution to performing mundane tasks such as drawing vertical lines and dragging them ever so slightly, just to have them approximately aligned with exact time.
Parameters:
(1) Source data - String representation of collection of datetime referencing to Economic Calendar Events
(2) Line color, & (3) Width of line - For displaying vertical lines drawn by script.
Standardized format for Source Data :
Example:
If 'GMT;2022,6,1,14,0,0;2022,6,2,12,15,0;' is provided to PineScript, then two vertical lines will be drawn on June 6, 2022 according to the exact time in 'YYYY,MM,DD,hh,mm,ss' format at the specified timezone (GMT in this case).
Template for Source Data :
Included here, link below, is a shared Google Sheet that systematically processes Economic Calendar data provided in the 'Raw Data' tab.
drive.google.com
Users are advised to use their preferred methods* to format the string (for source data param.), and apply their own criteria to sort down the Events. (ie. only include Events of High Impact, etc.)
* Preferred methods (as mentioned above) does not mean being limited to using the template as provided in this post.
Economic Calendar Events: FOMC, CPI, and moreThis script plots major events from the Economic Calendar that often correspond to major pivot points in various markets. It also includes built-in logic to retroactively adjust larger time intervals (i.e. greater than 1 hour) to be correctly aligned with the interval during which the event occurred.
Events are taken from the Economic Calendar and will be updated periodically at the following library:
The above library can be used to conveniently access date-related data for major Meetings, Releases, and Announcements as integer arrays, which can be used in other indicators. Currently, it has support for the following events:
FOMC Meetings
The FOMC meets eight times a year to determine the course of monetary policy. The FOMC's decisions are based on a review of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
FOMC Minutes
The FOMC minutes are released three weeks after each FOMC meeting. The minutes provide a detailed account of the FOMC's discussion of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
Producer Price Index (PPI) Releases
The Producer Price Index (PPI) measures changes in the price level of goods and services sold by domestic producers. The PPI is a weighted average of prices of a basket of goods and services, such as transportation, food, and medical care. PPI is a leading indicator of CPI.
Consumer Price Index (CPI) Releases
The Consumer Price Index (CPI) measures changes in the price level of goods and services purchased by households. The CPI is a weighted average of prices of a basket of consumer goods and services, such as transportation, food, and medical care. CPI is one of the most widely used measures of inflation.
Consumer Sentiment Index (CSI) Releases
The University of Michigan's Consumer Sentiment Index (CSI) is a measure of consumer attitudes about the economy. The CSI is based on a monthly survey of U.S. households and reflects the consumers' assessment of present and future economic conditions. The CSI is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Consumer Confidence Index (CCI) Releases
The Consumer Confidence Index is a survey that measures how optimistic or pessimistic consumers are regarding their expected financial situation.
Non-Farm Payroll (NFP) Releases
The Non-Farm Payroll (NFP) is a measure of the change in the number of employed persons, excluding farm workers and government employees. The NFP is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Annualizer: New Indicator + CPI AnalysisThis indicator calculates the annualized month-over-month percent change of a cumulative index and plots it alongside the year-over-year percent change for comparison. It was developed for the purpose of analyzing the inflation rate of CPI indexes such as “CPIAUCSL.” It can also be used on M2 money supply and pretty much any cumulative index. It will not produce useful outputs on percent change indexes such as “USCCPI” because it performs percent change calculations which are already applied to those indexes.
This indicator takes data from the monthly chart, regardless of how often the data is reported or what the timeframe of the current chart is. Doing so allows it to work on all timeframes while displaying only monthly data outputs but limits it from recognizing data which might be released more often than once per month. This limitation should be suitable for macroeconomic data such as CPI and M2 money supply which are usually analyzed on a month-to-month basis.
If the ticker symbol is "M2SL" which is M2 money supply, annualized percent change is plotted in green, otherwise, it’s plotted in blue.
CPI analysis:
Upon deploying this indicator, it was observed that the year-over-year (YoY) inflation rate (red) is a lagging indicator of the annualized month-over-month (MoM) inflation rate (blue) and that it appears to almost be a moving average of it. A moving average plot was temporarily added for comparison to the YoY and it was found that the difference between the two plots is negligible and that for the purposes of high-level analysis of inflation, the two plots can be considered to be no different from one another. Below is a screenshot for demonstration. Notice how closely the white 12-month SMA of the annualized rate tracks the YoY rate.
For other indexes which may see more dramatic changes month-over-month such as M2 money supply, the difference between the two signals becomes more pronounced but they are still comparable. The conclusion is that the YoY inflation rate can be considered to be a 12-month simple moving average of the annualized MoM rate.
12-month SMA:
It’s easy to see and stands to reason that if the annualized MoM inflation rate (blue) remains where it has been for the previous 2 months YoY inflation (red) will begin falling and eventually reach similar levels due to its moving-average-like behavior. This will bring us back to the 2% YoY inflation target of the Fed within no more than 10 months. There may be a perception that deflation is required to bring prices back down to the purple channel of CPI to make prices pre-Covid "normal" again. We were headed in that direction in July with a slightly negative MoM CPI read. What may have freaked investors out about the August report (most recent as of this writing) is that the inflation rate, rather than continuing into negative deflationary territory, has bounced back into positive territory.
M2 money supply isn’t an integral part of this analysis, but it helps demonstrate the indicator. It can be observed that CPI growth lags M2 money supply growth which seems to have leveled off.
I’m not a macroeconomist so I’m probably missing some things, but I do not see a lagging indicator such as YoY inflation being at 8.25% while annualized MoM inflation is at 1.42% as something to freak out about as investors have seemingly done. I’m a stock market bear as of last week, but I do not feel this CPI analysis strongly supports a bearish thesis, nor is it bullish. Next month’s annualized MoM % change may begin to sway me one way or the other depending on what this chart looks like when it’s updated.
Quantity Theory of Money (Inflation Growth Rate)Quantity Theory of Money ( Inflation Growth Rate)
Equation:
%ΔM+%ΔV=%ΔP+%ΔY
M - Money Supply , V - Money Velocity , Y - Real GDP, P - Price
This script only takes into account money supply theory and does not account for increases/decreases in inflation due to energy costs. QTM Calculation is compared to USIRYY , USCCPI , and Sticky Price CPI . Flex_CPI and Flex_Core_CPI are not available in Trading View for comparison.
Simple Moving Average Default it set to 3 quarters for smoothing purposes. You can change this via the input window as you see fit.
Taylor RuleThe Taylor rule is a simple formula that John Taylor devised to guide policymakers. It calculates what the federal funds rate should be, as a function of the output gap and current inflation. Here, we measure the output gap as the difference between potential output and real GDP. Inflation is measured by changes in the CPI, and we use a target inflation rate of 2%. We also assume a steady-state real interest rate of 2%.
Total Inflation ModelMeasure of the total economy wide inflation of the US Dollar.
Total Inflation = growth rate of money supply / economic output
Real Interest Rate DifferentialThe Real IRD is a simple indicator built for forex trades that need a long-term view and want to compare currencies in search of high yield. The indicated interest rate maturity is 2 years, since shorter maturities may not price central banks' monetary policy decisions.
Example:
- You need to do an analysis of the AUDUSD
- In the Interest Rate 1 field, we put the interest rate for the base currency, in this case the AUD
- In the Interest Rate 2 field, the interest rate of the other currency, in this case the USD
- In the CPI 1 field, inflation referring to base currency
- In the CPI 2 field, inflation for another currency
CPI Codes:
QUANDL:RATEINF/INFLATION_USA < USD
QUANDL:RATEINF/INFLATION_EUR < EUR
QUANDL:RATEINF/INFLATION_JPN < JPY
QUANDL:RATEINF/INFLATION_CHE < CHF
QUANDL:RATEINF/INFLATION_GBR < GBP
QUANDL:RATEINF/INFLATION_CAN < CAD
QUANDL:RATEINF/INFLATION_RUS < RUB
QUANDL:RATEINF/INFLATION_AUS < AUD
QUANDL:RATEINF/INFLATION_NZL < NZD
US Inflation Rate [nb]This is the United States inflation rate, based on the total Consumer Price Index published by the U.S. Bureau of Labor Statistics.
Option to toggle:
A line to display the inflation rate in December. It does not change until the next December.
What the color change to red is indicative of:
According to the Federal Open Market Committee (FOMC) regarding inflation rate, "2% is a bae number to be around". This does not imply a strict 2% inflation for success and allows room for federal rate cuts should they be needed.
Although FOMC declared 2% to be "bae" in 2012, James Bullard, of federal banking fame, claims that started to become the norm in 1995. Therefore the inflation rate line will only turn red 1995 onwards, and serves as a friendly reminder that inflation has been over at or over 2% for more than one month.
Sources:
www.bls.gov
www.federalreserve.gov
www.stlouisfed.org
CPI-weighted USD/RUB exchange rate calculationProjected target for USDRUB calculated by inflation rates (consumer price indexes) is 110.