OPEN-SOURCE SCRIPT
Diupdate

ALT Risk Metric Strategy

552
Here's a professional write-up for your ALT Risk Strategy script:

ALT/BTC Risk Strategy - Multi-Crypto DCA with Bitcoin Correlation Analysis
Overview
This strategy uses Bitcoin correlation as a risk indicator to time entries and exits for altcoins. By analyzing how your chosen altcoin performs relative to Bitcoin, the strategy identifies optimal accumulation periods (when alt/BTC is oversold) and profit-taking opportunities (when alt/BTC is overbought). Perfect for traders who want to outperform Bitcoin by strategically timing altcoin positions.
Key Innovation: Why Alt/BTC Matters
Most traders focus solely on USD price, but Alt/BTC ratios reveal true altcoin strength:

When Alt/BTC is low → Altcoin is undervalued relative to Bitcoin (buy opportunity)
When Alt/BTC is high → Altcoin has outperformed Bitcoin (take profits)
This approach captures the rotation between BTC and alts that drives crypto cycles

Key Features
📊 Advanced Technical Analysis

RSI (60% weight): Primary momentum indicator on weekly timeframe
Long-term MA Deviation (35% weight): Measures distance from 150-period baseline
MACD (5% weight): Minor confirmation signal
EMA Smoothing: Filters noise while maintaining responsiveness
All calculations performed on Alt/BTC pairs for superior market timing

💰 3-Tier DCA System

Level 1 (Risk ≤ 70): Conservative entry, base allocation
Level 2 (Risk ≤ 50): Increased allocation, strong opportunity
Level 3 (Risk ≤ 30): Maximum allocation, extreme undervaluation
Continuous buying: Executes every bar while below threshold for true DCA behavior
Cumulative sizing: L3 triggers = L1 + L2 + L3 amounts combined

📈 Smart Profit Management

Sequential selling: Must complete L1 before L2, L2 before L3
Percentage-based exits: Sell portions of position, not fixed amounts
Auto-reset on re-entry: New buy signals reset sell progression
Prevents premature full exits during volatile conditions

🤖 3Commas Automation

Pre-configured JSON webhooks for Custom Signal Bots
Multi-exchange support: Binance, Coinbase, Kraken, Bitfinex, Bybit
Flexible quote currency: USD, USDT, or BUSD
Dynamic order sizing: Automatically adjusts to your tier thresholds
Full webhook documentation compliance

🎨 Multi-Asset Support
Pre-configured for popular altcoins:

ETH (Ethereum)
SOL (Solana)
ADA (Cardano)
LINK (Chainlink)
UNI (Uniswap)
XRP (Ripple)
DOGE
RENDER
Custom option for any other crypto

How It Works
Risk Metric Calculation (0-100 scale):

Fetches weekly Alt/BTC price data for stability
Calculates RSI, MACD, and deviation from 150-period MA
Normalizes MACD to 0-100 range using 500-bar lookback
Combines weighted components: (MACD × 0.05) + (RSI × 0.60) + (Deviation × 0.35)
Applies 5-period EMA smoothing for cleaner signals

Color-Coded Risk Zones:

Green (0-30): Extreme buying opportunity - Alt heavily oversold vs BTC
Lime/Yellow (30-70): Accumulation range - favorable risk/reward
Orange (70-85): Caution zone - consider taking initial profits
Red/Maroon (85-100+): Euphoria zone - aggressive profit-taking

Entry Logic:

Buys execute every candle when risk is below threshold
As risk decreases, position sizing automatically scales up
Example: If risk drops from 60→25, you'll be buying at L1 rate until it hits 50, then L2 rate, then L3 rate

Exit Logic:

Sells only trigger when in profit AND risk exceeds thresholds
Sequential execution ensures partial profit-taking
If new buy signal occurs before all sells complete, sell levels reset to L1

Configuration Guide
Choosing Your Altcoin:

Select crypto from dropdown (or use CUSTOM for unlisted coins)
Pick your exchange
Choose quote currency (USD, USDT, BUSD)

Risk Metric Tuning:

