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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。