OPEN-SOURCE SCRIPT
Grok/Claude Quantum Signal Pro * Enhanced v2

# QSig Pro+ v2 — Dynamic RSI Enhancement
## Release: Quantum Signal Pro Enhanced v2
**Author:** ralis24 (with Claude assistance)
**Version:** 2.0
**Platform:** TradingView (Pine Script v6)
---
## Overview
Version 2 introduces **Trend-Adaptive RSI Thresholds** — a significant enhancement that dynamically adjusts buy and sell levels based on real-time trend strength. This allows the indicator to more effectively capture dips in uptrends and sell bounces in downtrends, rather than waiting for extreme oversold/overbought conditions that rarely occur during strong directional moves.
---
## The Problem v2 Solves
In the original QSig Pro+, RSI thresholds were fixed at 30 (oversold) and 70 (overbought). While these levels work well in ranging markets, they create issues in trending conditions:
- **Strong Uptrends:** Price rarely drops to RSI 30. Pullbacks typically bottom around RSI 40-50, causing missed buy opportunities.
- **Strong Downtrends:** Relief rallies rarely push RSI above 70. Bounces often exhaust around RSI 55-65, causing missed sell opportunities.
The v2 solution: **Let the market's trend strength dictate the appropriate RSI levels.**
---
## New Feature: Dynamic RSI Thresholds
### How It Works
The indicator now detects three distinct market states and applies corresponding RSI thresholds:
| Market State | Detection Criteria | RSI Buy Level | RSI Sell Level |
|--------------|-------------------|---------------|----------------|
| **Strong Uptrend** | +DI > -DI, ADX > 24, ADX rising | < 40 | > 80 |
| **Strong Downtrend** | -DI > +DI, ADX > 24, ADX rising | < 20 | > 60 |
| **Neutral/Ranging** | ADX < 24 or ADX falling | < 30 | > 70 |
### Trend State Detection Logic
```
Strong Uptrend = (+DI > -DI) AND (ADX > threshold) AND (ADX > ADX[N bars ago])
Strong Downtrend = (-DI > +DI) AND (ADX > threshold) AND (ADX > ADX[N bars ago])
Neutral = Neither condition met
```
### Anti-Whipsaw Protection
To prevent rapid switching between threshold sets during choppy transitions, a **confirmation buffer** requires the trend state to persist for a configurable number of bars (default: 2) before the indicator switches regimes.
---
## New Input Parameters
A new input group "**Dynamic RSI Thresholds**" has been added with the following settings:
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Enable Trend-Adaptive RSI Levels | ON | toggle | Master switch for the feature |
| ADX Strong Trend Threshold | 24 | 15-40 | ADX must exceed this to qualify as "strong" trend |
| ADX Rising Lookback (bars) | 3 | 1-10 | ADX must be higher than N bars ago to confirm rising |
| Trend Confirmation Bars | 2 | 1-5 | Bars trend must persist before switching thresholds |
| RSI Buy Level (Strong Uptrend) | 40 | 30-55 | Oversold threshold during confirmed uptrends |
| RSI Sell Level (Strong Uptrend) | 80 | 70-90 | Overbought threshold during confirmed uptrends |
| RSI Buy Level (Strong Downtrend) | 20 | 10-30 | Oversold threshold during confirmed downtrends |
| RSI Sell Level (Strong Downtrend) | 60 | 50-70 | Overbought threshold during confirmed downtrends |
| RSI Buy Level (Neutral/Ranging) | 30 | 20-40 | Standard oversold threshold |
| RSI Sell Level (Neutral/Ranging) | 70 | 60-80 | Standard overbought threshold |
---
## Enhanced Info Panel
The information panel now displays two new rows:
1. **Trend State** — Shows current regime: "STRONG UP" (green), "STRONG DOWN" (red), or "NEUTRAL" (gray)
2. **RSI Levels** — Displays the currently active thresholds (e.g., "40 / 80" during uptrends)
Additionally, the **ADX row** now includes a directional arrow (↑ or ↓) indicating whether ADX is rising or falling.
---
## Enhanced Signal Labels
Buy and sell labels on the chart now include contextual information:
**Before (v1):**
```
BUY: 97,234.50
```
**After (v2):**
```
BUY: 97,234.50
STRONG UP | RSI<40
```
This provides immediate visual confirmation of which threshold regime triggered the signal.
---
## Enhanced Alert System
### New Alert Conditions
Three new alerts have been added for trend state changes:
- **🔼 Strong Uptrend Started** — Fires when market transitions to strong uptrend (thresholds shift to 40/80)
- **🔽 Strong Downtrend Started** — Fires when market transitions to strong downtrend (thresholds shift to 20/60)
- **⚖️ Trend Neutralized** — Fires when trend weakens and thresholds reset to 30/70
### Enhanced Webhook JSON
The JSON alert payload now includes additional fields for bot integration:
```json
{
"action": "BUY",
"symbol": "BTC/USDT",
"price": "97234.50",
"rsi": "38.5",
"rsi_threshold": "40",
"adx": "28.3",
"fisher": "-1.87",
"trend_state": "STRONG UP"
}
```
---
## Bonus Enhancement: Dynamic Fisher Thresholds
As an additional refinement, the Fisher Transform thresholds now adjust slightly based on trend state:
| Trend State | Fisher Buy Level | Fisher Sell Level |
|-------------|------------------|-------------------|
| Strong Uptrend | -1.5 (loosened) | -2.0 (standard) |
| Strong Downtrend | -2.0 (standard) | +1.5 (loosened) |
| Neutral | -2.0 (standard) | +2.0 (standard) |
This allows the indicator to trigger signals in strong trends where momentum oscillators rarely reach extreme levels.
---
## Practical Trading Impact
### Strong Uptrend Example (BTC rally)
- **Before:** Waiting for RSI < 30 means missing most pullback entries
- **After:** RSI < 40 triggers buy signals on normal pullbacks within the trend
### Strong Downtrend Example (Bear market bounce)
- **Before:** Waiting for RSI > 70 means holding through entire relief rallies
- **After:** RSI > 60 triggers sell signals on bounce exhaustion
### Ranging Market
- Thresholds remain at traditional 30/70 levels where mean reversion works best
---
## Backward Compatibility
The dynamic RSI feature can be completely disabled by turning off "Enable Trend-Adaptive RSI Levels" in the settings. When disabled, the indicator behaves identically to v1 using the neutral threshold values (30/70).
---
## Summary of Changes
| Component | v1 | v2 |
|-----------|----|----|
| RSI Thresholds | Fixed 30/70 | Dynamic based on trend state |
| Trend State Detection | Not present | +DI/-DI + ADX + Rising confirmation |
| Whipsaw Protection | Not present | Configurable confirmation bars |
| Info Panel Rows | 10 | 12 (added Trend State, RSI Levels) |
| ADX Display | Value only | Value + direction arrow |
| Signal Labels | Price only | Price + Trend State + Threshold |
| Alert Conditions | 10 | 13 (added 3 trend state alerts) |
| Webhook Fields | 5 | 7 (added rsi_threshold, trend_state) |
| Fisher Thresholds | Fixed | Adaptive (subtle adjustment) |
---
## Recommended Settings by Market Type
### Crypto (High Volatility)
- ADX Strong Trend Threshold: 24
- RSI Buy (Uptrend): 40-45
- RSI Sell (Downtrend): 55-60
### Forex (Medium Volatility)
- ADX Strong Trend Threshold: 22
- RSI Buy (Uptrend): 38-42
- RSI Sell (Downtrend): 58-62
### Stocks/Indices (Lower Volatility)
- ADX Strong Trend Threshold: 20
- RSI Buy (Uptrend): 35-40
- RSI Sell (Downtrend): 60-65
---
## Installation
1. Open TradingView and navigate to Pine Editor
2. Remove or rename existing QSig Pro+ indicator
3. Paste the complete v2 code
4. Click "Add to Chart"
5. Configure Dynamic RSI Thresholds in settings as desired
---
*QSig Pro+ v2 — Smarter entries through trend-aware signal generation*
## Release: Quantum Signal Pro Enhanced v2
**Author:** ralis24 (with Claude assistance)
**Version:** 2.0
**Platform:** TradingView (Pine Script v6)
---
## Overview
Version 2 introduces **Trend-Adaptive RSI Thresholds** — a significant enhancement that dynamically adjusts buy and sell levels based on real-time trend strength. This allows the indicator to more effectively capture dips in uptrends and sell bounces in downtrends, rather than waiting for extreme oversold/overbought conditions that rarely occur during strong directional moves.
---
## The Problem v2 Solves
In the original QSig Pro+, RSI thresholds were fixed at 30 (oversold) and 70 (overbought). While these levels work well in ranging markets, they create issues in trending conditions:
- **Strong Uptrends:** Price rarely drops to RSI 30. Pullbacks typically bottom around RSI 40-50, causing missed buy opportunities.
- **Strong Downtrends:** Relief rallies rarely push RSI above 70. Bounces often exhaust around RSI 55-65, causing missed sell opportunities.
The v2 solution: **Let the market's trend strength dictate the appropriate RSI levels.**
---
## New Feature: Dynamic RSI Thresholds
### How It Works
The indicator now detects three distinct market states and applies corresponding RSI thresholds:
| Market State | Detection Criteria | RSI Buy Level | RSI Sell Level |
|--------------|-------------------|---------------|----------------|
| **Strong Uptrend** | +DI > -DI, ADX > 24, ADX rising | < 40 | > 80 |
| **Strong Downtrend** | -DI > +DI, ADX > 24, ADX rising | < 20 | > 60 |
| **Neutral/Ranging** | ADX < 24 or ADX falling | < 30 | > 70 |
### Trend State Detection Logic
```
Strong Uptrend = (+DI > -DI) AND (ADX > threshold) AND (ADX > ADX[N bars ago])
Strong Downtrend = (-DI > +DI) AND (ADX > threshold) AND (ADX > ADX[N bars ago])
Neutral = Neither condition met
```
### Anti-Whipsaw Protection
To prevent rapid switching between threshold sets during choppy transitions, a **confirmation buffer** requires the trend state to persist for a configurable number of bars (default: 2) before the indicator switches regimes.
---
## New Input Parameters
A new input group "**Dynamic RSI Thresholds**" has been added with the following settings:
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Enable Trend-Adaptive RSI Levels | ON | toggle | Master switch for the feature |
| ADX Strong Trend Threshold | 24 | 15-40 | ADX must exceed this to qualify as "strong" trend |
| ADX Rising Lookback (bars) | 3 | 1-10 | ADX must be higher than N bars ago to confirm rising |
| Trend Confirmation Bars | 2 | 1-5 | Bars trend must persist before switching thresholds |
| RSI Buy Level (Strong Uptrend) | 40 | 30-55 | Oversold threshold during confirmed uptrends |
| RSI Sell Level (Strong Uptrend) | 80 | 70-90 | Overbought threshold during confirmed uptrends |
| RSI Buy Level (Strong Downtrend) | 20 | 10-30 | Oversold threshold during confirmed downtrends |
| RSI Sell Level (Strong Downtrend) | 60 | 50-70 | Overbought threshold during confirmed downtrends |
| RSI Buy Level (Neutral/Ranging) | 30 | 20-40 | Standard oversold threshold |
| RSI Sell Level (Neutral/Ranging) | 70 | 60-80 | Standard overbought threshold |
---
## Enhanced Info Panel
The information panel now displays two new rows:
1. **Trend State** — Shows current regime: "STRONG UP" (green), "STRONG DOWN" (red), or "NEUTRAL" (gray)
2. **RSI Levels** — Displays the currently active thresholds (e.g., "40 / 80" during uptrends)
Additionally, the **ADX row** now includes a directional arrow (↑ or ↓) indicating whether ADX is rising or falling.
---
## Enhanced Signal Labels
Buy and sell labels on the chart now include contextual information:
**Before (v1):**
```
BUY: 97,234.50
```
**After (v2):**
```
BUY: 97,234.50
STRONG UP | RSI<40
```
This provides immediate visual confirmation of which threshold regime triggered the signal.
---
## Enhanced Alert System
### New Alert Conditions
Three new alerts have been added for trend state changes:
- **🔼 Strong Uptrend Started** — Fires when market transitions to strong uptrend (thresholds shift to 40/80)
- **🔽 Strong Downtrend Started** — Fires when market transitions to strong downtrend (thresholds shift to 20/60)
- **⚖️ Trend Neutralized** — Fires when trend weakens and thresholds reset to 30/70
### Enhanced Webhook JSON
The JSON alert payload now includes additional fields for bot integration:
```json
{
"action": "BUY",
"symbol": "BTC/USDT",
"price": "97234.50",
"rsi": "38.5",
"rsi_threshold": "40",
"adx": "28.3",
"fisher": "-1.87",
"trend_state": "STRONG UP"
}
```
---
## Bonus Enhancement: Dynamic Fisher Thresholds
As an additional refinement, the Fisher Transform thresholds now adjust slightly based on trend state:
| Trend State | Fisher Buy Level | Fisher Sell Level |
|-------------|------------------|-------------------|
| Strong Uptrend | -1.5 (loosened) | -2.0 (standard) |
| Strong Downtrend | -2.0 (standard) | +1.5 (loosened) |
| Neutral | -2.0 (standard) | +2.0 (standard) |
This allows the indicator to trigger signals in strong trends where momentum oscillators rarely reach extreme levels.
---
## Practical Trading Impact
### Strong Uptrend Example (BTC rally)
- **Before:** Waiting for RSI < 30 means missing most pullback entries
- **After:** RSI < 40 triggers buy signals on normal pullbacks within the trend
### Strong Downtrend Example (Bear market bounce)
- **Before:** Waiting for RSI > 70 means holding through entire relief rallies
- **After:** RSI > 60 triggers sell signals on bounce exhaustion
### Ranging Market
- Thresholds remain at traditional 30/70 levels where mean reversion works best
---
## Backward Compatibility
The dynamic RSI feature can be completely disabled by turning off "Enable Trend-Adaptive RSI Levels" in the settings. When disabled, the indicator behaves identically to v1 using the neutral threshold values (30/70).
---
## Summary of Changes
| Component | v1 | v2 |
|-----------|----|----|
| RSI Thresholds | Fixed 30/70 | Dynamic based on trend state |
| Trend State Detection | Not present | +DI/-DI + ADX + Rising confirmation |
| Whipsaw Protection | Not present | Configurable confirmation bars |
| Info Panel Rows | 10 | 12 (added Trend State, RSI Levels) |
| ADX Display | Value only | Value + direction arrow |
| Signal Labels | Price only | Price + Trend State + Threshold |
| Alert Conditions | 10 | 13 (added 3 trend state alerts) |
| Webhook Fields | 5 | 7 (added rsi_threshold, trend_state) |
| Fisher Thresholds | Fixed | Adaptive (subtle adjustment) |
---
## Recommended Settings by Market Type
### Crypto (High Volatility)
- ADX Strong Trend Threshold: 24
- RSI Buy (Uptrend): 40-45
- RSI Sell (Downtrend): 55-60
### Forex (Medium Volatility)
- ADX Strong Trend Threshold: 22
- RSI Buy (Uptrend): 38-42
- RSI Sell (Downtrend): 58-62
### Stocks/Indices (Lower Volatility)
- ADX Strong Trend Threshold: 20
- RSI Buy (Uptrend): 35-40
- RSI Sell (Downtrend): 60-65
---
## Installation
1. Open TradingView and navigate to Pine Editor
2. Remove or rename existing QSig Pro+ indicator
3. Paste the complete v2 code
4. Click "Add to Chart"
5. Configure Dynamic RSI Thresholds in settings as desired
---
*QSig Pro+ v2 — Smarter entries through trend-aware signal generation*
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.