OPEN-SOURCE SCRIPT

byquan CombinedA+B (Gp 1H vs CHIBAO A)

214
// 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!

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.