OPEN-SOURCE SCRIPT
Asset Ratio [Chart-Based]

ASSET RATIO [CHART-BASED] — INDICATOR DESCRIPTION & METADATA
DESCRIPTION:
Asset Ratio is an institutional-grade relative strength indicator that compares
any two assets to identify mean reversion opportunities, breakouts, and regime
changes through statistical deviation analysis.
CORE FUNCTIONALITY:
• Compare any asset pair (stocks, crypto, commodities, indices, USD)
• Calculate Bollinger Band-style deviation bands around the ratio
• Z-score analysis identifies extreme overbought/oversold conditions
• Real-time correlation measurement between asset pair
• Percentage change tracking from benchmark date
KEY FEATURES:
✓ Four pre-built trading regimes (Long-Term, Bull-Run, Balanced, Custom)
✓ Dynamic Bollinger Bands with asymmetric deviation multipliers
✓ Institutional dashboard with Pairing, Deviation, Correlation, Verdict
✓ Mean reversion signal detection (crosses above lower band = bounce risk,
crosses below upper band = pullback risk)
✓ Performance tracking from custom start date with live percentage change label
✓ Comprehensive tooltips and input guidance for all parameters
✓ Aurelius-compliant color theme (dark mode optimized)
✓ Works on any timeframe with configurable smoothing and lookback periods
IDEAL FOR:
• Relative strength trading (tech vs financials, crypto vs traditional assets)
• Cross-asset momentum analysis
• Mean reversion strategies
• Pair trading and hedge construction
• Macro thematic investing
• Currency debasement monitoring (USD penalty mode)
The indicator excels at identifying when one asset is trading at statistical
extremes relative to a benchmark, signaling early entry and exit opportunities
before the ratio mean-reverts back to equilibrium.
CATEGORY:
Technical Analysis / Relative Strength / Multi-Asset Analysis
FEATURES SUMMARY:
Input Categories:
• Data Selection: Choose denominator asset, USD penalty, comparison mode
• Calibration: Select regime profile or customize all parameters
• Start Date: Benchmark for percentage change tracking
Outputs:
• Smoothed ratio with color-coded z-score status
• Upper/Lower Bollinger Bands with standard deviation multipliers
• Mean line with labeled endpoint
• Institutional dashboard (5-row table with real-time metrics)
• Percentage change label from start date
• Mean reversion signal documentation
Compatible Timeframes:
• 1-minute to Monthly (responsive on all timeframes)
Data Requirements:
• Chart asset: Any valid TradingView symbol
• Denominator asset: Any valid ticker (NASDAQ:QQQ, AMEX:GDX, COINBASE:BTCUSD, etc.)
• USD comparisons supported with configurable debasement penalty
USE CASES:
1. RELATIVE STRENGTH TRADING
Monitor when tech (QQQ) outperforms/underperforms financial stocks (XLF)
2. MACRO THEMATIC ANALYSIS
Track gold mining stocks (GDX) vs spot gold price for structural trades
3. PAIR TRADING
Identify when correlated pairs diverge for mean reversion entries
4. CURRENCY DEBASEMENT MONITORING
Compare commodity or asset prices to USD with penalty for inflation analysis
5. BREAKOUT CONFIRMATION
Use correlation and z-score to validate momentum breakouts in ratio pairs
6. MOMENTUM ANALYSIS
Identify which asset is gaining relative strength for directional trading
VERSION HISTORY:
v6.0 (Current)
• Comprehensive input tooltips with regime profile guidance
• Mean reversion signal documentation
• Data validation with runtime error handling
• Label at mean line endpoint
• Aurelius theme compliance with enhanced visibility
• Cross-asset correlation analysis
• Z-score extremes detection
• Institutional dashboard metrics
CREDITS:
Inspired by 'Market Hedge Ratio', created by Charles Edwards
© TrendMatrix_Labs
License: Mozilla Public License 2.0
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.