OPEN-SOURCE SCRIPT

US Net Liquidity Tracker with Sentiment & Offset

172
U.S. Net Liquidity Tracker with Sentiment & Offset - Documentation

This document explains the rationale behind the Pine Script indicator "U.S. Net Liquidity Tracker with Sentiment & Offset" and why it provides an accurate representation of liquidity in the U.S. financial system.

The indicator leverages data from the Federal Reserve's Economic Data (FRED) to calculate net liquidity, offering traders and analysts a tool to assess market conditions influenced by monetary policy.

Purpose of the Indicator

The U.S. Net Liquidity Tracker is designed to measure the amount of liquidity available in the U.S. financial system by accounting for both liquidity injections and drains. Liquidity is a critical factor in financial markets: high liquidity often supports rising asset prices, while low liquidity can signal potential market downturns. This indicator helps users anticipate market trends by providing a clear, data-driven view of net liquidity dynamics.

![U.S. Net Liquidity Tracker Chart]raw.githubusercontent.com/ebasurtop/Macro/main/USNLTrackerUS10Y.png

Rationale Behind the Indicator


What is U.S. Net Liquidity?


Net liquidity represents the money available in the financial system after subtracting liquidity-draining factors from the total liquidity provided by the Federal Reserve. The indicator calculates this by combining key data points that reflect both the creation and removal of liquidity.

Data Sources


The indicator uses the following FRED datasets:

Fed Balance Sheet (WALCL): Total assets held by the Federal Reserve, including securities from quantitative easing (QE). An expanding balance sheet adds liquidity, while a shrinking one (quantitative tightening, QT) reduces it.
Treasury General Account (WTREGEN): The U.S. Treasury’s cash balance at the Fed. A high balance drains liquidity, while spending releases it into the system.
Overnight Reverse Repurchase Agreements (RRPONTSYD): Short-term operations where the Fed borrows cash from institutions, temporarily reducing available liquidity.
Earnings Remittances (RESPPLLOPNWW): Payments from the Fed to the Treasury, which remove liquidity from circulation.

These components are chosen because they collectively represent the primary sources and drains of liquidity in the U.S. economy, providing a comprehensive view of net liquidity.

Calculation

The core formula for net liquidity is:
Pine Script®
global_balance = fed_balance - us_tga_balance - overnight_rrp_balance - earnings_remittances_balance


fed_balance: Total Fed assets (WALCL).
us_tga_balance: Treasury General Account (WTREGEN).
overnight_rrp_balance: Reverse repo operations (RRPONTSYD).
earnings_remittances_balance: Fed remittances to Treasury (RESPPLLOPNWW).

This subtraction isolates the liquidity remaining after accounting for major drains, offering a net perspective on funds available to influence markets.

Additional Features

Smoothing: A Simple Moving Average (SMA) is applied to the net liquidity value to reduce noise and emphasize longer-term trends.
Sentiment Coloring: An Exponential Moving Average (EMA) determines market sentiment:
Bullish (Green): Smoothed liquidity is above the EMA, indicating improving liquidity conditions.
Bearish (Red): Smoothed liquidity is below the EMA, signaling deteriorating conditions.

Offset: Users can shift the liquidity plot forward or backward in time to align it with market data (e.g., S&P 500) for correlation analysis.

Rate of Change (ROC): A plot of the Fed balance sheet’s ROC highlights the pace of monetary policy shifts.

Why This is an Accurate Picture of U.S. Liquidity

The indicator accurately reflects U.S. liquidity for several reasons:

Comprehensive Data:

It incorporates all major liquidity-affecting factors: the Fed’s balance sheet (source) and TGA, reverse repos, and remittances (drains). This holistic approach ensures no significant component is overlooked.


Real-Time Insights:

By pulling data directly from FRED, the indicator reflects current economic conditions, making it relevant for timely decision-making.


Customizability:

Features like toggling components, adjusting smoothing periods, and offsetting the plot allow users to tailor the indicator to their specific analytical needs, enhancing its practical accuracy.


Visual Clarity:

Sentiment coloring and the ROC plot provide intuitive cues about liquidity trends and monetary policy impacts, making complex data actionable.



Conclusion
The "U.S. Net Liquidity Tracker with Sentiment & Offset" is a robust tool for understanding liquidity dynamics in the U.S. financial system. By combining key FRED datasets into a net liquidity calculation, smoothing the results, and adding sentiment and offset features, it delivers an accurate and user-friendly picture of liquidity. This makes it invaluable for traders and analysts seeking to correlate liquidity with market movements and anticipate economic shifts.

Source Code
The source code for this indicator is available on GitHub: ebasurtop/Macro

Disclaimer
All codes and indicators provided by Enrique Basurto are 100% free and open for public use. If you find this work valuable, please consider donating to The Brain Foundation through the Autism Research Coalition to support critical translational research for individuals with autism.

Your contributions help fund vital research initiatives.

Donation Link: Autism Research Coalition
Follow Enrique Basurto on X: @EnriqueBasurto

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.