US Net Liquidity Tracker with Sentiment & OffsetU.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.
! raw.githubusercontent.com
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:
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
Dati economici Federal Reserve
RRP DailyA simple script showing US reverse repurchase agreements and Federal Treasury balance values from FRED.
This script should give a neat overview of how little faith there is in the markets from how much cash is parked in ORRPs.
I made this a while ago as a private script so here it is as a public script.
The indicator is locked to the 1 Day resolution.
US RecessionsThere are a couple of other Pine Scripts on TradingView that others have kindly contributed but they are presently out-dated because they shade recessions based on manual entries of time. Thanks to the availability of pulling data from QUANDL, we can pull official data from FRED on data like US Recessions.
The FRED series data is taken from is here- fred.stlouisfed.org
"Our time series is composed of dummy variables that represent periods of expansion and recession. A value of 1 is a recessionary period, while a value of 0 is an expansionary period. For this time series, the recession begins on the 15th day of the month of the peak and ends on the 15th day of the month of the trough. This time series is a disaggregation of the monthly series."
This series tracks back to 1854, but good luck finding much of any data on TradingView that goes that far back :)
Libor-EFFRThis is the 3-month Libor minus effective federal funds rate. Traders watch certain spreads for a wider spread to indicate a bad economy.
This is a conceptual indicator that tries to make sense of how important a FRA-OIS spread can be, in this case the Libor-EFFR. It may be completely wrong in calculation and understanding :)
en.wikipedia.org
www.investopedia.com
Libor was derived from the TED Spread less 3-month treasury bills due to Quandl missing updated Libor data.
fred.stlouisfed.org
fred.stlouisfed.org
For the OIS, EFFR is used because it has long historical data and is one of (maybe) the rates used for spread. SOFR was not available at the time but it appears that is what is more common nowadays.
A possible derivative of this indicator would be taking Libor and putting it against something else.