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!
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。