English:
**Quick Overview**
The "TMB_SMC_Strategy_v1.1.3" combines a classic trend filter using two EMAs with contrarian RSI entries and simple SMC elements (Fair Value Gaps & Order Blocks). Stop-loss and take-profit orders are volatility-adaptive and controlled via the ATR. An integrated dashboard displays the setup status, stop-loss/take-profit levels, entry reference, and trend, RSI, and ATR values.
---
## Operating Principle
1. **Trend Filter:** A fast EMA (default 50) is compared to a slow EMA (default 200). Trading occurs only in the direction of the trend: long in uptrends, short in downtrends.
2. **Timing via RSI:** Contrarian entries within the trend. Go long when the RSI is below a buy level (default 40); Short when the RSI is above a sell level (standard 60).
3. **Structure Check (SMC Proxy):** An "FVG Touch" serves as additional confirmation that an inefficient price zone has been tested. Order blocks are visualized for guidance but are not a direct entry trigger.
4. **Risk Management via ATR:** Stop-loss and take-profit levels are set as multipliers of the current ATR (e.g., SL = 1×ATR, TP = 2×ATR). This allows target and risk distances to adjust to market volatility.
5. **Simple Position Logic:** Only one position is held at a time (no pyramiding). After entry, stop and limit orders (bracket exit) are automatically placed.
---
## Input Values
* **EMA Fast / EMA Slow:** Lengths of the moving averages for the trend filter.
* **RSI Length / Levels:** Length of the RSI as well as buy and sell thresholds (contra signals within the trend direction).
* **Take Profit (RR) / Stop Loss (RR):** ATR multipliers for TP and SL.
* **Show FVGs & Order Blocks:** Toggles the visual SMC elements (zones/boxes) on or off.
--
## Signals & Execution
* **Long Setup:** Uptrend (fast EMA above slow EMA) **and** RSI below the buy level **and** a current FVG signal in a bullish direction.
* **Short Setup:** Downtrend (fast EMA below slow EMA) **and** RSI above the sell level **and** a current FVG touch in a bearish direction.
* **Entry & Exit:** If the setup is met, the market is entered; stop-loss/take-profit orders are placed immediately according to ATR multiples.
--
## Visualization
* **EMAs:** The fast and slow EMAs are plotted to illustrate the trend.
* **FVGs:** Fair Value Gaps are drawn as semi-transparent boxes in the trend color and projected slightly into the future.
* **Order Blocks:** Potential order block zones from the previous candle are visually highlighted (for informational purposes only).
---
## Integrated Dashboard
A compact table dashboard (bottom left) displays:
* Current **Setup Status** (Long/Short active, Long/Short ready, No Setup),
* **Stop-Loss**, **Take-Profit**, and **Entry Reference**,
* **Trend Status** (Bull/Bear/Sideways),
* **RSI Value**, and **ATR Value**.
Active long/short positions are highlighted in color (green/red).
--
## Practical Guide
1. **Place on Chart** and select the desired timeframe.
2. **Calibrate Parameters** (EMA lengths, RSI levels, ATR multipliers) to match the market and timeframe.
3. **Backtest** across different market phases; prioritize robustness over maximum curve fit.
4. **Fine-Tuning:**
* Shorter EMAs are often useful intraday (e.g., 20/100 or 34/144).
* Adjust RSI levels to market characteristics (45/55 for aggressive trading, 30/70 for conservative trading).
* Increase or decrease ATR multipliers depending on volatility/trading style.
--
## Notes, Limitations & Extensions
* **FVG Definition:** The FVG detection used here is intentionally simplified. Those who prefer a more rigorous approach can switch to a 3-candle definition and fill levels.
* **Order Blocks:** These primarily serve as a guide. Integration into entry/exit logic (e.g., retests) is possible as an extension.
* **Backtest Realism:** Fills may differ from the displayed closing price. For greater accuracy, intrabar backtests or an entry indicator based on the average position price are conceivable.
* **Alerts:** Currently, no alert conditions are defined; these can be added for long/short setups and status messages.
* **Position Management:** By default, no scaling is performed. Partial sales, trailing stops, or multiple entries can be added.
---
## Purpose & Benefits
The strategy offers a clear, modular framework: trend filter (direction), RSI contra timing (entry), SMC proxy via FVG Touch (structure), and ATR-based exits (risk adaptation). This makes it robust, easy to understand, and highly extensible—both for discretionary traders who appreciate visual SMC elements and for systematic testers who prefer a clean, parameterizable foundation.
![]()
//@version=6
strategy("TMB_SMC_Strategie_v1.1.3", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === Inputs ===
emaFastLength = input.int(50, "EMA Fast", minval=1)
emaSlowLength = input.int(200, "EMA Slow", minval=1)
rsiLength = input.int(14, "RSI Länge", minval=1)
rsiOversold = input.int(40, "RSI Buy-Level (Long)", minval=1)
rsiOverbought = input.int(60, "RSI Sell-Level (Short)", minval=1)
takeProfitRR = input.float(2.0, "Take Profit (RR)", step=0.1)
stopLossRR = input.float(1.0, "Stop Loss (RR)", step=0.1)
showFVGs = input.bool(true, "FVGs anzeigen")
showOrderBlocks = input.bool(true, "Orderblocks anzeigen")
// === Indikatoren
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(14)
// === FVGs (robustere Bedingungen)
if showFVGs
isBullFVG = low[1] > high[0]
if isBullFVG
box.new(left=bar_index - 1, right=bar_index + 3, top=low[1], bottom=high[0], border_color=color.green, bgcolor=color.new(color.green, 85))
isBearFVG = high[1] < low[0]
if isBearFVG
box.new(left=bar_index - 1, right=bar_index + 3, top=low[0], bottom=high[1], border_color=color.red, bgcolor=color.new(color.red, 85))
// === Orderblocks (robuster)
if showOrderBlocks
// Bearish OB: bullische Kerze gefolgt von starkem Drop
bullOB = close[1] > open[1] and close < open and close < low[1]
if bullOB
box.new(left=bar_index - 1, right=bar_index + 3, top=high[1], bottom=low[1], bgcolor=color.new(color.orange, 85), border_color=color.orange)
// Bullish OB: bärische Kerze gefolgt von starkem Anstieg
bearOB = close[1] < open[1] and close > open and close > high[1]
if bearOB
box.new(left=bar_index - 1, right=bar_index + 3, top=high[1], bottom=low[1], bgcolor=color.new(color.blue, 85), border_color=color.blue)
// === Trend / Setup / Entry
inBullTrend = emaFast > emaSlow
inBearTrend = emaFast < emaSlow
bullFVGTouched = low < high[1] and high > low[1]
bearFVGTouched = high > low[1] and low < high[1]
longCond = inBullTrend and rsi < rsiOversold and bullFVGTouched and (strategy.position_size == 0)
shortCond = inBearTrend and rsi > rsiOverbought and bearFVGTouched and (strategy.position_size == 0)
longSL = close - atr * stopLossRR
longTP = close + atr * takeProfitRR
shortSL = close + atr * stopLossRR
shortTP = close - atr * takeProfitRR
if longCond
strategy.entry("Long", strategy.long)
strategy.exit("TP/SL Long", from_entry="Long", stop=longSL, limit=longTP)
if shortCond
strategy.entry("Short", strategy.short)
strategy.exit("TP/SL Short", from_entry="Short", stop=shortSL, limit=shortTP)
// === EMAs
plot(emaFast, color=color.orange)
plot(emaSlow, color=color.red)
// === Dashboard
var table dash = table.new(position.bottom_left, 1, 7, frame_color=color.gray, frame_width=1, border_width=1)
entryPrice = close
var string dashTrend = ""
var string dashRSI = ""
var string dashATR = ""
var string dashSetup = ""
var string dashSL = ""
var string dashTP = ""
var string dashEntry = ""
var color dashBG = color.gray
if bar_index > 0
dashTrend := emaFast > emaSlow ? "📈 Bull-Trend (EMA)" : emaFast < emaSlow ? "📉 Bear-Trend (EMA)" : "🔁 Seitwärts"
dashRSI := "RSI: " + str.tostring(rsi, format.mintick)
dashATR := "ATR: " + str.tostring(atr, format.mintick)
if strategy.position_size != 0
dirLong = strategy.position_size > 0
dashSetup := dirLong ? "🟢 LONG Position aktiv" : "🔴 SHORT Position aktiv"
dashSL := "SL: " + str.tostring(dirLong ? longSL : shortSL, format.mintick)
dashTP := "TP: " + str.tostring(dirLong ? longTP : shortTP, format.mintick)
dashEntry := "Entry: " + str.tostring(entryPrice, format.mintick)
dashBG := dirLong ? color.new(color.green, 85) : color.new(color.red, 85)
else if longCond
dashSetup := "🟢 LONG Setup bereit"
dashSL := "SL: " + str.tostring(longSL, format.mintick)
dashTP := "TP: " + str.tostring(longTP, format.mintick)
dashEntry := "Entry: " + str.tostring(entryPrice, format.mintick)
dashBG := color.new(color.green, 85)
else if shortCond
dashSetup := "🔴 SHORT Setup bereit"
dashSL := "SL: " + str.tostring(shortSL, format.mintick)
dashTP := "TP: " + str.tostring(shortTP, format.mintick)
dashEntry := "Entry: " + str.tostring(entryPrice, format.mintick)
dashBG := color.new(color.red, 85)
else
dashSetup := "⏸ Kein Setup aktiv"
dashSL := ""
dashTP := ""
dashEntry := ""
dashBG := color.new(color.gray, 85)
table.cell(dash, 0, 0, dashSetup, text_color=color.white, bgcolor=dashBG)
table.cell(dash, 0, 1, dashSL, text_color=color.white, bgcolor=dashBG)
table.cell(dash, 0, 2, dashTP, text_color=color.white, bgcolor=dashBG)
table.cell(dash, 0, 3, dashEntry, text_color=color.white, bgcolor=dashBG)
table.cell(dash, 0, 4, dashTrend, text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(dash, 0, 5, dashRSI, text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(dash, 0, 6, dashATR, text_color=color.white, bgcolor=color.new(color.black, 0))