OPEN-SOURCE SCRIPT
Updated

Supertrend + QQE MOD Combined

2 156
I've combined the Supertrend and QQE MOD scripts into a unified trading system. Here's what the combined indicator does:

Dual Signal System:

1. buy/sell labels show every Supertrend reversal
2. Strong Buy/Strong Sell labels only appear when both Supertrend AND QQE MOD align

Signal Logic:

1. Continuous Alignment Check:

alignedBullish - TRUE whenever both Supertrend is bullish AND QQE is bullish
alignedBearish - TRUE whenever both Supertrend is bearish AND QQE is bearish


2. Signal Triggers:

BUY Signal - Fires when alignment FIRST becomes bullish (wasn't aligned before, now is)
SELL Signal - Fires when alignment FIRST becomes bearish (wasn't aligned before, now is)

Alert System:

1. Individual alerts for Supertrend reversals and QQE signals
2. Combined alerts (most important): Fire only when both indicators align
"Any Combined Signal" alert catches both buy and sell alignments

Dashboard:

1. Shows individual status of Supertrend and QQE MOD
2. "Alignment" row shows if both are bullish/bearish
3. "Signal" row highlights actual entry signals

Optional Features:

1. Trading session filter (enable/disable)
2. Background highlighting on signals
3. Toggle individual Supertrend labels
4. Toggle combined signal labels

What This all Means:
Now you'll get signals in these scenarios:

1. Supertrend reverses and QQE is already aligned ✓ (original behavior)
2. QQE crosses threshold while Supertrend is already in the right direction ✓ (NEW!)
Both align simultaneously ✓

Visual Feedback:

Large BUY/SELL labels - Appear when alignment FIRST occurs (entry point)
Background color - Stays highlighted continuously while aligned (shows you're in a good trade zone)
Dashboard - Now shows "Hold Long" or "Hold Short" when aligned but no new signal

This gives you more entry opportunities while maintaining the requirement that both indicators must agree!




Release Notes
Key Changes Made:
Exit Signal Logic Based on Misalignment:

Exit Long Signal - Triggers when bullish alignment is lost (indicators become misaligned after being aligned bullish)
Exit Short Signal - Triggers when bearish alignment is lost (indicators become misaligned after being aligned bearish)

New Features:

Misalignment Detection - Monitors when Supertrend and QQE MOD stop being aligned
Exit Markers - Orange X markers appear when alignment breaks:

Above bars for long exits
Below bars for short exits


Exit Alerts - New alert conditions that trigger when alignment is lost
Dashboard Integration - Shows exit signals in the dashboard status
Toggle Control - "Show Exit Signal Labels" option to show/hide exit markers

This catches any misalignment caused by either Supertrend reversing OR QQE MOD conditions no longer being met
Release Notes
Multiple Exit Methods:

Misalignment Exit - Original exit when alignment is lost
Peak Decline Exit - NEW exit when histogram reaches peak and declines
Toggle Controls - Users can enable/disable each exit method independently

New Features:

Exit Signal Settings Group - Toggle between exit methods
Histogram Dashboard Row - Shows current histogram value and trend direction (↑↓→)
Specific Exit Alerts - Separate alerts for misalignment vs peak decline exits
Combined Exit Logic - Uses OR operator so either condition can trigger an exit

How Peak Decline Works:

For Long positions: Exits when bullish histogram (positive values) starts declining from peak
For Short positions: Exits when bearish histogram (negative values) starts declining from trough (moving back up toward zero)
Only triggers during aligned positions to avoid false signals
Release Notes
changed labeling from long/short to buy/sell for continuity
Release Notes
renaming script to "Supertrend Filtered by QQE with Exit Signals"

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.