OPEN-SOURCE SCRIPT
Aggiornato SMC Structures and FVG [Produced by Wanfeng]

中文简介
SMC 结构综合指标 | FVG 公允价值缺口 + BOS/CHoCH 结构突破 + 趋势防守位 + 区间比例线
指标核心功能
FVG 公允价值缺口
自动识别传统 3 根 K 线标准供需缺口,区分看涨 / 看跌缺口;价格触碰缺口后自动变灰淡化,支持一键收缩被触碰区间,可自定义显示历史缺口数量;不适配跳空大缺口行情。
SMC 结构识别(BOS/CHoCH)
内置回溯周期算法自动判定市场结构:顺势突破 BOS、逆势转换 CHoCH;支持自定义线条颜色、线型、粗细,可限制图表留存历史突破标记数量。
假破待确认虚线
价格试探结构高低但未收盘突破时,自动绘制待确认虚线;区分普通顺势假破、防守位假破两种样式,直观分辨有效突破与诱多 / 诱空假破。
动态趋势防守位
跟随当前市场结构实时切换防守基准:上涨趋势以阶段低点为防守、下跌趋势以阶段高点为防守;出现防守位假破时自动切换至假破极值作为临时防守,加粗实线标注并附带文字标签。
区间比例分割线
基于当前完整结构区间自动计算自定义百分比分割线(默认 50% 中位线),同步适配假破后的区间重构;可显示百分比数值标签,辅助找订单流关键支撑阻力。
参数分组说明
公允价值缺口:控制 FVG 显示、配色、触碰收缩、历史数量
结构突破:结构回溯周期、BOS/CHoCH 线条、当前完整结构轮廓线、假破待确认线
防守位:防守实线配色粗细、防守位假破虚线开关与样式
结构比例线:自定义分割百分比、比例线样式、数值标签开关
使用提示
结构回溯 K 线参数为算法基准,不建议随意修改,修改会破坏防守位判定逻辑;
FVG 仅识别标准 3K 缺口,指数、外汇大幅跳空行情下缺口识别会失真;
突破触发自动警报,BOS 代表顺势延续、CHoCH 代表趋势反转信号;
所有线条、色块透明度、线型、线宽均可自由自定义适配个人图表风格。
English Introduction
SMC Market Structure All-in-One Toolkit | FVG + BOS & CHoCH Breakout + Dynamic Defense Level + Ratio Split Line
Core Features
Fair Value Gap (FVG)
Detect standard 3-bar institutional liquidity gaps (bullish & bearish). FVG boxes turn gray once mitigated, with optional shrink function for touched zones. Adjustable max historical FVG count. Not recommended for large gap/jump markets.
SMC Structure Detection (BOS / CHoCH)
Built-in lookback algorithm to identify institutional market structure: BOS (Break of Structure, trend continuation) & CHoCH (Change of Character, trend reversal). Fully customizable line color, style, width, and limited historical breakout markers to avoid chart clutter.
Pending Fake Breakout Dashed Line
Draw temporary pending lines when price tests swing high/low without close breakout. Separate styles for regular trend fakeouts and defense level fakeouts, easily distinguish valid breaks vs liquidity hunts.
Dynamic Trend Defense Level
Auto-switch defense baseline based on current market bias: swing low for uptrend, swing high for downtrend. Temporarily shift defense level to fakeout extreme when liquidity hunt occurs, with thick solid line and text label.
Range Ratio Split Line
Auto calculate user-defined percentage split level (default 50% midpoint) over active market range, compatible with post-fakeout restructured ranges. Optional percentage value label for key order flow support/resistance zones.
Input Groups
Fair Value Gap: Toggle FVG display, color palette, mitigate shrink, max historical boxes
Market Structure: Structure lookback period, BOS/CHoCH line settings, full swing structure outline, pending fake breakout lines
Defense Level: Solid defense line config, toggle & style for defense fakeout dashed lines
Range Ratio Line: Custom split percentage, ratio line appearance, value label switch
Important Notes
Structure lookback bar count is core algorithm parameter, DO NOT modify arbitrarily; wrong value breaks defense level calculation.
This FVG logic only works for standard 3-bar gaps; performance degrades on assets with massive overnight jumps/gaps.
Built-in alert triggers on confirmed breakouts: BOS = trend continuation signal, CHoCH = trend reversal signal.
Full customization of all line width, color transparency, dash/dot/solid styles to match your chart layout preference.
SMC 结构综合指标 | FVG 公允价值缺口 + BOS/CHoCH 结构突破 + 趋势防守位 + 区间比例线
指标核心功能
FVG 公允价值缺口
自动识别传统 3 根 K 线标准供需缺口,区分看涨 / 看跌缺口;价格触碰缺口后自动变灰淡化,支持一键收缩被触碰区间,可自定义显示历史缺口数量;不适配跳空大缺口行情。
SMC 结构识别(BOS/CHoCH)
内置回溯周期算法自动判定市场结构:顺势突破 BOS、逆势转换 CHoCH;支持自定义线条颜色、线型、粗细,可限制图表留存历史突破标记数量。
假破待确认虚线
价格试探结构高低但未收盘突破时,自动绘制待确认虚线;区分普通顺势假破、防守位假破两种样式,直观分辨有效突破与诱多 / 诱空假破。
动态趋势防守位
跟随当前市场结构实时切换防守基准:上涨趋势以阶段低点为防守、下跌趋势以阶段高点为防守;出现防守位假破时自动切换至假破极值作为临时防守,加粗实线标注并附带文字标签。
区间比例分割线
基于当前完整结构区间自动计算自定义百分比分割线(默认 50% 中位线),同步适配假破后的区间重构;可显示百分比数值标签,辅助找订单流关键支撑阻力。
参数分组说明
公允价值缺口:控制 FVG 显示、配色、触碰收缩、历史数量
结构突破:结构回溯周期、BOS/CHoCH 线条、当前完整结构轮廓线、假破待确认线
防守位:防守实线配色粗细、防守位假破虚线开关与样式
结构比例线:自定义分割百分比、比例线样式、数值标签开关
使用提示
结构回溯 K 线参数为算法基准,不建议随意修改,修改会破坏防守位判定逻辑;
FVG 仅识别标准 3K 缺口,指数、外汇大幅跳空行情下缺口识别会失真;
突破触发自动警报,BOS 代表顺势延续、CHoCH 代表趋势反转信号;
所有线条、色块透明度、线型、线宽均可自由自定义适配个人图表风格。
English Introduction
SMC Market Structure All-in-One Toolkit | FVG + BOS & CHoCH Breakout + Dynamic Defense Level + Ratio Split Line
Core Features
Fair Value Gap (FVG)
Detect standard 3-bar institutional liquidity gaps (bullish & bearish). FVG boxes turn gray once mitigated, with optional shrink function for touched zones. Adjustable max historical FVG count. Not recommended for large gap/jump markets.
SMC Structure Detection (BOS / CHoCH)
Built-in lookback algorithm to identify institutional market structure: BOS (Break of Structure, trend continuation) & CHoCH (Change of Character, trend reversal). Fully customizable line color, style, width, and limited historical breakout markers to avoid chart clutter.
Pending Fake Breakout Dashed Line
Draw temporary pending lines when price tests swing high/low without close breakout. Separate styles for regular trend fakeouts and defense level fakeouts, easily distinguish valid breaks vs liquidity hunts.
Dynamic Trend Defense Level
Auto-switch defense baseline based on current market bias: swing low for uptrend, swing high for downtrend. Temporarily shift defense level to fakeout extreme when liquidity hunt occurs, with thick solid line and text label.
Range Ratio Split Line
Auto calculate user-defined percentage split level (default 50% midpoint) over active market range, compatible with post-fakeout restructured ranges. Optional percentage value label for key order flow support/resistance zones.
Input Groups
Fair Value Gap: Toggle FVG display, color palette, mitigate shrink, max historical boxes
Market Structure: Structure lookback period, BOS/CHoCH line settings, full swing structure outline, pending fake breakout lines
Defense Level: Solid defense line config, toggle & style for defense fakeout dashed lines
Range Ratio Line: Custom split percentage, ratio line appearance, value label switch
Important Notes
Structure lookback bar count is core algorithm parameter, DO NOT modify arbitrarily; wrong value breaks defense level calculation.
This FVG logic only works for standard 3-bar gaps; performance degrades on assets with massive overnight jumps/gaps.
Built-in alert triggers on confirmed breakouts: BOS = trend continuation signal, CHoCH = trend reversal signal.
Full customization of all line width, color transparency, dash/dot/solid styles to match your chart layout preference.
Note di rilascio
中文简介指标全称
SMC 市场结构全套指标(公允价值缺口 FVG+BOS/CHoCH 结构突破 + 动态防守位 + 区间比例线 + 震荡停滞提醒)
核心功能
公允价值缺口 FVG
标准 3K 线供需缺口自动绘制,区分看涨 / 看跌缺口;价格触碰缺口自动变灰,支持收缩被填充区间,可自定义留存历史缺口数量;不适用于大幅跳空品种。
市场结构识别 BOS/CHoCH
内置回溯算法自动识别结构:BOS 顺势延续突破、CHoCH 趋势反转切换;全部线条颜色、线型、粗细自由调节,限制历史标记数量避免图表杂乱。
假破待确认虚线
价格试探高低点但未收盘突破时生成临时虚线,区分普通震荡假破、防守位诱空 / 诱多假破,直观分辨有效突破与流动性猎杀。
动态趋势防守位
自动跟随趋势切换防守基准:上涨取阶段高点防守、下跌取阶段低点防守;出现防守位假破时临时切换至假破极值,加粗实线搭配文字标签。
区间比例分割线
自动计算自定义百分比分割位(默认 50% 中位线),适配假破后重构区间,可开关百分比标签,用于寻找订单流关键支撑阻力。
震荡停滞预警系统(新增)
震荡警告标签:连续无突破达到设定 K 线,K 线上方弹出橙色文字提醒走势停滞;
右下角数据表格:实时查看连续震荡 K 线、警告阈值、停绘阈值、线条绘制状态;
自动停绘机制:长期无新突破后自动清空全部结构线条,减少图表负载,出现突破后自动恢复绘制。
使用注意
结构回溯 K 线为核心计算参数,不建议随意修改,改动会导致防守位判定失效;
FVG 仅适配标准三 K 缺口,隔夜大幅跳空的标的缺口识别会失真;
BOS 警报代表顺势延续信号,CHoCH 警报代表趋势反转信号;
全部色块、线条、文字标签均可自定义配色与样式。
English Introduction
Full Name
All-In-One SMC Market Structure Toolkit (FVG + BOS & CHoCH Breakout + Dynamic Defense Level + Range Ratio Line + Stagnation Reminder)
Core Features
Fair Value Gap (FVG)
Auto draw standard 3-bar institutional liquidity gaps for bullish & bearish. Gaps turn gray once mitigated, optional shrink filled zones, adjustable max historical FVG count. Not suitable for assets with huge overnight price jumps.
SMC Swing Structure (BOS / CHoCH)
Built-in lookback algorithm identifies market structure automatically: BOS for trend continuation, CHoCH for trend reversal. Fully customizable line color, style, width; limit breakout labels to avoid chart clutter.
Fake Breakout Pending Dashed Line
Temporary dashed lines appear when price tests swing high/low without closing breakout. Separate styles for regular range fakeouts and defense level liquidity hunts, easily tell valid breaks from trap moves.
Dynamic Trend Defense Zone
Auto switch defense reference based on market bias: swing high as defense for uptrend, swing low for downtrend. Temporarily shift defense level to fakeout extreme when liquidity hunt occurs, with thick solid line and text label.
Custom Range Ratio Split Line
Auto calculate user-defined percentage level (default 50% midpoint), compatible with restructured range after fake breakout. Toggle percentage labels to spot key order flow support & resistance.
New Stagnation Warning System
Warning label: Orange text above candles pops up when no new breakout hits your set bar limit to alert range consolidation;
Bottom-right stats table: Real-time display of stagnation bars, warning threshold, stop-draw threshold and drawing status;
Auto stop drawing function: Clear all structure lines after long consolidation to reduce chart load, all lines restore automatically once new breakout forms.
Important Notes
Swing lookback bar count is core calculation parameter. Do NOT modify arbitrarily, wrong value breaks defense level logic.
FVG logic only works for standard 3-bar gaps, performance fails on instruments with large overnight gaps.
BOS alert = trend continuation signal; CHoCH alert = trend reversal signal.
All boxes, lines and text labels support fully customized color and visual style.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.