Long Term MA (default 150): Higher = more extreme signals, Lower = more frequent
RSI Length (default 10): Lower = more volatile, Higher = smoother
Smoothing (default 5): Increase for less noise, decrease for faster reaction

Buy Settings (Aggressive DCA Example):

L1 Threshold: 70 | Amount: $5
L2 Threshold: 50 | Amount: $6
L3 Threshold: 30 | Amount: $7
Total L3 buy = $18 per candle when deeply oversold

Sell Settings (Balanced Exit Example):

L1: 70 threshold, 25% position
L2: 85 threshold, 35% position
L3: 100 threshold, 40% position (final exit)

3Commas Setup
Bot Configuration:

Create Custom Signal Bot in 3Commas
Set trading pair to your altcoin/USD (e.g., ETH/USD, SOL/USDT)
Order size: Select "Send in webhook, quote" to use strategy's dollar amounts
Copy Bot UUID and Secret Token

Script Configuration:

Paste credentials into 3Commas section inputs
Check "Enable 3Commas Alerts"
Save and apply to chart

TradingView Alert:

Create Alert → Condition: "alert() function calls only"
Webhook URL: api.3commas.io/signal_bots/webhooks
Enable "Webhook URL" checkbox
Expiration: Open-ended

Strategy Advantages
✅ Outperform Bitcoin: Designed specifically to beat BTC by timing alt rotations
✅ Capture Alt Seasons: Automatically accumulates when alts lag, sells when they pump
✅ Risk-Adjusted Sizing: Buys more when cheaper (better risk/reward)
✅ Emotional Discipline: Systematic approach removes fear and FOMO
✅ Multi-Asset: Run same strategy across multiple altcoins simultaneously
✅ Proven Indicators: Combines RSI, MACD, and MA deviation - battle-tested tools
Backtesting Insights
Optimal Timeframes:

Daily chart: Best for backtesting and signal generation
Weekly data is fetched internally regardless of display timeframe

Historical Performance Characteristics:

Accumulates heavily during bear markets and BTC dominance periods
Captures explosive altcoin rallies when BTC stagnates
Sequential selling preserves capital during extended downtrends
Works best on established altcoins with multi-year history

Risk Considerations:

Requires capital reserves for extended accumulation periods
Some altcoins may never recover if fundamentals deteriorate
Past correlation patterns may not predict future performance
Always size positions according to personal risk tolerance

Visual Interface
Indicator Panel Displays:

Dynamic color line: Green→Lime→Yellow→Orange→Red as risk increases
Horizontal threshold lines: Dashed lines mark your buy/sell levels
Entry/Exit labels: Green labels for buys, Orange/Red/Maroon for sells
Real-time risk value: Numerical display on price scale

Customization:

All threshold lines are adjustable via inputs
Color scheme clearly differentiates buy zones (green spectrum) from sell zones (red spectrum)
Line weights emphasize most extreme thresholds (L3 buy and L3 sell)

Strategy Philosophy
This strategy is built on the principle that altcoins move in cycles relative to Bitcoin. During Bitcoin rallies, alts often bleed against BTC (high sell, accumulate). When Bitcoin consolidates, alts pump (take profits). By measuring risk on the Alt/BTC chart instead of USD price, we time these rotations with precision.
The 3-tier system ensures you're always averaging in at better prices and scaling out at better prices, maximizing your Bitcoin-denominated returns.
Advanced Tips
Multi-Bot Strategy:
Run this on 5-10 different altcoins simultaneously to:

Diversify correlation risk
Capture whichever alt is pumping
Smooth equity curve through rotation

Pairing with BTC Strategy:
Use alongside the BTC DCA Risk Strategy for complete portfolio coverage:

BTC strategy for core holdings
ALT strategies for alpha generation
Rebalance between them based on BTC dominance

Threshold Calibration:

Check 2-3 years of historical data for your chosen alt
Note where risk metric sat during major bottoms (set buy thresholds)
Note where it peaked during euphoria (set sell thresholds)
Adjust for your risk tolerance and holding period

