Skip to content
All library documents

Treasury Yield Heatmap and Yield-Curve Slope Classification

Article TradingView scripts

Summary

This indicator builds a heatmap of government yields across short and long maturities for a selected country. Users choose a sampling interval and retrieve observations either from a chosen start date or for a specified number of periods. The table aligns yield series by their available dates, colors individual rates relative to the displayed data range, and adds a yield-curve classification based on the correlation between maturities and time order. That correlation is labeled as normal, flat, or inverted, with intermediate categories.

The display supports several countries and intervals, but its usefulness depends on data availability and matching the chart timeframe to the selected sampling frequency. The script calculates the curve measure only when there are at least four non-missing observations. It is a descriptive macro-monitoring tool: the document offers no trading rules, predictive claims, or backtest showing that the heatmap or curve labels forecast asset returns.

Key ideas

  • The table compares short and long government yields over a configurable historical window.
  • Color shading places rates in context relative to the values in the displayed sample.
  • A correlation across maturities supplies a simplified normal, flat, or inverted curve label.
  • The curve calculation needs enough non-missing observations, and timeframe alignment affects the display.
  • The indicator presents yield data but does not establish a trading signal or predictive relationship.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.