OPEN-SOURCE SCRIPT

Yield Curve Version 2.55.2

Updated
Welcome 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
Release Notes
Yield Curve Version 2.58.4

** New Features **

* Added Ability to View Stability, Stability Overload and Stability Max Overload History via Input Settings
* Added Ability to View Stability Max Overload SMA History via Input Setting


Release Notes
** BUG FIX UPDATE** In previous Versions, STABILITY would not generate the correct number given certain criteria.

* Fixed the equation as to how STABILITY is calculated.
* Added a trigger if this value becomes greater than 1.

It is very unlikely that the greater than 1 trigger will come in to play but as it is still possible, I added it in for safety.

Best wishes,
OpptionsOnly
Release Notes
**UPDATES**
******************************************************************************

- Added Total Inversion line ( Sum of all inversions )
- Added Spread of YCA and Total inversion ( Tracks the Spread of the entire Yield Curve Average vs. the Total Inversion )

- Added labels for Total Inversion
- Added labels for Spread(YCA/TI)

- Added Toggleable inputs for TI Data (And Labels)
- Added Toggleable inputs for Spread(YCA/TI) (And Labels)

- Total Inversion and YCA/TI Spread are turned off by default and can be turned on via Input settings.

**FIXES**
******************************************************************************

- Fixed Labels to display the correct position based off the current resolution (WIP)


**CHANGES**
******************************************************************************

- Changed Label size from size.normal to size.large


**Known Issues**
******************************************************************************

While Display Labels can be turned on or off, they do tend to overlap if the data values are too close together. At this point, it's highly unlikely I will address this issue as it's not a priority.
Release Notes
**UPDATE**

*Updated to Yield Curve Version 2.8*
*Updated the arguments in the plot functions to handle transparency due to upcoming arguments being deprecated.*
Release Notes
** Updates **
Version 2.81

** Changes **
Changed the hloff variable from .2 to 1
Added 1 to location of the tile

Both changes were made for better readability at this given time. At this point I am not sure if I will make the variable dynamic or not, so it doesn't need to be changed again. If I decide to do that, I might also fix the issue of overlapping text when values are close together.
Release Notes
Removed trend lines from chart.
Release Notes
*UPDATE*

Updated the location of the 2-10 Inversion text. (If Applicable)
Release Notes
** Update **

Adjusted the label position on the "Inverted" labels as their positions are not 100% dynamic. Again, at this time I don't have any plans to make the positions completely dynamic so I will just update the script from time to time to make it more readable.
bondsbondspreadbondyieldsMoving AveragesSimple Moving Average (SMA)stabilitytreasurybondsTrend AnalysisUS02YUS02Y-US10YUS10Yyieldcurve

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer