Bond Yield SpreadThe Bond Yield Spread Script is developed for forex traders, offering an automated tool to calculate the bond yield spread between two countries associated with the forex pair displayed on the chart.
Functionality:
The script starts by identifying the base and quote currencies of the current forex pair and aligns them with their corresponding national bond symbols based on user-selected maturity, with options ranging from 01Y to 30Y. It calculates the yield spread by subtracting the bond yield associated with the quote country from that of the base country, following the formula:
Yield Spread = Yield(Base Country) − Yield(Quote Country)
which is then displayed as a plot line on the chart.
This script relies solely on TradingView's internal yield symbols, with the following calculation:
"currency" => "first two letters" + maturity
And maturity, in this case, is the value that is configured in the indicator settings, for example:
"EUR" => "EU" + "02Y" will result in EU02Y -> which will be used in the formula, depending on the quote or base currency.
Application in Trading:
This indicator is invaluable for traders employing carry trading strategies or assessing currency strength based on traded interest rates as an indicator. A higher yield spread typically indicates a stronger currency, because the return obtained for holding the currency is higher.
Originality and Practicality:
This script is self-developed, aiming to fill the gap in automatic bond yield comparisons within the TradingView environment. It is particularly beneficial for traders focusing on macroeconomic factors affecting forex markets. Unlike other scripts, it integrates various bond maturities into one tool, enhancing its utility and application range.
Conclusion:
Designed for traders incorporating macroeconomics in their strategy, this script will be useful to calculate the bond yield differences automatically without having to enter a new formula for every new currency pair.
Compliance and Limitations:
The script complies with TradingView scripting standards, ensuring no lookahead bias and maintaining real-time data integrity. However, its utility depends on the comprehensive availability of bond yield data within TradingView. As not all countries issue bonds for each listed maturity, this may limit the script’s application for certain currency pairs or specific maturities.
Bondyields
US Bond Yield Magma CurveBond Market is the most important to monitor while investing and making macroeconomic desicions.
Inverted bond yeld curve is when short term bond yelds are greater than long term ones and this is a signal of fear for an imminent recession and disaster like a vulcano's eruption
The indicatior is applied to US Bond market but you can try to other countries like EU, China and so on. The code is free.
No further word is more powerful than a clear image as following:
Let's enjoy in making yourself decisions
Bond Yields (China)With reference to "Bond Yields eXtreme" by danarm
The bond yields from China are combined for easy reference
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
Yield CurveThanks to @gwaaf for his post on how to draw the curve!!
* Charts and displays the current Treasury Yield Curve and the Spread.
* Colors Lines and Labels based off price.
* Dynamically adjusts the position of the labels as prices change.
Top Labels:
Top labels display the Spread between listed bonds in regards to Longer term Bonds minus Shorter term Bonds. This label points to the mid point on the curve. If the Spread is greater than the previous Spread at the current resolution, the label and line color on the curve turn Green. If the Spread is less than the previous Spread at the current resolution, the line on the curve and label will turn Red.
Bottom Labels:
Bottom labels display the current for each bond listed. This label points to the (POINT) in the curve that corresponds with the current price of the Bond. The label will turn Green if the current price is higher than the previous price at the current resolution and vise versa!
Known issues:
There seems to be a color swapping issues when the changed is very small. I believe I can fix this with rounding the numbers and will leave that for another time.
10Y Bond Yield Spread (beta)10-Year Bond Yield Spread using Quandl data
See also:
- seekingalpha.com
- www.babypips.com
- www.forexfactory.com