OPEN-SOURCE SCRIPT
DCA PM Strategy - Crypto & Traditional

# Monthly DCA PM Strategy - Crypto & Traditional Metals
## Overview
An advanced Dollar Cost Averaging (DCA) strategy designed for precious metals and their tokenized cryptocurrency equivalents (PAXG/KAG). This strategy uses a dynamic risk oscillator to identify optimal entry and exit points across multiple buy zones and take-profit levels.
## Key Features
**Multi-Asset Support:**
- Traditional precious metals (Gold, Silver, Platinum, Palladium, Copper)
- Tokenized crypto versions (PAXG - Paxos Gold, KAG - Kinesis Silver)
- Flexible asset combinations with customizable weightings
**Smart DCA System:**
- 3 buy zones with configurable dollar amounts
- Risk-based entry points that buy more during high fear/volatility
- Automatic position sizing based on market conditions
**Take Profit Management:**
- 3 take-profit levels that trigger only once per cycle
- Automatic TP reset when new buys occur
- Prevents over-selling by tracking TP status
**Risk Oscillator:**
- Combines volatility (ATR or StdDev) with RSI indicators
- VIX correlation for market sentiment analysis
- Volume spike detection for panic buying opportunities
- Normalizes across multiple precious metals
**3Commas Integration:**
- Automated trading bot support
- JSON webhook alerts for buy/sell signals
- Compatible with major exchanges (Binance, Coinbase, Kraken, etc.)
**Capital Tracking:**
- Displays exact capital needed per full cycle
- Calculates from TP3 to next TP3
- Accounts for partial recoveries from TP1 and TP2
- Visual labels on chart showing cycle completion
## How It Works
**Buy Zones:**
The strategy uses a 0-100 risk oscillator where lower values indicate better buying opportunities:
- Buy Zone 1 (default 40): Light buying
- Buy Zone 2 (default 30): Medium buying
- Buy Zone 3 (default 20): Heavy buying (extreme fear/dips)
**Take Profits:**
As risk increases (market heats up), the strategy takes profits:
- TP1 (default 70): Sell 33% of position
- TP2 (default 80): Sell 33% of position
- TP3 (default 90): Sell 34% of position
Each TP only triggers once until a new buy resets all TPs. Total sells equal 100% of position across all three levels.
## Strategy Settings
**Oscillator Parameters:**
- Volatility Period: 14 (ATR or Standard Deviation)
- Normalization Lookback: 200 bars
- RSI Period: 14
- Volume Spike Threshold: 2.0x average
**Default Buy Amounts:**
- Zone 1: $50
- Zone 2: $100
- Zone 3: $200
**Default Take Profit %:**
- TP1: 33%
- TP2: 33%
- TP3: 34%
(Total: 100% position exit)
All parameters are fully customizable in the settings panel.
## Usage Tips
1. **For Crypto (PAXG/KAG):** Enable "Use Crypto" toggle and select your exchange
2. **For Traditional Metals:** Use with gold/silver futures or spot markets
3. **Backtesting:** Use 1D or higher timeframes for reliable signals
4. **3Commas:** Add your Bot UUID and Secret Token in settings
5. **Capital Planning:** Check the "Capital Needed" dashboard indicator
## Important Notes
- Strategy uses `process_orders_on_close=true` for no-repaint signals
- Commission set to 0.1% - adjust based on your broker/exchange
- Pyramiding allows up to 500 orders for extended DCA campaigns
- Works best on daily or higher timeframes
## Credits & Development
**Created by:** nakphanan
**AI Development Assistance:** Claude AI by Anthropic
**Concept:** Dollar Cost Averaging combined with risk-based position sizing
**Inspired by:** Traditional DCA strategies and modern crypto asset management
## Risk Disclaimer
This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own research and consider your risk tolerance before trading. Precious metals and cryptocurrencies can be highly volatile.
## Version History
- v1.0: Initial release with 3 buy zones, 3 TPs, and capital tracking
- Includes PAXG/KAG crypto support
- 3Commas integration for automated trading
- Multi-metal composite risk calculation
**Compatible:** Works with all timeframes (recommended: 1D+)
## Overview
An advanced Dollar Cost Averaging (DCA) strategy designed for precious metals and their tokenized cryptocurrency equivalents (PAXG/KAG). This strategy uses a dynamic risk oscillator to identify optimal entry and exit points across multiple buy zones and take-profit levels.
## Key Features
**Multi-Asset Support:**
- Traditional precious metals (Gold, Silver, Platinum, Palladium, Copper)
- Tokenized crypto versions (PAXG - Paxos Gold, KAG - Kinesis Silver)
- Flexible asset combinations with customizable weightings
**Smart DCA System:**
- 3 buy zones with configurable dollar amounts
- Risk-based entry points that buy more during high fear/volatility
- Automatic position sizing based on market conditions
**Take Profit Management:**
- 3 take-profit levels that trigger only once per cycle
- Automatic TP reset when new buys occur
- Prevents over-selling by tracking TP status
**Risk Oscillator:**
- Combines volatility (ATR or StdDev) with RSI indicators
- VIX correlation for market sentiment analysis
- Volume spike detection for panic buying opportunities
- Normalizes across multiple precious metals
**3Commas Integration:**
- Automated trading bot support
- JSON webhook alerts for buy/sell signals
- Compatible with major exchanges (Binance, Coinbase, Kraken, etc.)
**Capital Tracking:**
- Displays exact capital needed per full cycle
- Calculates from TP3 to next TP3
- Accounts for partial recoveries from TP1 and TP2
- Visual labels on chart showing cycle completion
## How It Works
**Buy Zones:**
The strategy uses a 0-100 risk oscillator where lower values indicate better buying opportunities:
- Buy Zone 1 (default 40): Light buying
- Buy Zone 2 (default 30): Medium buying
- Buy Zone 3 (default 20): Heavy buying (extreme fear/dips)
**Take Profits:**
As risk increases (market heats up), the strategy takes profits:
- TP1 (default 70): Sell 33% of position
- TP2 (default 80): Sell 33% of position
- TP3 (default 90): Sell 34% of position
Each TP only triggers once until a new buy resets all TPs. Total sells equal 100% of position across all three levels.
## Strategy Settings
**Oscillator Parameters:**
- Volatility Period: 14 (ATR or Standard Deviation)
- Normalization Lookback: 200 bars
- RSI Period: 14
- Volume Spike Threshold: 2.0x average
**Default Buy Amounts:**
- Zone 1: $50
- Zone 2: $100
- Zone 3: $200
**Default Take Profit %:**
- TP1: 33%
- TP2: 33%
- TP3: 34%
(Total: 100% position exit)
All parameters are fully customizable in the settings panel.
## Usage Tips
1. **For Crypto (PAXG/KAG):** Enable "Use Crypto" toggle and select your exchange
2. **For Traditional Metals:** Use with gold/silver futures or spot markets
3. **Backtesting:** Use 1D or higher timeframes for reliable signals
4. **3Commas:** Add your Bot UUID and Secret Token in settings
5. **Capital Planning:** Check the "Capital Needed" dashboard indicator
## Important Notes
- Strategy uses `process_orders_on_close=true` for no-repaint signals
- Commission set to 0.1% - adjust based on your broker/exchange
- Pyramiding allows up to 500 orders for extended DCA campaigns
- Works best on daily or higher timeframes
## Credits & Development
**Created by:** nakphanan
**AI Development Assistance:** Claude AI by Anthropic
**Concept:** Dollar Cost Averaging combined with risk-based position sizing
**Inspired by:** Traditional DCA strategies and modern crypto asset management
## Risk Disclaimer
This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own research and consider your risk tolerance before trading. Precious metals and cryptocurrencies can be highly volatile.
## Version History
- v1.0: Initial release with 3 buy zones, 3 TPs, and capital tracking
- Includes PAXG/KAG crypto support
- 3Commas integration for automated trading
- Multi-metal composite risk calculation
**Compatible:** Works with all timeframes (recommended: 1D+)
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.