OPEN-SOURCE SCRIPT
Aggiornato Composite TECH Line (Debug) – v0.2

The Composite TECH Line is a multi-layered trading framework that blends RSI, MACD, and EMA logic into a single synthetic trend line. Instead of relying on one isolated indicator, this tool dynamically weights three complementary technical factors and creates a smoothed, adaptive signal line that aims to better capture momentum, mean-reversion, and exit dynamics.
🔹 Core Concept
Traditional technical indicators often generate conflicting signals. This script resolves that by:
Scoring RSI, MACD, and EMA individually across a 5-state classification system (from strongly bearish −2 to strongly bullish +2).
Assigning coefficients (customizable multipliers) to each state to quantify the strength of the signal.
Weighting the three indicators (RSI, MACD, EMA) and normalizing their contributions into a unified multiplier.
Synthesizing price by applying this multiplier to close price and smoothing it with an EMA filter.
The result is a Synthetic EMA-like Line, plotted alongside a reference EMA, that adapts its sensitivity based on the joint RSI-MACD-EMA context.
🔹 Technical Structure
1. RSI Layer
Uses fixed thresholds (30/40/60/70 by default).
Each RSI zone is mapped to a discrete state (oversold → neutral → overbought).
Multipliers (e.g., 0.90, 0.96, 1.00, 1.06, 1.12) adjust the contribution of RSI depending on regime.
2. MACD Layer
Evaluates both line polarity (above/below zero) and signal interaction (crossovers, histogram slope).
Produces five discrete states ranging from strong bearish to strong bullish.
Each state is mapped to tunable coefficients, allowing traders to calibrate aggressiveness.
3. EMA Layer (Dual Modes)
Ribbon Mode: Analyzes EMA21/EMA50/EMA100 stack alignment (trend-following).
Distance Mode: Evaluates deviation from a base EMA, normalized either by ATR or relative %.
Two policies: Mean-Revert (extremes expected to reverse) and Momentum (extremes expected to extend).
Produces a coefficient for incorporation into the composite multiplier.
4. Combination Layer
Weighted normalization ensures RSI, MACD, and EMA sum to ~1.
Produces mult_raw → clipped between a configurable Min/Max multiplier.
Final synthetic line = close × mult, smoothed by EMA.
🔹 Signal & Trade Logic
Buy Signal: Triggered when the synthetic line crosses under price with sufficient separation.
Exit System (multi-stage):
TP1 & TP2: Generated by combinations of mean-revert signals and ATR-based Chandelier triggers.
TSL (Trailing Stop): Activates after TP2, tracking new highs with a tighter ATR multiple until stopout.
One-Shot Gate: Prevents repeated signal spam by enforcing alternating buy/sell sequences.
Each event generates a distinct alert message (BUY, TP1, TP2, SL) for automated strategies or notifications.
🔹 Key Features
Unified RSI–MACD–EMA framework.
Configurable coefficients, thresholds, and smoothing.
Two EMA interpretation modes (trend ribbon vs. distance/ATR deviation).
Built-in multi-stage exit system with TP1, TP2, and trailing stops.
Clear labeling on chart + dedicated alert messages for automation.
Debug mode available for transparency of internal calculations.
🔹 Use Cases
As a trend-adaptive signal line for discretionary traders.
As a signal source for automated strategies (via alerts).
As an educational tool to understand how composite signals improve robustness over single indicators.
Disclaimer: This script is for educational and analytical purposes only. Past performance of any strategy or indicator is not a guarantee of future results. Always backtest thoroughly and use proper risk management.
Please subscribe to the weekly bulletin: patreon.com/SigmaForge
🔹 Core Concept
Traditional technical indicators often generate conflicting signals. This script resolves that by:
Scoring RSI, MACD, and EMA individually across a 5-state classification system (from strongly bearish −2 to strongly bullish +2).
Assigning coefficients (customizable multipliers) to each state to quantify the strength of the signal.
Weighting the three indicators (RSI, MACD, EMA) and normalizing their contributions into a unified multiplier.
Synthesizing price by applying this multiplier to close price and smoothing it with an EMA filter.
The result is a Synthetic EMA-like Line, plotted alongside a reference EMA, that adapts its sensitivity based on the joint RSI-MACD-EMA context.
🔹 Technical Structure
1. RSI Layer
Uses fixed thresholds (30/40/60/70 by default).
Each RSI zone is mapped to a discrete state (oversold → neutral → overbought).
Multipliers (e.g., 0.90, 0.96, 1.00, 1.06, 1.12) adjust the contribution of RSI depending on regime.
2. MACD Layer
Evaluates both line polarity (above/below zero) and signal interaction (crossovers, histogram slope).
Produces five discrete states ranging from strong bearish to strong bullish.
Each state is mapped to tunable coefficients, allowing traders to calibrate aggressiveness.
3. EMA Layer (Dual Modes)
Ribbon Mode: Analyzes EMA21/EMA50/EMA100 stack alignment (trend-following).
Distance Mode: Evaluates deviation from a base EMA, normalized either by ATR or relative %.
Two policies: Mean-Revert (extremes expected to reverse) and Momentum (extremes expected to extend).
Produces a coefficient for incorporation into the composite multiplier.
4. Combination Layer
Weighted normalization ensures RSI, MACD, and EMA sum to ~1.
Produces mult_raw → clipped between a configurable Min/Max multiplier.
Final synthetic line = close × mult, smoothed by EMA.
🔹 Signal & Trade Logic
Buy Signal: Triggered when the synthetic line crosses under price with sufficient separation.
Exit System (multi-stage):
TP1 & TP2: Generated by combinations of mean-revert signals and ATR-based Chandelier triggers.
TSL (Trailing Stop): Activates after TP2, tracking new highs with a tighter ATR multiple until stopout.
One-Shot Gate: Prevents repeated signal spam by enforcing alternating buy/sell sequences.
Each event generates a distinct alert message (BUY, TP1, TP2, SL) for automated strategies or notifications.
🔹 Key Features
Unified RSI–MACD–EMA framework.
Configurable coefficients, thresholds, and smoothing.
Two EMA interpretation modes (trend ribbon vs. distance/ATR deviation).
Built-in multi-stage exit system with TP1, TP2, and trailing stops.
Clear labeling on chart + dedicated alert messages for automation.
Debug mode available for transparency of internal calculations.
🔹 Use Cases
As a trend-adaptive signal line for discretionary traders.
As a signal source for automated strategies (via alerts).
As an educational tool to understand how composite signals improve robustness over single indicators.
Disclaimer: This script is for educational and analytical purposes only. Past performance of any strategy or indicator is not a guarantee of future results. Always backtest thoroughly and use proper risk management.
Please subscribe to the weekly bulletin: patreon.com/SigmaForge
Note di rilascio
What's released new****
- Changed alert time zone in order to provide eliminate delaying action times.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.