OPEN-SOURCE SCRIPT
AS PRO Trendline Engine (SMC Style)

🧠 1. Trend Detection (SMA 9 + Candle Coloring)
The script calculates a 9-period Simple Moving Average (SMA 9).
Candles are colored based on price position:
Green → price above SMA (bullish trend)
Red → price below SMA (bearish trend)
👉 This acts as a basic trend filter.
⚡ 2. SMA 9 Cross Alerts
Generates signals when price:
Crosses above SMA 9 → potential bullish signal
Crosses below SMA 9 → potential bearish signal
👉 These are fast signals, but can be noisy without confirmation.
🧱 3. Market Structure (Pivots + Trendlines)
Detects:
Swing highs (pivot highs)
Swing lows (pivot lows)
Connects them to form:
Downtrend lines (high → high)
Uptrend lines (low → low)
Optionally draws parallel channels
👉 This represents market structure / price action geometry.
💥 4. Breakout Detection
Checks whether price breaks:
Above a trendline → bullish breakout
Below a trendline → bearish breakout
👉 Used for trend continuation or reversal signals.
📊 5. RSI Momentum Logic
Uses RSI (14) to detect:
Overbought → potential bearish reversal
Oversold → potential bullish reversal
👉 Mainly used for exit signals or momentum filtering.
🧬 6. EMA + SMA 200 (Higher-Timeframe Bias)
Includes:
EMA (short-term trend)
SMA 200 (long-term trend)
Generates signals when they cross.
👉 This acts as a macro trend filter.
🟩 7. Fair Value Gaps (FVG – SMC Core)
Detects inefficiencies between candles:
Bullish FVG → potential support zone
Bearish FVG → potential resistance zone
Tracks:
Creation of FVGs
Mitigation (when price fills the gap)
👉 This is the Smart Money / liquidity component of the script.
🚨 8. Alert System
The script includes alerts for:
SMA crosses
Trendline breakouts
RSI signals
EMA/SMA cross signals
FVG creation and mitigation
👉 However, each alert works independently, without a unified decision system.
🧩 What the Script Does Overall
It combines four key layers of analysis:
1. Trend
SMA 9
SMA 200
2. Momentum
RSI
3. Structure
Pivot-based trendlines
4. Liquidity
Fair Value Gaps (FVG)
⚠️ Key Limitation
The script produces many individual signals, but:
It does not prioritize them
It does not combine them
It does not generate a single high-quality trade decision
👉 In other words:
It’s a signal generator, not a decision engine.
The script calculates a 9-period Simple Moving Average (SMA 9).
Candles are colored based on price position:
Green → price above SMA (bullish trend)
Red → price below SMA (bearish trend)
👉 This acts as a basic trend filter.
⚡ 2. SMA 9 Cross Alerts
Generates signals when price:
Crosses above SMA 9 → potential bullish signal
Crosses below SMA 9 → potential bearish signal
👉 These are fast signals, but can be noisy without confirmation.
🧱 3. Market Structure (Pivots + Trendlines)
Detects:
Swing highs (pivot highs)
Swing lows (pivot lows)
Connects them to form:
Downtrend lines (high → high)
Uptrend lines (low → low)
Optionally draws parallel channels
👉 This represents market structure / price action geometry.
💥 4. Breakout Detection
Checks whether price breaks:
Above a trendline → bullish breakout
Below a trendline → bearish breakout
👉 Used for trend continuation or reversal signals.
📊 5. RSI Momentum Logic
Uses RSI (14) to detect:
Overbought → potential bearish reversal
Oversold → potential bullish reversal
👉 Mainly used for exit signals or momentum filtering.
🧬 6. EMA + SMA 200 (Higher-Timeframe Bias)
Includes:
EMA (short-term trend)
SMA 200 (long-term trend)
Generates signals when they cross.
👉 This acts as a macro trend filter.
🟩 7. Fair Value Gaps (FVG – SMC Core)
Detects inefficiencies between candles:
Bullish FVG → potential support zone
Bearish FVG → potential resistance zone
Tracks:
Creation of FVGs
Mitigation (when price fills the gap)
👉 This is the Smart Money / liquidity component of the script.
🚨 8. Alert System
The script includes alerts for:
SMA crosses
Trendline breakouts
RSI signals
EMA/SMA cross signals
FVG creation and mitigation
👉 However, each alert works independently, without a unified decision system.
🧩 What the Script Does Overall
It combines four key layers of analysis:
1. Trend
SMA 9
SMA 200
2. Momentum
RSI
3. Structure
Pivot-based trendlines
4. Liquidity
Fair Value Gaps (FVG)
⚠️ Key Limitation
The script produces many individual signals, but:
It does not prioritize them
It does not combine them
It does not generate a single high-quality trade decision
👉 In other words:
It’s a signal generator, not a decision engine.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.