OPEN-SOURCE SCRIPT
HODL-V6-Full-Stack-L0+L1+L2

HODL V6 — Intelligent Dollar-Cost Averaging Strategy for Crypto
Overview
HODL V6 Smart DCA is a production-grade automated investment advisor built as a TradingView Pine Script (v6) indicator. It replaces mechanical "buy on the same day every month" DCA with a three-layer signal fusion system that dynamically adjusts position size based on macro conditions, trend regime, and asset-specific technicals.
The core insight: Not all dips are created equal. A -30% drawdown during a macro risk-off panic is fundamentally different from a -30% dip in a raging bull market. V6 quantifies this difference.
Three-Layer Architecture
┌─────────────┐
│ L0 MACRO │ 30% weight
│ DXY / Gold │ "Is now a good time
│ NDX / VIX │ to buy anything?"
│ Copper / Oil │
└──────┬───────┘
│
┌──────▼───────┐
│ L1 TREND │ 30% weight
│ EMA Regime │ "Which direction is
│ 30d Mom. │ THIS market going?"
│ Vol. Rank │
└──────┬───────┘
│
┌──────▼───────┐
│ L2 ASSET │ 40% weight
│ DCA Bands │ "How deep is THIS
│ RSI / EMA200│ specific dip?"
│ ATR / Regime │
└──────┬───────┘
│
┌──────▼───────┐
│ FINAL SCORE │ 0–100
│ → 5 Actions │ Dynamic sizing
└──────────────┘
L0 — Macro Layer (Global Risk Appetite)
Cross-asset data pulled from 6 macro instruments via request.security() on daily resolution to avoid lookahead bias:
Three sub-scores are computed:
Liquidity Score (weighted momentum of DXY/Gold/NDX/VIX)
Resonance Score (how many assets are aligned in a risk-on direction)
Fear & Greed Proxy (linear transform of VIX level, high VIX → fear)
L1 — Trend Layer (Crypto Market Regime)
Five-factor regime classification for the current asset:
EMA Triple Alignment (20 > 50 > 200) — structural trend health
ADX Filter (ADX > 25 distinguishes strong vs weak regimes)
30-Day Momentum — recent velocity
Volatility Percentile Rank — is the market unusually volatile?
Output: 5 distinct regimes: STRONG_BULL → WEAK_BULL → RANGE → WEAK_BEAR → STRONG_BEAR
L2 — Asset-Specific Layer (Entry Timing)
Five micro-indicators measuring "how good is this exact entry":
DCA Band Depth — distance from ATH mapped to 5 tiered zones (-20%, -30%, -40%, -50%, -65%)
RSI Zone Scoring — granular 10-zone RSI mapping (RSI < 20 = max score, RSI > 80 = 0)
Regime Edge — regime context modifies L2 score (bearish regime = larger L2 bonus when dip buys)
EMA200 Distance — how far below/above the 200-day EMA
ATR Volatility — higher volatility = larger score (chance to buy lower)
Overheat Penalty — RSI > 75 AND price > 20% above EMA200 = automatic -15 penalty
Decision Engine
Final score is a weighted blend:
Final Score = 0.30 × L0 + 0.30 × L1 + 0.40 × L2
The L2 layer gets the highest weight because entry timing matters most for DCA — the macro layer acts as a permission slip, not the primary signal.
Five Action Tiers
The gap between a Heavy Buy (×2.5) and Pause (×0) is a 5× capital efficiency swing — deploying capital when the model is confident, preserving it when conditions are hostile.
Key Design Decisions
Daily-resolution macro data with lookahead=barmerge.lookahead_on — prevents future leak from cross-market timezone differences
ATH-based DCA reference instead of fixed calendar schedule — adapts to market structure; deeper drawdowns get higher scores
Asymmetric risk management — the model is more aggressive at scaling IN than scaling OUT. In bull regimes, RSI thresholds are tighter. In bear regimes, DCA bands get extra weight.
Configurable macro toggle — free TradingView users can disable the L0 layer and run L1+L2 only. Pro+ users get the full three-layer stack.
Requirements
TradingView Pro+ for cross-market symbol references (L0 macro layer)
Free tier users: disable use_macro in settings to run L1+L2 simplified mode
Compatible with any crypto pair on TradingView (BTC, ETH, SOL, etc.)
Works on all timeframes, but designed for daily bars
Alert Integration
Four built-in alertcondition triggers:
V6 Buy Signal — action score ≥ 3 (Normal/Increase/Heavy Buy)
V6 Reduce Signal — action score ≤ 1 (Pause/Reduce)
V6 Deep Dip — DCA Band ≥ 4 (≥ -50% from ATH)
V6 RSI Oversold — RSI < 25 (panic zone)
Status
Production-ready. Full Pine Script v6 source available on Feishu: HODL V6 Smart DCA
Overview
HODL V6 Smart DCA is a production-grade automated investment advisor built as a TradingView Pine Script (v6) indicator. It replaces mechanical "buy on the same day every month" DCA with a three-layer signal fusion system that dynamically adjusts position size based on macro conditions, trend regime, and asset-specific technicals.
The core insight: Not all dips are created equal. A -30% drawdown during a macro risk-off panic is fundamentally different from a -30% dip in a raging bull market. V6 quantifies this difference.
Three-Layer Architecture
┌─────────────┐
│ L0 MACRO │ 30% weight
│ DXY / Gold │ "Is now a good time
│ NDX / VIX │ to buy anything?"
│ Copper / Oil │
└──────┬───────┘
│
┌──────▼───────┐
│ L1 TREND │ 30% weight
│ EMA Regime │ "Which direction is
│ 30d Mom. │ THIS market going?"
│ Vol. Rank │
└──────┬───────┘
│
┌──────▼───────┐
│ L2 ASSET │ 40% weight
│ DCA Bands │ "How deep is THIS
│ RSI / EMA200│ specific dip?"
│ ATR / Regime │
└──────┬───────┘
│
┌──────▼───────┐
│ FINAL SCORE │ 0–100
│ → 5 Actions │ Dynamic sizing
└──────────────┘
L0 — Macro Layer (Global Risk Appetite)
Cross-asset data pulled from 6 macro instruments via request.security() on daily resolution to avoid lookahead bias:
Three sub-scores are computed:
Liquidity Score (weighted momentum of DXY/Gold/NDX/VIX)
Resonance Score (how many assets are aligned in a risk-on direction)
Fear & Greed Proxy (linear transform of VIX level, high VIX → fear)
L1 — Trend Layer (Crypto Market Regime)
Five-factor regime classification for the current asset:
EMA Triple Alignment (20 > 50 > 200) — structural trend health
ADX Filter (ADX > 25 distinguishes strong vs weak regimes)
30-Day Momentum — recent velocity
Volatility Percentile Rank — is the market unusually volatile?
Output: 5 distinct regimes: STRONG_BULL → WEAK_BULL → RANGE → WEAK_BEAR → STRONG_BEAR
L2 — Asset-Specific Layer (Entry Timing)
Five micro-indicators measuring "how good is this exact entry":
DCA Band Depth — distance from ATH mapped to 5 tiered zones (-20%, -30%, -40%, -50%, -65%)
RSI Zone Scoring — granular 10-zone RSI mapping (RSI < 20 = max score, RSI > 80 = 0)
Regime Edge — regime context modifies L2 score (bearish regime = larger L2 bonus when dip buys)
EMA200 Distance — how far below/above the 200-day EMA
ATR Volatility — higher volatility = larger score (chance to buy lower)
Overheat Penalty — RSI > 75 AND price > 20% above EMA200 = automatic -15 penalty
Decision Engine
Final score is a weighted blend:
Final Score = 0.30 × L0 + 0.30 × L1 + 0.40 × L2
The L2 layer gets the highest weight because entry timing matters most for DCA — the macro layer acts as a permission slip, not the primary signal.
Five Action Tiers
The gap between a Heavy Buy (×2.5) and Pause (×0) is a 5× capital efficiency swing — deploying capital when the model is confident, preserving it when conditions are hostile.
Key Design Decisions
Daily-resolution macro data with lookahead=barmerge.lookahead_on — prevents future leak from cross-market timezone differences
ATH-based DCA reference instead of fixed calendar schedule — adapts to market structure; deeper drawdowns get higher scores
Asymmetric risk management — the model is more aggressive at scaling IN than scaling OUT. In bull regimes, RSI thresholds are tighter. In bear regimes, DCA bands get extra weight.
Configurable macro toggle — free TradingView users can disable the L0 layer and run L1+L2 only. Pro+ users get the full three-layer stack.
Requirements
TradingView Pro+ for cross-market symbol references (L0 macro layer)
Free tier users: disable use_macro in settings to run L1+L2 simplified mode
Compatible with any crypto pair on TradingView (BTC, ETH, SOL, etc.)
Works on all timeframes, but designed for daily bars
Alert Integration
Four built-in alertcondition triggers:
V6 Buy Signal — action score ≥ 3 (Normal/Increase/Heavy Buy)
V6 Reduce Signal — action score ≤ 1 (Pause/Reduce)
V6 Deep Dip — DCA Band ≥ 4 (≥ -50% from ATH)
V6 RSI Oversold — RSI < 25 (panic zone)
Status
Production-ready. Full Pine Script v6 source available on Feishu: HODL V6 Smart DCA
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.