Credits
Strategy Development & 3Commas Integration: Claude AI (Anthropic)
Technical Analysis Framework: RSI, MACD, Moving Average theory
Implementation: pommesUNDwurst
Disclaimer
This strategy is for educational purposes only. Cryptocurrency trading involves substantial risk of loss. Altcoins are especially volatile and many fail completely. The strategy assumes liquid markets and reliable Alt/BTC price data. Always do your own research, understand the fundamentals of any asset you trade, and never risk more than you can afford to lose. Past performance does not guarantee future results. The authors are not financial advisors and assume no liability for trading decisions.
Additional Warning: Using leverage or trading illiquid altcoins amplifies risk significantly. This strategy is designed for spot trading of established cryptocurrencies with deep liquidity.

Tags: Altcoin, Alt/BTC, DCA, Risk Metric, Dollar Cost Averaging, 3Commas, ETH, SOL, Crypto Rotation, Bitcoin Correlation, Automated Trading, Alt Season

Feel free to modify any sections to better match your style or add specific backtesting results you've observed! 🚀Claude is AI and can make mistakes. Please double-check responses. Sonnet 4.5
Catatan Rilis
Overview
The ALT Risk Strategy is a comprehensive DCA system for cryptocurrency altcoin trading against Bitcoin pairs. It combines technical analysis, market sentiment, and macroeconomic indicators to create a dynamic risk metric (0-100 scale) that identifies optimal entry and exit points for long-term accumulation.
Originality & Purpose
This script is original because it integrates four complementary analytical dimensions:

Base Technical Risk - ALT/BTC momentum, trend strength, and deviation
Market Sentiment - Fear & Greed Index using volatility, dominance, and psychology
Macroeconomic Context - ISM PMI indicating expansion/contraction cycles
Social Risk - Volatility-adjusted RSI with extreme sentiment detection

Why combine these? Cryptocurrency assets are uniquely sensitive to ALL these factors simultaneously. Technical analysis alone fails during macro shifts, while sentiment can give false signals in ranging markets. The carefully weighted combination provides more robust risk assessment than any single indicator.

How It Works
The Risk Metric (0-100 Scale)
A composite risk score determines when to accumulate (LOW risk = 0-30) and distribute (HIGH risk = 70-100+).
Components:
1. BASE RISK METRIC (Weekly ALT/BTC)

Normalized MACD (5% weight): Momentum using 8/26 EMAs
RSI (60% weight): 10-period momentum oscillator - primary driver
Price Deviation (35% weight): Distance from 150-week MA

Base Risk = (MACD × 0.05) + (RSI × 0.60) + ((Deviation + 1) × 0.35 × 100)
2. FEAR & GREED INDEX (Default weight: 0.20)

Crypto Mode: BVOL24H volatility + BTC Dominance
Traditional Mode: VIX + Gold performance
Combines price momentum, rate of return, money flow, and market proxies
Deviation from neutral (50) is added/subtracted from base risk
Example: F&G = 20 (fear) → -6 point adjustment → encourages buying

3. ISM PMI (Default weight: 0.15)

Uses US Manufacturing PMI economic data
PMI > 50 (expansion) → Raises risk metric
PMI < 50 (contraction) → Lowers risk metric
Dead zone 48-52 eliminates noise
Optional offset to test lead/lag relationships

4. SOCIAL RISK (Default weight: 0.10)

Chart timeframe RSI centered at zero
Volatility dampening during choppy markets
Extreme boosts: RSI >80 or <20 trigger ±25 adjustments
7-period smoothing + neutral zone (-5 to +5)
Positive = greed/raises risk, Negative = fear/lowers risk

Final Calculation
Risk Metric = Base Risk + F&G Adjustment + PMI Adjustment + Social Adjustment
Smoothed with 5-period EMA on weekly timeframe.

Trading Logic
TIERED BUYING (Cumulative DCA)

Buy L1 (Risk ≤ 70): $5 - Initial accumulation
Buy L2 (Risk ≤ 50): $11 total - Increased conviction
Buy L3 (Risk ≤ 30): $18 total - Maximum accumulation at extremes

