OPEN-SOURCE SCRIPT
TMB Invest - Smart Money Concept Strategy

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.
**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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.