OPEN-SOURCE SCRIPT
Zaktualizowano SDCA System | TR

📊 OVERVIEW
The SDCA System | TR is an advanced trading indicator that combines three powerful technical metrics (RSI, ROC, and Sharpe Ratio) into a single weighted score, then applies a Symmetric Dollar-Cost Averaging (SDCA) strategy to manage entries and exits. This system provides both visual signals and automated position management based on extreme market conditions.
🎯 CORE CONCEPT
The indicator normalizes and smooths three independent indicators, combines them with user-defined weights, and generates buy/sell signals when the combined score crosses predefined thresholds. The SDCA logic then executes position adjustments using a percentage-based allocation model.
🔧 KEY COMPONENTS
1. RSI (Relative Strength Index)
Length: Adjustable (default 42)
Normalized and smoothed using a two-stage exponential smoothing process
Clipped to prevent extreme values
Range: -100 to +100
2. ROC (Rate of Change)
Length: Adjustable (default 14)
Normalized and smoothed with the same double-smoothing technique
Clipped to control sensitivity
Range: -100 to +100
3. Sharpe Ratio
Calculates risk-adjusted returns
Lookback period: Adjustable (default 42)
Includes risk-free rate adjustment
Normalized and smoothed similarly to RSI and ROC
Range: -100 to +100
4. Combined Weighted Score
Weighted average of all three indicators
User-adjustable weights (default: RSI 1.0, ROC 1.0, Sharpe 0.5)
Final score range: -100 to +100
5. SDCA Position Management
Buy Signal: Score ≤ Lower Threshold (default: -80)
Sell Signal: Score ≥ Upper Threshold (default: +80)
Percentage-based allocation per signal (default: 10% of capital)
Tracks capital, position size, average price, and total return
📈 HOW IT WORKS
Normalization Process:
Each raw indicator is calculated
Values are clipped to control outliers
First exponential smoothing applied
Normalized to 0-100 range
Second exponential smoothing applied
Final transformation: (smooth2 - 50) × 2 → Range: -100 to +100
Signal Generation:
BUY when: Weighted Score ≤ Lower Threshold AND not in a sell cycle
SELL when: Weighted Score ≥ Upper Threshold AND not in a buy cycle
Cycle states prevent conflicting signals
Position Management:
Each buy signal invests a fixed percentage of remaining capital
Each sell signal liquidates the same percentage of current position
Tracks:
Remaining capital
Position size (shares/units)
Average entry price
Total portfolio value
Total return percentage
The SDCA System | TR is an advanced trading indicator that combines three powerful technical metrics (RSI, ROC, and Sharpe Ratio) into a single weighted score, then applies a Symmetric Dollar-Cost Averaging (SDCA) strategy to manage entries and exits. This system provides both visual signals and automated position management based on extreme market conditions.
🎯 CORE CONCEPT
The indicator normalizes and smooths three independent indicators, combines them with user-defined weights, and generates buy/sell signals when the combined score crosses predefined thresholds. The SDCA logic then executes position adjustments using a percentage-based allocation model.
🔧 KEY COMPONENTS
1. RSI (Relative Strength Index)
Length: Adjustable (default 42)
Normalized and smoothed using a two-stage exponential smoothing process
Clipped to prevent extreme values
Range: -100 to +100
2. ROC (Rate of Change)
Length: Adjustable (default 14)
Normalized and smoothed with the same double-smoothing technique
Clipped to control sensitivity
Range: -100 to +100
3. Sharpe Ratio
Calculates risk-adjusted returns
Lookback period: Adjustable (default 42)
Includes risk-free rate adjustment
Normalized and smoothed similarly to RSI and ROC
Range: -100 to +100
4. Combined Weighted Score
Weighted average of all three indicators
User-adjustable weights (default: RSI 1.0, ROC 1.0, Sharpe 0.5)
Final score range: -100 to +100
5. SDCA Position Management
Buy Signal: Score ≤ Lower Threshold (default: -80)
Sell Signal: Score ≥ Upper Threshold (default: +80)
Percentage-based allocation per signal (default: 10% of capital)
Tracks capital, position size, average price, and total return
📈 HOW IT WORKS
Normalization Process:
Each raw indicator is calculated
Values are clipped to control outliers
First exponential smoothing applied
Normalized to 0-100 range
Second exponential smoothing applied
Final transformation: (smooth2 - 50) × 2 → Range: -100 to +100
Signal Generation:
BUY when: Weighted Score ≤ Lower Threshold AND not in a sell cycle
SELL when: Weighted Score ≥ Upper Threshold AND not in a buy cycle
Cycle states prevent conflicting signals
Position Management:
Each buy signal invests a fixed percentage of remaining capital
Each sell signal liquidates the same percentage of current position
Tracks:
Remaining capital
Position size (shares/units)
Average entry price
Total portfolio value
Total return percentage
Informacje o Wersji
ADDSkrypt 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.