本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("Trifactor - Fed Net Dollar Liquidity [FRED]", shorttitle="Fed Net Liq", overlay=false, precision=2)
// =============================================================================
// TRIFACTOR MACRO | FED NET DOLLAR LIQUIDITY INDEX
// =============================================================================
// Tracks Federal Reserve Net Dollar Liquidity in Billions of USD:
// Formula: Fed Total Assets (WALCL) - Treasury General Account (WTREGEN) - Overnight Reverse Repo (RRPONTSYD)
// Data Source: St. Louis Fed (FRED)
// =============================================================================
// FRED Data Ingestion (Weekly Series)
// All series are natively normalized by TradingView to raw USD
walcl = request.security("FRED:WALCL", "W", close, barmerge.gaps_off, barmerge.lookahead_off)
wtregen = request.security("FRED:WTREGEN", "W", close, barmerge.gaps_off, barmerge.lookahead_off)
rrpontsyd = request.security("FRED:RRPONTSYD", "W", close, barmerge.gaps_off, barmerge.lookahead_off)
// Calculate Net Liquidity in Billions of USD ($B)
net_liq = (walcl - wtregen - rrpontsyd) / 1000000000.0
// Visual Plotting (Dark-Mode Emerald)
plot(net_liq, title="Fed Net Liquidity ($B)", color=#00E676, linewidth=2)
// Zero Reference Level
hline(0, "Zero Level", color=color.new(#787B86, 70), linestyle=hline.style_dotted)