OPEN-SOURCE SCRIPT
ALT Risk Metric Strategy

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
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
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.