OPEN-SOURCE SCRIPT
Actualizado 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.
Notas de prensa
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.
Notas de prensa
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.
Notas de prensa
🔄 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
Notas de prensa
🔄 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)
Notas de prensa
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).
Notas de prensa
🔄 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
Notas de prensa
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
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.