Yield Curve InversionThe Yield Curve Inversion indicator is a tool designed to help traders and analysts visualize and interpret the dynamics between the US 10-year and 2-year Treasury yields. This indicator is particularly useful for identifying yield curve inversions, often seen as a precursor to economic recessions.
Features and Interpretations
Display Modes: Choose between "Spread Mode" to visualize the yield spread indicating normal (green) or inverted (red) curves, or "Both Yields Mode" to view both yields.
Yield Spread: A plotted difference between 10-year and 2-year yields, with a zero line marking inversion. A negative spread suggests potential economic downturns.
Color Coding: Green for a normal yield curve (10Y > 2Y) and red for an inverted curve (2Y > 10Y).
Legend: Provides quick reference to yield curve states for easier interpretation.
This indicator is for educational and informational purposes only. It should not be considered financial advice or a recommendation to buy or sell any financial instruments. Users should conduct their own research and consult with a financial advisor before making investment decisions. The creator of this indicator is not responsible for any financial losses incurred through its use.
Yieldcurve
Yield Curve SpaghettiDisplays the difference in yield between multiple bond pairs for a given country.
Currently supports US, DE, and GB bonds
Treasury Yields Heatmap [By MUQWISHI]▋ INTRODUCTION :
The “Treasury Yields Heatmap” generates a dynamic heat map table, showing treasury yield bond values corresponding with dates. In the last column, it presents the status of the yield curve, discerning whether it’s in a normal, flat, or inverted configuration, which determined by using Pearson's linear regression coefficient. This tool is built to offer traders essential insights for effectively tracking bond values and monitoring yield curve status, featuring the flexibility to input a starting period, timeframe, and select from a range of major countries' bond data.
_______________________
▋ OVERVIEW:
______________________
▋ YIELD CURVE:
It is determined through Pearson's linear regression coefficient and considered…
R ≥ 0.7 → Normal
0.7 > R ≥ 0.35 → Slight Normal
0.35 > R > -0.35 → Flat
-0.35 ≥ R > -0.7 → Slight Inverted
-0.7 ≥ R → Inverted
_______________________
▋ INDICATOR SETTINGS:
#Section One: Table Setting
#Section Two: Technical Setting
(1) Country: Select country’s treasury yields data
(2) Timeframe: Time interval.
(3) Fetch By:
(3A) Date: Retrieve data by beginning of date.
(3B) Period: Retrieve data by specifying the number of time series back.
Enjoy. Please let me know if you have any questions.
Thank you.
[dharmatech] U.S. Treasury Yield CurveThis indicator displays the U.S. Treasury Securities Yield Curve.
This is a fork of the US Treasury Yield Curve indicator by @longflat. Thank you for sharing your work!
There are already so many yield curve indicators on TradingView.
What makes this one different?
Update to version 5 of Pine Script
Add RRP%
Add 4 month
Add 20 year
Show previous day's yield curve
Options for prior yield curves
The thick red line shows the latest yield curve.
The yellow line shows the yield curve 1 bar ago.
So, if your timeframe is set to 1 day, the yellow line will show yesterday's yield curve.
[dharmatech] Area Under Yield Curve : USThis indicator displays the area under the U.S. Treasury Securities yield curve.
If you compare this to SP:SPX , you'll see that there are large periods where they are inversely related. Other times, they track together. When the move together, watch out for the expected and eventual divergence.
By default, this indicator will show up in a separate pane. If you move it to an existing pane (e.g. along side SP:SPX ) you'll need to move it to a different price scale.
The area under the yield curve is a quick way to see if the overall yield curve moved up or down. Generally speaking, increasing yields isn't good for markets, unless there is some other stimulus going on simultaneously.
The following treasury securities are used in this calculation:
FRED:DGS1MO (1 month)
FRED:DGS3MO (3 month)
FRED:DGS6MO (6 month)
FRED:DGS1 (1 year)
FRED:DGS2 (2 year)
FRED:DGS3 (3 year)
FRED:DGS5 (5 year)
FRED:DGS7 (7 year)
FRED:DGS10 (10 year)
FRED:DGS20 (20 year)
FRED:DGS30 (30 year)
US Recession IndicatorThe US Recession Indicator is designed to identify recessions as they happen, using two reputable indicators that have accurately foreseen all past recessions since 1969. Unlike the National Bureau of Economic Research (NBER) which determines recession dates after the fact, this indicator seeks to spot recessions in real-time. When both of these distinct metrics meet certain criteria, the chart's background becomes shaded, signifying a strong likelihood that the economy is in a recession. Furthermore, a built-in alert system keeps users updated without constant monitoring.
The first metric is the Smoothed Recession Probabilities developed by Marcelle Chauvet. It is based on a dynamic-factor markov-switching model that assesses four monthly coincident variables: non-farm payroll employment, the index of industrial production, real personal income excluding transfer payments and real manufacturing and trade sales. It offers a mathematical analysis of how recessions deviate from expansions. In essence, this index mirrors the probability of the prevailing true economic situation being a recession, grounded on the current GDP data.
The second metric is the Sahm Rule Recession Indicator developed by Claudia Sahm. It operates on the principle that changes in the unemployment rate can be used to identify the onset of a recession. According to this rule, if the three-month moving average of the unemployment rate rises by 0.5 percentage points or more above its lowest point from the preceding year, it flags a potential recession.
For this combined indicator, the thresholds are intentionally set lower than when each metric is used individually. Both metrics must simultaneously suggest a potential recession in order to send a signal. This stems from the realisation that neither metric is infallible and has, on occasion, sent false signals in the past. By requiring both to align, the likelihood of a false positive is reduced. However, it's crucial to understand that past performance does not guarantee future results, leaving the door open for potential false alerts which may not be confirmed by the NBER.
US Treasuries Yield CurveNews about the yield curve became pretty crucial for all the trades in the last year.
So in the team, we decided to implement a nice widget that will allow you to track the current yield curve in your chart directly.
It's possible to compare the current yield curve with past yield curves. You can choose to display the number of curves weeks, months, and years ago. So you can see the dynamics of the yield curve change.
When the Y2 > Y10 curve is considered invested, so you'll see an "Inverted" notification on the chart.
Thanks to @MUQWISHI for helping code it.
Disclaimer
Please remember that past performance may not indicate 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.
Recession Warning Traffic LightThis is an indicator that uses 6 different metrics to determine the combined probability of a recession and compares the high probability warning periods against actual historical periods of recession.
GREEN tells us that the referenced recession indicators are not exhibiting any warning. Observe the long stretches of “all-green” in between recessionary periods in the chart above.
RED will show a full-on warning level for that particular recession indicator, signaling that monitoring of this sector is clearly showing a problem – which has in the past, reliably exhibited itself as a forewarning of recessions.
Adding green and red together can help determine a combined probability of recession.
IMPORTANT: Your chart should be on 1d and set to SPX , DJI ,or NDQ indices
Precious metals: This indicator calculates the relative prices of Gold & rhodium. Gold is a flight-to-quality asset. Rhodium is the rarest of precious industrial metals and prices spike when the economy is heating up. In front of a recession, the upper relative movement of rhodium precedes gold.
Stock markets: This indicator compares closing prices to growth rate curves of the SPX. This indication is the noisiest but tells us very well when the recession has ended. Stock market indices, which respond to “smart money” moving out of markets when the other indicators begin to warn of recession, or when markets become overheated and rise to historically unsustainable levels.
Yield curve: This indicator compares the 3m & 10y treasuries and detects yield curve inversions. Interest rates are controlled by the Federal Reserve and by the purchasers in the Federal Treasury auction markets, which together create the treasury yield curve. This inversion is the most reliable recession indicator. These happen during a flight to quality.
Federal Reserve: This indicator measures GDP and detects contraction which is technically a recession. This is usually one of the last indicators to enter a Warning state, and it could be 6 months delayed simply confirming what may have already been projected.
Money Supply. This indicator measures the M2 money supply, which typically grows about 1% per calendar quarter. When this shrinks, it's tapping the brakes on the economy. This can also lead to yield curve inversion. This is also a measure of inflation and its effects on the aggregate money supply (liquid capital) available for short-term economic activity, or which can be directed into the purchase of long-term, less liquid assets.
Leading Economic factors: There is a whole basket of leading economic indicators that, as collections, reflect overall growth or contraction of economic activity. These indicators include measures of level and growth in productivity, employment, housing, consumer confidence, industrial purchasing confidence, and much more. These indicators may or may not be detached from the broader economy, and often provide up to 6 months of foresight. For more information please visit www.conference-board.org
Actual Recession: Central Bank indicators are published by the Federal Reserve and reflect their own analysis of national and regional economic health, as well as their calculations of the likelihood of a recession. The Federal Reserve has a recession ticker which is used to plot periods of actual recessions on this indicator for comparison.
USTS Yield Curve InversionsVisualization of the inverted portions of the USTS yield curve.
Red means that portion of the curve is inverted.
If 1M is red, it means it's less than RRP%.
GB Gilt Yield CurveWith thanks to @longfiat whose US Treasury Yield Curve served as the basis for this indicator
This is created very quickly to provide a sense of the GB Gilt Yield curve in light of government induced market dysfunction as a result of an ill-conceived mini-budget.
Note that I omitted GB04Y, GB06Y, GB08Y, GB09Y and GB12Y to avoid overcrowding the chart with excess information and thereby render the indicator more readily usable.
US/CA Bond Yield CurveEasy Viewing of 4 different duration bond yields for US and Canada. Bond prices and bond yields are excellent indicators of the economy as a whole, and of inflation in particular. A bond's yield is the discount rate that can be used to make the present value of all of the bond's cash flows equal to its price. Good as part of a macro set.
Treasury Yield Spread 10y-2y [TXMC]A simple indicator to show inversions of the US Treasury yield curve, specifically between the 2yr and 10yr yields.
A colored band prints when the 2yr treasury yield surpasses the 10yr, indicating an inversion of the yield curve.
This indicator is for educational purposes only.
US Treasury Constant Maturity SpreadsPlots and tabulates constant maturity treasury yield spreads
// colours per curve type for the plots and table headers
C_30Y_20Y=color.orange
C_10Y_5Y=color.purple
C_10Y_2Y=color.blue
C_7Y_5Y=color.gray
C_5Y_2Y=color.red
C_3Y_2Y=color.yellow
C_10Y_1Y=color.olive
US Treasury All Yield Curve IORB WeightedI've updated my US Treasury All Yield Curve indicator to use the new FRED:IORB (interest on reserve balances), instead of the FRED:FEDFUNDS which is only updated monthly.
The new IORB doesn't provide very long lookback for data, so I'm publishing this as a new version and not an update, making it possible for users to choose which version best suits their needs.
Bond Yeild CurveBond Yeild Curve
A bond yeild curve is a line that plot the interest rate of bonds of each maturity dates.
The slope of the curve give the future of economy cycle.
if the slope could be normal (positive), flat or even inverted.
This indicator aquired data of bond yeild provided by TradingView.
How to use it.
Select the country of the bond / another country to compare.
Select the maturity of bond (this indicator set 2Y, 5Y, 10Y and 20Y as default).
You can toggle to 3 different data set; Yeild, Spread (10Y-2Y) and Yeild Curve.
In case that you select the "Yeild Curve", you can customize the desired past period to compare.
How we can get the benefit.
- If the current spread is greater than 1.0, it suppose that the economy of that country probably is ok.
- if the current spread is between 0 - 1.0, it suppose to be flatted and probably turn to invert and the economy cound be in a recession soon.
- if the current spread is below 0, it suppose to be inverted and economy is in recession.
when knowing the state of economy, it would help us to manage our investment.
When you select "Yeild"
When you select "Spread"
When you select "Yeild Curve"
I'm new for this.
if any idea, correction and suggestion, i do appreciate it.
US Treasury All Yield CurveRather than using one pair of treasuries, this indicator weighs them all in an overlapping fashion, to produce a composite yield curve that indicates the level of stress in the bond market.
Yield Curve Inversion IndicatorIntroduction
The last time (as of this publishing) that this indicator detected an inverted interest rate yield curve was on February 20th, 2020 at 12:30pm EST, the afternoon before the S&P500 began one of its largest crashes in US history. The vast majority of major economic recessions since the 1950's have been preceded by an interest rate yield curve inversion. I created this indicator originally as an input to study the impacts of more conservative risk management on quantitative trading strategies following a yield curve inversion event. It is being shared with the community as a quick indicator to check to see the comparative status of short term and long term interest rates, and as an indicator where you can easily check to see if we are experiencing an inverted yield curve in real-time.
Background of the significance of an inverted yield curve:
"What an inverted yield curve really means is that most investors believe that short-term interest rates are going to fall sharply at some point in the future. As a practical matter, recessions usually cause interest rates to fall. Historically, inversions of the yield curve have preceded recessions in the U.S. Due to this historical correlation, the yield curve is often seen as a way to predict the turning points of the business cycle. When the yield curve inverts, short-term interest rates become higher than long-term rates. This type of yield curve is the rarest of the three main curve types and is considered to be a predictor of economic recession. Because of the rarity of yield curve inversions, they typically draw attention from all parts of the financial world." (www.investopedia.com)
Settings and Usage
This indicator pulls in pricing data from tickers that represent short term and long term interest rates, and compares them. The red line represents short term interest rates, and the green line represents long term interest rates. When the red line is above the green line, it indicates that we are experiencing a yield curve inversion. Small blue crosses also appear on the bottom of the indicator during an inversion to further highlight the event visually. This indicator pulls in the same information on the same two interest rate tickers regardless of what chart it is applied to.
Other Thoughts
This script uses the f_secureSecurity function as a best practice. For those that are versed in PineScript, code from this indicator could be adapted to be applied to an interest rate chart that allows custom alerts to be created the moment that there is an inverted interest rate yield curve.
US Treasury All Yield Curve FEDFUNDS WeightedRather than picking a benchmark pair of treasuries to express a yield curve, this indicator weighs all (excluding the new 20 Year) durations, each against the next, and weights that against the FEDFUNDS rate.
Yield CurveThis script tracks the U.S. 2Yr/10Yr Spread and uses inversions of the curve to predict recessions. Whenever a red arrow appear on the yield curve, expect a recession to begin within the next 2 years. Use this signal to either exit the market, or hedge current positions. Whenever a green arrow appears on the yield curve, expect a recession to have nearly ended. Use this signal to enter the market, or cut current hedges against a recession. (I may update this script in the future to better incorporate the effective federal funds rate into exit points, but for now I am satisfied with the results).
Turkey Yield Curve SpreadYield spreads are used to see investors' perception of future risk and predict a recession. The spread is the value obtained by subtracting the near term bond from the distant one. This indicator plots this value historically. I used 3-year and 10-year Turkey treasury bond yields instead of 2-year and 10-year Turkey treasury bond yields due to lack of historical data on Tradingview.
Recession IndicatorThis script attempts to predict recessions four quarters ahead.
According to the New York Fed, "The yield curve—specifically, the spread between the interest rates on the ten-year Treasury
note and the three-month Treasury bill—is a valuable forecasting tool. It is simple to use
and significantly outperforms other financial and macroeconomic indicators in predicting
recessions two to six quarters ahead."
The paper offers Estimated Recession Probabilities Using the Yield Curve Spread:
Four Quarters Ahead
Recession Probability Value of Spread
(Percent) (Percentage Points)
5 1.21
10 0.76
15 0.46
20 0.22
25 0.02
30 -0.17
40 -0.50
50 -0.82
60 -1.13
70 -1.46
80 -1.85
90 -2.40
"Note: The yield curve spread is defined as the spread between the
interest rates on the ten-year Treasury note and the three-month
Treasury bill."
You can choose at which Recession Probability (percent) you want to display the signal (default value is 25%), as well as choose if you want to only display the signal at inversion (default) or at all times when the yield curve is inverted.
To use, just select your current timeframe from the menu.
Includes an option for repainting -- default value is true, meaning the script will repaint the current bar.
False = Not Repainting = Value for the current bar is not repainted, but all past values are offset by 1 bar.
True = Repainting = Value for the current bar is repainted, but all past values are correct and not offset by 1 bar.
In both cases, all of the historical values are correct, it is just a matter of whether you prefer the current bar to be realistically painted and the historical bars offset by 1, or the current bar to be repainted and the historical data to match their respective price bars.
As explained by TradingView,`f_security()` is for coders who want to offer their users a repainting/no-repainting version of the HTF data.
Stability Max OverloadStability Max Overload was created in another script I have been working on found below.
I have broken the code down to only display the Stability features.
What this is:
I was trying to find a way that could in some form display the Stability or Instability of the US Treasuries Bond Market. To try and help me do that, I came up with 3 values.
*Stability
*Stability Overload
*Stability Max Overload.
I started with STABILITY. This value is generated based off the number of side by side inversions in the Bond Market. I wanted this value to range between 0 and 1 while 1 equaling all Bonds inverted and 0 equaling no Bonds inverted and any number of inversions in between would equal a percentage value based off the actual number.
STABILITY OVERLOAD was created based off the average of each inversion.
STABILITY MAX OVERLOAD was then created based off the total of each inversion.
The most stable Yield Curve would have no inversions and therefore would generate a 0 for Stability, Stability Overload and Stability Max Overload. The more inversions the Yield Curve has the higher in value Stability itself would have as Stability is weighted more per inversion. With each inversion, data is taken based off the amount with which the Yields are inverted.
This display shows where we currently stand since Dec 2018. It's a telling story so say the least. I do plan on continuing the mentioned above script but again wanted to release a standalone of the data generated.
Hope you enjoy,
OpptionsOnly
Yield Curve Version 2.55.2Welcome to Yield Curve Version 2.55.2
US10Y-US02Y
* Please read description to help understand the information displayed.
* NOTE - This script requires 1 real time update before accurate information is displayed, therefore WILL NOT display the correct information if the Bond Market is Closed over the Weekend.
* NOTE - When values are changed Via Input setting they do take a bit to display based off all the information that is required to display this script.
**FEATURES**
* Input Features let you view the information the way YOU like via Input Settings
* Displays Current Version Title - Toggleable On/Off via Input Settings - Default On
* Plots the Yield Curve of the Bonds listed (Middle Green and Red Line)
* Displays the Spread for each Bond (Top Green and Red Labels) - Toggleable On/Off via Input Settings - Change Size via Input Settings - Default On
* Displays the current Yield for each Bond (Bottom Green and Red Labels) - Toggleable On/Off via Input Settings - Change Size via Input Settings - Default On - Large Size
* Plots the Average of the Entire Yield Curve (BLUE Line within the Yield Curve) - Toggleable On/Off via Input Settings - Default On
* Displays messages based off Yield Inversions (Orange Text) - Toggleable On/Off via Input Settings - Default On if Applicable
* Displays 2 10 Inversion Warning Message (Orange Text) - Toggleable On/Off via Input Settings - Default On if Applicable
* Plots Column Data at the Bottom that tries to help determine the Stability of the Yield Curve (More information Below about Stability) - Toggleable On/Off via Input Settings - Default On
* Plots the 7,20 and 100 SMA of the STABILITY MAX OVERLOAD (More information Below about Stability Max Overload) - Toggleable On/Off via Input Settings - Default On for 100 SMA , 20 SMA and 7 SMA
* Ability to Display Indicator Name and Value via Input Settings - Default On - Displays Stability Max Overload SMA Labels. Toggleable to Non SMA Values. See Below.
**Bottom Columns are all about STABILITY**
* I have tried to come up with an algorithm that helps understand the Stability of the Yield Curve. There are 3 Sections to the Bottom Columns.
* Section 1 - STABILITY (Displayed as the lightest Green or Red Column) Values range from 0 to 1 where 1 equals the MOST UNSTABLE Curve and 0 equals the MOST STABLE Curve
* Section 2 - STABILITY OVERLOAD (Displayed just above the Stability Column a shade darker Green or Red Column)
* Section 3 - STABILITY MAX OVERLOAD (Displayed just above the Stability Overload Column a shade darker Green or Red Column)
What this section tries to do is help understand the Stability of the Curve based on the inversions data. Lower values represent a MORE STABLE curve. If the Yield Curve currently has 0 Inversions all Stability factors should equal 0 and therefore not plot any lower columns. As the Yield Curve becomes more inverted each section represents a value based off that data. GREEN columns represent a MORE Stable Curve from the resolution prior and vise versa.
(S SO SMO)
STABILITY - tests the current Stability of the Curve itself again ranging from 0 to 1 where 0 equals the MOST Stable Curve and 1 equals the MOST Unstable Curve.
STABILIY OVERLOAD - adds a value to STABLITY based off STABILITY itself.
STABILITY MAX OVERLOAD - adds the Entire value to STABILITY derived again from STABILITY.
This section also allows us to see the 7,20 and 100 SMA of the STABILITY MAX OVERLOAD which should always be the GREATEST of ALL STABILTY VALUES.
*Indicator Labels How to use*
Indicator Labels by default are turned On and will display Name and Value Labels for Stability Max Overload SMA values. To switch to (S SO SMO) Labels, toggle "Indicator Labels / SMO SMA Labels", via Input Settings. This button allows you to switch between the two Indicator Label Display options. You must have "Indicators" turned On to view the Labels and therefore is turned On by Default. To turn all of the Indicator Labels Off, simply disable "Indicators" via Input Settings.
Remember - All information displayed can be tuned On or Off besides the Curve itself. There are also other Features Accessible Via the Input Settings.
I will continue to update this script as there is more information I would like to gather and display!
I hope you enjoy,
OpptionsOnly