OPEN-SOURCE SCRIPT
已更新 Trend Consensus Engine [TCE]

The Trend Consensus Engine (TCE) is a comprehensive market analysis system designed to filter out noise and provide a quantifiable "Trend Score" (0-100). Instead of relying on a single indicator, this script aggregates data from multiple market factors—volatility, momentum, and trend structure—to generate high-probability entry signals based on a consensus logic.
This tool is particularly optimized for Crypto (with specific time-gated logic) and BIST (Borsa Istanbul) markets, allowing traders to see the overall health of the trend at a glance via a dashboard.
How It Works
The engine calculates a composite "Total Score" (0-100) derived from four weighted components:
Trend Structure (AlphaTrend & Guppy):
Analyzes the slope and position relative to the AlphaTrend (Credit to KivancOzbilgic) and Guppy Multiple Moving Averages (GMMA).
Positive slopes and price action above key levels add points to the score.
Volatility & Momentum (Squeeze & ADX):
Incorporates the Squeeze Momentum logic (Credit to LazyBear) to detect explosive moves.
ADX Filter: Filters out chopping/ranging markets. If the ADX is too low, the score is penalized or the signal is blocked.
Dynamic Resistance (MA Channels):
Uses a combination of Donchian Mid-Lines and SMAs to determine if the price is in a "safe zone" or hitting resistance.
Price Action Filters (Pinbar Veto):
Automatically detects bearish "Shooting Star" or weak candles at highs. If a bearish pinbar is detected, the entry signal is vetoed regardless of the trend score.
Features & Settings
Smart Scoring Dashboard: Displays the realtime Score, Instant Decision, and confirmed Close Decision on the chart.
Market Profiles:
Crypto Mode: Includes a "Time Gate" feature (07:00 UTC+3 check) to prevent fakeouts during low-liquidity hours.
BIST Mode: Optimized parameters for the Turkish stock market logic (14:00 session checks).
Score Threshold: Users can adjust the minimum score required (Default: 70) to trigger a "BUY" signal.
Visual Guidance: The background of the dashboard changes color (Green/Red/Yellow) based on the consensus.
How to Use
Check the Dashboard: Look at the "SONUÇ" (Result) row.
GİRİŞ ✅ (ENTRY): The Score is above 70, Momentum is positive, and no Bearish Pinbars are present.
BEKLE ⏳ (WAIT): The trend is weak, or a filter (like ADX or Squeeze) is blocking the trade.
Confirm with Price Action: Use the AlphaTrend lines (Blue/Red) as dynamic support/stop-loss levels.
Credits:
AlphaTrend by KivancOzbilgic
Squeeze Momentum Indicator by LazyBear
VuManChu Cipher concepts for inspiration.
Custom Logic: Scoring algorithm and Time-Gating mechanisms are original custom developments.
Disclaimer: This tool is for educational purposes only and does not constitute financial advice.
This tool is particularly optimized for Crypto (with specific time-gated logic) and BIST (Borsa Istanbul) markets, allowing traders to see the overall health of the trend at a glance via a dashboard.
How It Works
The engine calculates a composite "Total Score" (0-100) derived from four weighted components:
Trend Structure (AlphaTrend & Guppy):
Analyzes the slope and position relative to the AlphaTrend (Credit to KivancOzbilgic) and Guppy Multiple Moving Averages (GMMA).
Positive slopes and price action above key levels add points to the score.
Volatility & Momentum (Squeeze & ADX):
Incorporates the Squeeze Momentum logic (Credit to LazyBear) to detect explosive moves.
ADX Filter: Filters out chopping/ranging markets. If the ADX is too low, the score is penalized or the signal is blocked.
Dynamic Resistance (MA Channels):
Uses a combination of Donchian Mid-Lines and SMAs to determine if the price is in a "safe zone" or hitting resistance.
Price Action Filters (Pinbar Veto):
Automatically detects bearish "Shooting Star" or weak candles at highs. If a bearish pinbar is detected, the entry signal is vetoed regardless of the trend score.
Features & Settings
Smart Scoring Dashboard: Displays the realtime Score, Instant Decision, and confirmed Close Decision on the chart.
Market Profiles:
Crypto Mode: Includes a "Time Gate" feature (07:00 UTC+3 check) to prevent fakeouts during low-liquidity hours.
BIST Mode: Optimized parameters for the Turkish stock market logic (14:00 session checks).
Score Threshold: Users can adjust the minimum score required (Default: 70) to trigger a "BUY" signal.
Visual Guidance: The background of the dashboard changes color (Green/Red/Yellow) based on the consensus.
How to Use
Check the Dashboard: Look at the "SONUÇ" (Result) row.
GİRİŞ ✅ (ENTRY): The Score is above 70, Momentum is positive, and no Bearish Pinbars are present.
BEKLE ⏳ (WAIT): The trend is weak, or a filter (like ADX or Squeeze) is blocking the trade.
Confirm with Price Action: Use the AlphaTrend lines (Blue/Red) as dynamic support/stop-loss levels.
Credits:
AlphaTrend by KivancOzbilgic
Squeeze Momentum Indicator by LazyBear
VuManChu Cipher concepts for inspiration.
Custom Logic: Scoring algorithm and Time-Gating mechanisms are original custom developments.
Disclaimer: This tool is for educational purposes only and does not constitute financial advice.
發行說明
Major Update: BIST 5H Momentum Gate & Logic RefinementThis update introduces a stricter and smarter "Time Gate" mechanism specifically for the BIST (Borsa Istanbul) profile:
1. Stricter Momentum Filter: The system now strictly distinguishes between "Positive" (Dark Green) and "Rising" (Lime Green) momentum. Entries are only validated if the 5H Squeeze Momentum is explicitly Rising (Lime).
2. Smart Session Logic:
- Morning Entry: Allowed immediately ONLY if the previous day's final 5H candle showed Rising Momentum.
- 14:00 Confirmation: If the previous close was weak, the system switches to "TAKİP" (Watch) mode and waits for the first 5H candle of the day (closes at 14:00) to confirm strength before signaling an entry.
3. "Watch" Status: Added a dedicated "TAKİP 👀" status on the dashboard for intermediate states where the trend is positive but waiting for session confirmation.
Optimized for reducing false positives during morning gaps.
發行說明
Trend Consensus Engine (TCE) - Complete Trading SystemA comprehensive indicator combining BUY and SELL signals in one tool.
🟢 BUY SIDE (Top Right Panel):
- AlphaTrend + MA Resistance + Guppy Flow
- Squeeze Momentum confirmation
- ADX filtering & Pinbar veto
- Score-based entry system (0-100)
- Crypto Gate (03:00 base + 07:00 check)
- BIST Gate (5H candle confirmation)
🔴 SELL SIDE (Bottom Right Panel):
- 5-8-13 EMA trend break detection
- RSI EMA Divergence + SQZ confirmation
- Panic Exit (V-top detection)
- Staged signals: BEKLE → DİKKAT → SAT
⚙️ Features:
- Auto-detection: Crypto vs BIST profiles
- Customizable thresholds
- Independent BUY/SELL table visibility
- Multi-timeframe ready
Best used on Daily timeframe for swing trading.
發行說明
🔄 UPDATE v4.2 - SELL System ImprovementsNEW: ACİL-SAT (Urgent Sell) Signal
- Bearish Engulfing pattern detection
- Evening Star pattern detection
- Combined with existing triggers (sharp drops, ATR shock)
- Requires SQZ confirmation (dark green or light red)
- Only triggers in uptrend (EMA5 > EMA13)
IMPROVED: Signal Logic
- BEKLE: Price < EMA5
- DİKKAT: SQZ momentum weakening + trend mode filter
- SAT: EMA5/EMA8 crossunder OR SQZ red + ATR buffer + EMA8 slope down
- ACİL-SAT: Candlestick patterns + momentum confirmation
FIXED: Reduced false signals in ranging markets
發行說明
🔄 UPDATE v4.6 - Major Improvements═══════════════════════════════════════════
🔴 ACİL-SAT (Urgent Sell) - BUG FIX
- Fixed false signals on green candles
- Red candle now REQUIRED for trigger
- Added candlestick patterns: Bearish Engulfing, Evening Star
- SQZ confirmation: Dark Green OR Light Red
═══════════════════════════════════════════
🔗 BUY-SELL CROSS FILTER - NEW FEATURE
- SELL side now validates BUY entries
- If SELL status ≠ TREND at close → Entry downgrades to FOLLOW
- Reduces false entries when trend is weak
- Single checkpoint at daily close (no conflicts)
═══════════════════════════════════════════
🔧 STABILITY FIX
- Fixed table flickering on live bars
- All decisions now based on confirmed close
- Smoother display, no more "jumping" values
═══════════════════════════════════════════
📊 SIGNAL LOGIC (SELL Side)
BEKLE (Wait): Price < EMA5
→ Tighten stops
DİKKAT (Caution): SQZ weakening + Trend mode
→ Reduce position 30-50%
SAT (Sell): EMA5/8 cross OR SQZ red + ATR break
→ Exit position
ACİL-SAT (Urgent): Sharp drop / Engulfing / Evening Star + Red candle
→ Exit immediately
═══════════════════════════════════════════
⚡ IMPROVEMENTS SUMMARY
✓ Fewer false ACİL-SAT signals
✓ Better entry quality (cross filter)
✓ Lower drawdown
✓ Stable table display
✓ Cleaner code (922 lines)
發行說明
Updated TP1 ATR multipliers for more consistent target hits and fewer near-miss reversals.TP1 execution: take 40% profit and move stop-loss to breakeven to reduce downside quickly.
Strong TP mode activates only when high score + SQZ OK + ADX OK are all true (prevents overstretched targets in choppy markets).
發行說明
🔄 UPDATE v4.7 - New Features & Improvements═══════════════════════════════════════════
📊 BIST TP SUPPORT - NEW
- TP now available for BIST stocks
- BIST Default: 1.7x ATR
- BIST Strong: 2.1x ATR
- Crypto remains: 2.0x / 2.5x ATR
═══════════════════════════════════════════
⏰ CRYPTO 12H SQZ GATE - NEW
- Second checkpoint at 15:00 (Istanbul time)
- Checks 12H timeframe SQZ momentum color
- Light Green → ENTRY ✅
- Dark Green / Red → FOLLOW 👀
- Only activates when result is already ENTRY
Gate System:
- Gate 1 (07:00): Score + SELL trend check
- Gate 2 (15:00): 12H SQZ color check
═══════════════════════════════════════════
📉 SELL TABLE UPDATE
- Added KAPANIŞ (Close) row - shows previous day's status
- Removed DIV row (divergence signals removed)
- Cleaner display with consistent font sizes
New Layout:
┌──────────┬───────────┐
│ DURUM: │ TREND │ ← Live status
│ KAPANIŞ: │ BEKLE │ ← Previous close
│ SQZ: │ Açık Yeşil│
└──────────┴───────────┘
═══════════════════════════════════════════
🧹 CODE CLEANUP
- Removed divergence detection system
- Reduced code from 963 to 904 lines
- Improved performance
═══════════════════════════════════════════
⚡ SUMMARY
✓ BIST now has TP targets
✓ Crypto has dual gate system (07:00 + 15:00)
✓ SELL table shows both live and close status
✓ Cleaner, faster code
發行說明
TCE v4.9 - AlphaTrend Filter UpdateWhat's New:
Added AlphaTrend filter to SELL ACİL-SAT (Emergency Sell) signal
ACİL-SAT now only triggers when close < AlphaTrend
This prevents false emergency signals during pullbacks when trend is still bullish
Why This Change:
Before: A big red candle during uptrend could trigger ACİL-SAT even if price closed above AlphaTrend (false alarm)
Now: ACİL-SAT requires price to close below AlphaTrend line, confirming trend weakness
No other changes - BUY side and rest of SELL logic remain identical to v4.7
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。