When buy triggers: Open/add position, reset sell levels, optional 3Commas alert.
TIERED SELLING (Sequential Distribution)

Sell L1 (Risk ≥ 70): 25% - Initial profits
Sell L2 (Risk ≥ 85): 35% - More distribution
Sell L3 (Risk ≥ 100): 40% - Exit majority at peak

Each level must complete before next triggers (prevents dumping all at once).

How to Use
1. Setup

Crypto Symbol: Choose altcoin (ETH, SOL, etc.)
Exchange: Select venue (Binance, Coinbase, etc.)
Uses ALT/BTC for risk calculations, ALT/USD for trading

2. Calibrate Risk Metric

Long Term MA (150): Fair value baseline
RSI Length (10): Lower = more sensitive, Higher = smoother
Smoothing (5): Increase to reduce whipsaws

3. Tune Component Weights

F&G Weight (0.20): Increase for sentiment-driven alts, decrease for technical focus
PMI Weight (0.15): Increase for traditional-finance-linked alts, decrease for pure crypto
Social Weight (0.10): Increase for momentum plays, decrease for stable assets
Keep base risk as primary driver; adjustments typically add ±30 points total

4. Set Thresholds

Buy (70/50/30): Lower for aggressive, raise for conservative
Sell (70/85/100): Lower for early exits, raise for more upside
Dollar Amounts: Scale to your capital; L3 should be largest
Sell %: Default 25/35/40 = 100% distribution

5. 3Commas Integration (Optional)
Enter Bot UUID and Secret Token for automated execution.
6. Monitor

Info Table: Shows current risk, adjustments, weights, position
Color-Coded Line: Green = buy zones, Red/Maroon = sell zones
Labels: Buy/sell execution markers
Optional Plots: View F&G, PMI, Social Risk separately


Best Practices
✅ Start with defaults, backtest 2-3 years covering all market conditions
✅ This is DCA accumulation (10-30 signals/year), not day trading
✅ Respect tiered approach - don't skip to L3 only
✅ If one component dominates, reduce its weight
✅ Adapt to market regimes: Adjust thresholds quarterly
✅ Paper trade before automating
Market Adaptation:

Bull: Increase sell thresholds, decrease buy thresholds
Bear: Decrease sell thresholds, increase buy thresholds
High sentiment periods: Increase F&G/Social weights
Macro-driven periods: Increase PMI weight


Advantages
✅ Multi-dimensional analysis (technical + sentiment + macro)
✅ Highly adaptable to any altcoin
✅ Risk-aware position sizing via tiers
✅ Catches trend AND extremes
✅ Transparent, adjustable logic
✅ Automation ready (3Commas)
Limitations
⚠️ Requires patience - positions build over weeks/months
⚠️ Designed for ALT/BTC pairs, not Bitcoin
⚠️ Depends on external tickers (BVOL24H, BTC.D, PMI, VIX, GOLD)
⚠️ No stop loss - assumes long-term holding
⚠️ Can generate signals in extended ranges

Use Cases
✅ Long-term altcoin accumulation (6+ months)
✅ Systematic DCA strategies
✅ Portfolio rebalancing (ALT/BTC rotation)
✅ Macro-aware crypto investing
✅ Sentiment-fading (buy fear, sell greed)
❌ Not for: Day trading, scalping, leverage, Bitcoin-only, shorting

Credits
Strategy synthesizes classic technical analysis, sentiment frameworks, macroeconomic indicators, and behavioral finance concepts.
Development: Strategy and Pine Script coding assisted by Claude AI (Anthropic).
External data: BVOL24H, BTC.D, VIX, GOLD, ECONOMICS:USBCOI (public TradingView tickers).

Disclaimer
Educational purposes only. Not financial advice. Cryptocurrency trading carries substantial risk. Past performance doesn't guarantee future results. Always do your own research, backtest thoroughly, and never invest more than you can afford to lose.

Pine Script v5 | Long-term DCA accumulation strategy | Multi-factor risk assessment | Open source

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.