OPEN-SOURCE SCRIPT
QQE Trend Strategy [Long/Short]

QQE Trend Strategy [Long/Short]
A dual-band QQE (Quantitative Qualitative Estimation) strategy built on Pine Script v6.
Two independently tuned QQE bands — Fast and Slow — provide both responsive and filtered trend signals, with an optional 50-line direction filter and percentage-based stop loss.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━
QQE transforms RSI into a smoothed oscillator, then applies a double-EMA ATR trailing band to detect trend reversals.
When the QQE line crosses its trailing band:
- Bullish crossover → Buy signal
- Bearish crossover → Sell signal
Two band systems run in parallel:
- Fast Band (lower factor) — more responsive, earlier signals
- Slow Band (higher factor) — smoother, fewer false signals
Select which band drives your entries via the Signal Band setting.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 FEATURES
━━━━━━━━━━━━━━━━━━━━━━━
- Dual QQE Bands (Fast + Slow)
→ Both plotted simultaneously for confluence analysis.
- 50-Line Direction Filter (optional)
→ When ON: Long entries only above 50, Short entries only below 50.
→ Helps eliminate counter-trend trades in strong trending conditions.
- Trade Direction control
→ Both / Long Only / Short Only
- Stop Loss (optional, percentage-based)
→ Calculated from average entry price.
→ Updated on every bar while in position.
- Display toggles
→ Fast Band, Slow Band, Histogram, Background Color, Bar Color, Signal Markers
→ All independently switchable — use as a standalone indicator or a full strategy.
- Commission & Slippage
→ Defaults: 0.03% commission, 1 tick slippage.
→ Adjustable via Strategy Properties tab without editing the script.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 ALERT CONDITIONS (3 total)
━━━━━━━━━━━━━━━━━━━━━━━
- 🟢 Buy Signal — Bullish QQE trend reversal detected
- 🔴 Sell Signal — Bearish QQE trend reversal detected
- ⚡ Any Signal — Either direction triggered
All alerts include ticker and timeframe: {{ticker}}, {{interval}}
━━━━━━━━━━━━━━━━━━━━━━━
🔹 SETTINGS
━━━━━━━━━━━━━━━━━━━━━━━
- RSI Length : 14 (default)
- Smooth EMA Length : 5 (default)
- Fast Band Factor : 2.618 (default)
- Slow Band Factor : 4.236 (default)
- Signal Band : Slow (default)
- Lot Size : 1.0 (default)
Increase the Band Factor to reduce signal frequency.
Decrease it for more responsive entries on shorter timeframes.
━━━━━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━
This script is for educational and backtesting purposes only.
Past performance does not guarantee future results.
Always apply proper risk management before using any strategy in live markets.
A dual-band QQE (Quantitative Qualitative Estimation) strategy built on Pine Script v6.
Two independently tuned QQE bands — Fast and Slow — provide both responsive and filtered trend signals, with an optional 50-line direction filter and percentage-based stop loss.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━
QQE transforms RSI into a smoothed oscillator, then applies a double-EMA ATR trailing band to detect trend reversals.
When the QQE line crosses its trailing band:
- Bullish crossover → Buy signal
- Bearish crossover → Sell signal
Two band systems run in parallel:
- Fast Band (lower factor) — more responsive, earlier signals
- Slow Band (higher factor) — smoother, fewer false signals
Select which band drives your entries via the Signal Band setting.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 FEATURES
━━━━━━━━━━━━━━━━━━━━━━━
- Dual QQE Bands (Fast + Slow)
→ Both plotted simultaneously for confluence analysis.
- 50-Line Direction Filter (optional)
→ When ON: Long entries only above 50, Short entries only below 50.
→ Helps eliminate counter-trend trades in strong trending conditions.
- Trade Direction control
→ Both / Long Only / Short Only
- Stop Loss (optional, percentage-based)
→ Calculated from average entry price.
→ Updated on every bar while in position.
- Display toggles
→ Fast Band, Slow Band, Histogram, Background Color, Bar Color, Signal Markers
→ All independently switchable — use as a standalone indicator or a full strategy.
- Commission & Slippage
→ Defaults: 0.03% commission, 1 tick slippage.
→ Adjustable via Strategy Properties tab without editing the script.
━━━━━━━━━━━━━━━━━━━━━━━
🔹 ALERT CONDITIONS (3 total)
━━━━━━━━━━━━━━━━━━━━━━━
- 🟢 Buy Signal — Bullish QQE trend reversal detected
- 🔴 Sell Signal — Bearish QQE trend reversal detected
- ⚡ Any Signal — Either direction triggered
All alerts include ticker and timeframe: {{ticker}}, {{interval}}
━━━━━━━━━━━━━━━━━━━━━━━
🔹 SETTINGS
━━━━━━━━━━━━━━━━━━━━━━━
- RSI Length : 14 (default)
- Smooth EMA Length : 5 (default)
- Fast Band Factor : 2.618 (default)
- Slow Band Factor : 4.236 (default)
- Signal Band : Slow (default)
- Lot Size : 1.0 (default)
Increase the Band Factor to reduce signal frequency.
Decrease it for more responsive entries on shorter timeframes.
━━━━━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━
This script is for educational and backtesting purposes only.
Past performance does not guarantee future results.
Always apply proper risk management before using any strategy in live markets.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.