OPEN-SOURCE SCRIPT
DCA Percent Signal

Overview
The DCA Percent Signal Indicator generates buy and sell signals based on percentage drops from all-time highs and percentage gains from lowest lows since ATH. This indicator is designed for pyramiding strategies where each signal represents a configurable percentage of equity allocation.
Definitions
DCA (Dollar-Cost Averaging): An investment strategy where you invest a fixed amount at regular intervals, regardless of price fluctuations. This indicator generates signals for a DCA-style pyramiding approach.
Gann Bar Types: Classification system for price bars based on their relationship to the previous bar:
ATH (All-Time High): The highest price level reached during the entire chart period
ATL (All-Time Low): The lowest price level reached since the most recent ATH
Pyramiding: A trading strategy that adds to positions on favorable price movements
Look-Ahead Bias: Using future information that wouldn't be available in real-time trading
Default Properties
Signal Thresholds:
Price Sources:
Filter Options:
Display Options:
How It Works
Buy Signals: Trigger every 10% drop from the all-time highest price reached
Sell Signals: Trigger every 30% increase from the lowest low since the most recent all-time high
Smart Tracking: Uses configurable price sources for signal generation
Key Features
Usage Instructions
Signal Logic
Buy Signals:
Sell Signals:
Limitations
Implementation Notes
The DCA Percent Signal Indicator generates buy and sell signals based on percentage drops from all-time highs and percentage gains from lowest lows since ATH. This indicator is designed for pyramiding strategies where each signal represents a configurable percentage of equity allocation.
Definitions
DCA (Dollar-Cost Averaging): An investment strategy where you invest a fixed amount at regular intervals, regardless of price fluctuations. This indicator generates signals for a DCA-style pyramiding approach.
Gann Bar Types: Classification system for price bars based on their relationship to the previous bar:
- Up Bar: High > previous high AND low ≥ previous low
- Down Bar: High ≤ previous high AND low < previous low
- Inside Bar: High ≤ previous high AND low ≥ previous low
- Outside Bar: High > previous high AND low < previous low
ATH (All-Time High): The highest price level reached during the entire chart period
ATL (All-Time Low): The lowest price level reached since the most recent ATH
Pyramiding: A trading strategy that adds to positions on favorable price movements
Look-Ahead Bias: Using future information that wouldn't be available in real-time trading
Default Properties
Signal Thresholds:
- Buy Threshold: 10% (triggers every 10% drop from ATH)
- Sell Threshold: 30% (triggers every 30% gain from lowest low since ATH)
Price Sources:
- ATH Tracking: High (ATH detection)
- ATL Tracking: Low (low detection)
- Buy Signal Source: Low (buy signals)
- Sell Signal Source: High (sell signals)
Filter Options:
- Apply Gann Filter: False (disabled by default)
- Buy Sets ATL: False (disabled by default)
Display Options:
- Show Buy/Sell Signals: True
- Show Reference Lines: True
- Show Info Table: False
- Show Bar Type: False
How It Works
Buy Signals: Trigger every 10% drop from the all-time highest price reached
Sell Signals: Trigger every 30% increase from the lowest low since the most recent all-time high
Smart Tracking: Uses configurable price sources for signal generation
Key Features
- Configurable Thresholds: Adjustable buy/sell percentage thresholds (default: 10%/30%)
- Separate Price Sources: Independent sources for ATH tracking, ATL tracking, and signal triggers
- Configurable Signals: Uses low for buy signals and high for sell signals by default
- Optional Gann Filter: Apply Gann bar analysis for additional signal filtering
- Optional Buy Sets ATL: Option to set ATL reference point when buy signals occur
- Visual Debug: Detailed labels showing signal parameters and values
Usage Instructions
- Apply to Chart: Use on any timeframe (recommended: 1D or higher for better signal quality)
- Risk Management: Adjust thresholds based on your risk tolerance and market volatility
- Signal Analysis: Monitor debug labels for detailed signal information and validation
Signal Logic
- Buy signals are blocked when ATH increases to prevent buying at peaks
- Sell signals are blocked when ATL decreases to prevent selling at lows
- This ensures signals only trigger on subsequent bars, not the same bar that establishes new reference points
Buy Signals:
- Calculate drop percentage from ATH to buy signal source
- Trigger when drop reaches threshold increments (10%, 20%, 30%, etc.)
- Always blocked on ATH bars to prevent buying at peaks
- Optional: Also blocked on up/outside bars when Gann filter enabled
Sell Signals:
- Calculate gain percentage from lowest low to sell signal source
- Trigger when gain reaches threshold increments (30%, 60%, 90%, etc.)
- Always blocked when ATL decreases to prevent selling at lows
- Optional: Also blocked on down bars when Gann filter enabled
Limitations
- Designed for trending markets; may generate many signals in sideways/ranging markets
- Requires sufficient price movement to be effective
- Not suitable for scalping or very short timeframes
Implementation Notes
- Signals use optimistic price sources (low for buys, high for sells), these can be configured to be more conservative
- Gann filter provides additional signal filtering based on bar types
- Debug information available in data window for real-time analysis
- Detailed labels on each signal show ATH, lowest low, buy level, sell level, and drop/gain percentages
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.