PROTECTED SOURCE SCRIPT
SMC Trend Filter Strategy (EMA50/EMA200 + FVG)

Overview
This strategy implements a multi-timeframe Smart Money Concept (SMC) trading system designed for intraday and swing trading.
It combines a Daily trend filter, Break of Structure (BOS) detection, Order Block (OB) zones, Fair Value Gap (FVG) confirmation, and an ATR-based trailing stop system to achieve structured and rule-based entries.
The strategy is fully automated for backtesting and allows users to evaluate SMC concepts without repainting or discretionary interpretation.
- Core Components
1. Higher-Timeframe Trend Filter (Daily EMA50/EMA200)
The strategy retrieves D1 data and determines market direction using EMA50 and EMA200:
Uptrend → EMA50 > EMA200
Downtrend → EMA50 < EMA200
Trades are only taken in the direction of the Daily trend to avoid counter-trend setups.
2. Market Structure & Break of Structure (BOS)
The strategy identifies swing highs/lows and detects when price breaks beyond them:
Bullish BOS: price closes above previous swing high
Bearish BOS: price closes below previous swing low
This forms the foundation of SMC market structure recognition.
3. Order Block Zone (OB)
Upon detecting a BOS, the strategy marks the previous candle as a potential Order Block:
For bullish BOS → OB = previous candle’s high/low
For bearish BOS → OB = previous candle’s high/low
The OB zone is visualized using a semi-transparent box extended forward
This strategy implements a multi-timeframe Smart Money Concept (SMC) trading system designed for intraday and swing trading.
It combines a Daily trend filter, Break of Structure (BOS) detection, Order Block (OB) zones, Fair Value Gap (FVG) confirmation, and an ATR-based trailing stop system to achieve structured and rule-based entries.
The strategy is fully automated for backtesting and allows users to evaluate SMC concepts without repainting or discretionary interpretation.
- Core Components
1. Higher-Timeframe Trend Filter (Daily EMA50/EMA200)
The strategy retrieves D1 data and determines market direction using EMA50 and EMA200:
Uptrend → EMA50 > EMA200
Downtrend → EMA50 < EMA200
Trades are only taken in the direction of the Daily trend to avoid counter-trend setups.
2. Market Structure & Break of Structure (BOS)
The strategy identifies swing highs/lows and detects when price breaks beyond them:
Bullish BOS: price closes above previous swing high
Bearish BOS: price closes below previous swing low
This forms the foundation of SMC market structure recognition.
3. Order Block Zone (OB)
Upon detecting a BOS, the strategy marks the previous candle as a potential Order Block:
For bullish BOS → OB = previous candle’s high/low
For bearish BOS → OB = previous candle’s high/low
The OB zone is visualized using a semi-transparent box extended forward
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.