OPEN-SOURCE SCRIPT
byquan CombinedA+B (Gp 1H vs CHIBAO A)

// GP - Combined EMA Early Retest + SRSI Channel Filter [Anti-Repaint]
This script combines a **price structure-based early retest system** with a **multi-timeframe momentum confirmation filter**, specifically engineered to minimize repainting and improve signal reliability.
The core concept is to detect high-probability pullback entries in the direction of the trend, but only when supported by confirmed momentum reversal from higher timeframes.
### Indicator A – EMA Early Retest System
- Uses a triple EMA setup (Fast 20 / Mid 50 / Slow 100 by default) to determine trend direction.
- Detects impulse moves when the fast EMA crosses mid or slow EMA.
- Tracks pullback depth as a percentage of the impulse wave.
- Triggers an early retest signal when price returns to a defined zone (default 90%) before a full retracement.
- Includes `barstate.isconfirmed` logic to ensure signals are generated only on closed bars, significantly reducing intra-bar false triggers.
### Indicator B – Multi-Timeframe SRSI Channel Filter
- Calculates Stochastic RSI using open, high, low, and close for more comprehensive momentum reading.
- Aggregates data from four higher timeframes (default: 3H, 6H, 12H, 24H).
- Detects momentum extremes and waits for confirmation over a user-defined number of bars.
- Uses `security()` with `[1]` offset and proper lookahead settings to minimize repainting from higher timeframes.
### Combined Filtered Signals
Final signals are only valid when:
- The EMA Early Retest logic generates a setup **and**
- The SRSI Channel has recently confirmed a momentum extreme reversal within the past week (1-week lookback filter).
This dual confirmation greatly reduces noise and increases the quality of signals.
### Visuals & Signals
- **Orange**: Fast EMA (main signal line)
- **Blue**: Mid EMA
- **Gray**: Slow EMA (trend filter)
- **Light triangles**: Raw EMA Early Retest signals (often filtered out)
- **Bright Lime/Red triangles**: **Final filtered high-probability signals**
### How to Use
- **Long Signal** (Lime triangle): Early pullback retest in uptrend + recent SRSI momentum low confirmation.
- **Short Signal** (Red triangle): Early pullback retest in downtrend + recent SRSI momentum high confirmation.
- Best used on **5m, 15m, 30m, and 1H** timeframes for intraday and swing trading.
- Strongly recommended to combine with price action, key levels, or market structure for better results.
### Key Features
- Anti-repainting measures on both EMA logic and higher timeframe data.
- 1-week momentum lookback filter for stronger confluence.
- Clear visual distinction between raw and filtered signals.
This is not a basic mashup. The real value lies in the intelligent integration of **early price retest logic** with **multi-timeframe momentum confirmation**, plus careful anti-repainting implementation.
The script is open-source and shared for educational and research purposes only. It is not financial advice. Always backtest thoroughly and use proper risk management.
Feedback is welcome!
This script combines a **price structure-based early retest system** with a **multi-timeframe momentum confirmation filter**, specifically engineered to minimize repainting and improve signal reliability.
The core concept is to detect high-probability pullback entries in the direction of the trend, but only when supported by confirmed momentum reversal from higher timeframes.
### Indicator A – EMA Early Retest System
- Uses a triple EMA setup (Fast 20 / Mid 50 / Slow 100 by default) to determine trend direction.
- Detects impulse moves when the fast EMA crosses mid or slow EMA.
- Tracks pullback depth as a percentage of the impulse wave.
- Triggers an early retest signal when price returns to a defined zone (default 90%) before a full retracement.
- Includes `barstate.isconfirmed` logic to ensure signals are generated only on closed bars, significantly reducing intra-bar false triggers.
### Indicator B – Multi-Timeframe SRSI Channel Filter
- Calculates Stochastic RSI using open, high, low, and close for more comprehensive momentum reading.
- Aggregates data from four higher timeframes (default: 3H, 6H, 12H, 24H).
- Detects momentum extremes and waits for confirmation over a user-defined number of bars.
- Uses `security()` with `[1]` offset and proper lookahead settings to minimize repainting from higher timeframes.
### Combined Filtered Signals
Final signals are only valid when:
- The EMA Early Retest logic generates a setup **and**
- The SRSI Channel has recently confirmed a momentum extreme reversal within the past week (1-week lookback filter).
This dual confirmation greatly reduces noise and increases the quality of signals.
### Visuals & Signals
- **Orange**: Fast EMA (main signal line)
- **Blue**: Mid EMA
- **Gray**: Slow EMA (trend filter)
- **Light triangles**: Raw EMA Early Retest signals (often filtered out)
- **Bright Lime/Red triangles**: **Final filtered high-probability signals**
### How to Use
- **Long Signal** (Lime triangle): Early pullback retest in uptrend + recent SRSI momentum low confirmation.
- **Short Signal** (Red triangle): Early pullback retest in downtrend + recent SRSI momentum high confirmation.
- Best used on **5m, 15m, 30m, and 1H** timeframes for intraday and swing trading.
- Strongly recommended to combine with price action, key levels, or market structure for better results.
### Key Features
- Anti-repainting measures on both EMA logic and higher timeframe data.
- 1-week momentum lookback filter for stronger confluence.
- Clear visual distinction between raw and filtered signals.
This is not a basic mashup. The real value lies in the intelligent integration of **early price retest logic** with **multi-timeframe momentum confirmation**, plus careful anti-repainting implementation.
The script is open-source and shared for educational and research purposes only. It is not financial advice. Always backtest thoroughly and use proper risk management.
Feedback is welcome!
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.