Thursday, June 18, 2026

smc concept order block filter using ATR to filter volatile order block 如何设计思路

 在SMC(Smart Money Concepts,智慧资金理念)交易中,为了过滤掉市场波动剧烈(如受突发新闻或极端行情影响)时产生的“无效”或“高风险”Order Block(订单块 / OB),结合ATR(Average True Range,真实波幅均值)进行过滤是一种非常严谨的量化思路。

以下是具体的设计思路与实施步骤:

一、 核心逻辑:为什么要过滤“高波动OB”?
在SMC理论中,最优质的OB通常伴随着“蓄势(盘整)- 爆发(强势突破/大阳/大阴)”的结构。 [1]
  • 低波动/正常波动OB:代表机构正在有序进场、吃掉流动性并建立头寸。
  • 高波动/极端波动OB:通常出现在经济数据公布(如CPI、非农)时。这种K线实体极大、影线极长,代表多空双方失去平衡,机构的真实成本区间很难界定,后续作为支撑阻力的成功率较低,容易被击穿(诱多或诱空)。
二、 ATR 过滤 OB 的设计维度
我们可以从以下三个核心维度来设计ATR过滤器:
1. 实体大小过滤(剔除过度扩张的K线)
思路:正常的OB起源于强势突破,但过大的烛体代表波动率过载。
  • 算法设计:计算当前OB起源K线(Trigger Candle)的实体高度,并与当下的ATR(如取14周期)进行对比。
  • 规则:如果 K线实体高度 > N 倍的 ATR(例如 N=2.5 或 3),则判定该OB过于剧烈、波动异常,直接废弃。 [1]
2. 动态止损与防线设置(过滤盈亏比过差的OB)
思路:波动剧烈的OB意味着入场止损空间(SL)会非常大。过大的止损会导致交易的盈亏比(Risk/Reward)急剧恶化。 [1, 2]
  • 算法设计:测量OB顶部到底部的空间(即OB区块的大小)。
  • 规则:计算 OB块高度 / 当前ATR。如果该比值大于某个阈值(说明区块太厚,止损成本过高),则放弃此OB。结合ATR的动态止损,通常设置在 1.5 ~ 2 倍ATR以保障安全。 [1, 2, 3]
3. 区间震荡过滤(剔除无趋势的随机波动)
思路:OB必须依赖于整体的市场结构趋势(如 pro-trend)。为了避免震荡市中ATR放大导致的假信号,需将ATR与市场方向结合。 [1]
  • 规则:只有当当前价格行为处于顺势趋势中(结合EMA200等),且OB前期的回调波动在合理ATR范围内时,才进行交易。 [1]

三、 完整的量化交易工作流 (以做多/Bullish OB为例)
我们可以把ATR过滤器整合为这套SMC执行流程:
  1. 宏观趋势确认:判断当前时间周期(如H4或M15)处于上涨结构,出现明确的BOS(破位)。 [1]
  2. OB形态初筛:寻找上行突破前的最后一根或多根阴线作为潜在的Bullish OB。 [1]
  3. ATR 质量核验
    • 测量该阴线的实体高度。
    • 条件1:实体高度必须合理,未超过近期ATR的上限(规避假突破大阴线)。
    • 条件2:该OB下方存在明显的流动性清扫(Sweep)和Imbalance(失衡/FVG)。 [1, 2, 3]
  4. 触发进场:当价格回调至此 OB 区域时,触发进场信号。 [1]
  5. ATR 动态风控:止损点放置在 OB 最低点下方 1.5倍ATR 处。 [1, 2]

四、 代码/策略伪代码框架
如果您正在使用 TradingView (Pine Script) 或其他量化软件进行开发,逻辑大致如下:
text
// 计算ATR和OB
atr_val = ta.atr(14)
ob_candle_size = high - low  // 或者用 close - open 测算实体

// 定义过度波动率阈值
volatility_threshold = atr_val * 2.5

// 如果当前OB的K线大小超过了阈值,或者震幅太大,则过滤掉
if ob_candle_size > volatility_threshold
    valid_ob = false
else
    valid_ob = true

// SMC 结构事件匹配...
if structure_broken == bullish and valid_ob
    // 标记为高概率可交易OB
    draw_ob_zone()
Use code with caution.

五、 进阶补充:结合成交量(Volume)过滤
ATR 衡量的是价格变化幅度,而量价结合是SMC的精髓。建议将 ATR 结合Volume Delta(成交量差)共同使用。 [1]
  • 极端高ATR的K线,如果伴随着异常缩量,代表这是市场恐慌或流动性枯竭导致的虚假波动,绝对过滤
  • 极端高ATR的K线,如果伴随着巨量爆发,说明机构资金强势介入,这时的OB尽管ATR很大,但在回踩时由于机构未完全出局,依然具备防守价值。 [1]
为了让你更直观地理解如何挑选这些高胜率的结构,以下视频详细讲解了如何通过区分强势与弱势订单块来排除不良交易:
对于如何有效区分高胜率订单块与容易失败的‘陷阱’订单块:

UI for ASP.NET AJAX ASP.NET AJAX PivotGrid

  • Advanced ASP.NET AJAX PivotGrid control for rich data visualization and multi-dimensional data analysis with OLAP & KPIs support, scrolling, sorting, filtering and paging.
  • Part of the Telerik UI for ASP.NET AJAX library along with 120+ professionally designed UI components.
  • Includes support, documentation, demos, virtual classrooms and more!

 

Data Binding

Use any declarative data source control (AccessDataSource, SqlDataSource, LinqDataSource, EntityDataSource, ObjectDataSource, XmlDataSource), or bind the Excel-like pivot table for ASP.NET to your custom objects on the fly. You can also bind RadPivotGrid programmatically by leveraging the NeedDataSource event fired only when the control needs to get fresh data instead of upon every postback. In addition to data grouping by a simple type, such as string or int, the advanced ASP.NET pivot table control allows you to group data by custom objects.

OLAP and KPIs Support

Bind Telerik ASP.NET Pivot Grid control to OLAP data sources through the XMLA and ADOMD.NET data providers to easily display, sort, page and filter data and KPIs from your Cube. The accompanying hierarchical Field List is fully optimized to load the entire structure of the bound OLAP data source on demand.

Easy End-User Configuration via Fields List and Field Zones

With RadPivotGrid for ASP.NET AJAX you enable users to see data from different perspectives by filtering, sorting, showing or hiding certain information or changing the row, column and filter fields. They can achieve this via:

  • The context menus on the field zones
  • Drag and drop between the different field zones
  • The Excel-like Field List which also enables them to add new fields to the report


Filtering and Displaying Top Values

Use a single property to enable powerful filtering mechanism in RadPivotGrid and enable your end users to filter pivoted and OLAP data like in Excel. They can choose to filter by a label, value or to use the report filter and visually hide some fields from the report, while still being able to filter by it. The value filter “Top” allows your users to look at just the best or worst values and concentrate only on the most important for them information.

  • Sorting

    Leverage the built-in sorting of RadPivotGrid to allow end users to sort the Row and Column data in an ascending or descending manner.
  • Scrolling

    In case RadPivotGrid displays more information than you can fit in the page design, it takes the setting of one property for you to enable scrolling with frozen header rows. Don’t worry this will harm the performance of your application, because we have designed the rendering of the Pivot Table to be light and fast.
  • Paging

    Enable RadPivotGrid pagination for it to load only a portion of the data at once, for better performance. Define the page size and pager position which will best suit your end user experience. Choose between the built-in numeric, previous and next, slider or more advanced paging modes.


    • Export to Microsoft Excel

      Users can export the content of the Pivot Grid to an XLS file supported in all versions of Microsoft Excel starting from 2003. Allow them to export the whole content of the pivot or just the content of the current page. Use the infrastructure to provide supplementary information to your users in additional sheets of the exported file.
    • Range Grouping for Customizable Level of Detail

      If the report displays certain information by day, but the user is interested in seeing the data for the whole month or quarter, the range grouping will allow them to achieve this with just a couple of clicks. The Telerik Pivot Table Component for ASP.NET AJAX supports three types of grouping by ranges: DateTime, numeric and custom. This means you can choose time spans: Year, Quarter, Month, Day; numeric ranges 0-100, 100-200, 200-300 etc.; or flexible implementation in a custom way.
      • Aggregate Functions and Positions

        Quickly select or change the aggregate functions you use for your data. Choose between sum, average, count, max, min, or something more complicated like standard deviation, variance, or product. All of this is done in the easiest possible manner – just one line of code or a couple of clicks with the Field List. In addition, you may also change the position of the row and column totals - top, bottom, right, left, or none.
      • Totals Calculations

        Enable calculations to allow users to further analyze the aggregated data by comparing cells to each other. For each cell they will be able to compute the percentage of the GrandTotal, compute the difference from its previous or next one, calculate its weighted average, etc., thus discovering its relative importance.

      • Layouts

        Depending on the requirements for your application, you can choose between three of the most widely used pivot report layouts: Tabular, Outline and Compact.
      • Hierarchical Data Display

        Allow your users to choose the details with which they want to examine data. Group multiple row or column fields to allow users to expand and collapse the parent groups and achieve the desired detail level.


      • Conditional Formatting

        Want to have green fields indicate positive numbers and red negative numbers? RadPivotGrid for ASP.NET AJAX can easily be designed to display styles depending on the values of the cells.

        • Tooltips

          Use the RadPivotGrid tooltips to display additional information for the cells, such as their value and associated aggregate, row, and column. You can also set your own tooltips or simply disable them. The structure of the data in the tooltips follows the pattern used in Microsoft Excel.
        • Templates

          If you need to define your own templates instead of using the built-in cell elements of the Telerik ASP.NET PivotGrid, you can easily define exactly what to be displayed in a certain cell. The control has12 different cell templates allowing you to customize each of its parts and even place other controls into the different types of cells.

        • Rich Server-Side and Client-Side API for Maximum Flexibility

          Take advantage of the public methods, properties, and events found within our ASP.NET OLAP control in order to implement advanced and specific scenarios, such as integrating it with a Chart or Map control. Almost all user actions raise an event which provides all the arguments you need, both on the client and the server.

          • Performance

            To make sure RadPivotGrid performs well, we:

            • Optimize its server code following best coding practices
            • Minimize the HTML, CSS and JS for smaller traffic and faster loading
            • Keep as few values in the ViewState as possible
            • Execute only the mission-critical JavaScript to initialize the client objects
            • Provide you with free CDN support to deliver content faster to your users
          • Accessibility and Internationalization

            The Telerik PivotGrid control was built for compliance with major accessibility standards, such as W3C Web Content Accessibility Guidelines 1.0/2.0 and Section 508 of the Rehabilitation Act. Leverage the built-in WAI-ARIA support by changing a single property to have the pivot grid render appropriate WAI-ARIA roles. For international applications, use global or local resources to completely localize the control.
          • Visual Studio Integration and Design-time Support

            Install Telerik UI for ASP.NET AJAX, the suite containing RadPivotGrid, to get the control available in your Visual Studio Toolbox. Drag and drop it onto the design surface and use the SmartTag, the Properties Window or the rich Design-Time wizards to codelessly configure the PivotGrid and make it fully functional.
          • Easy to AJAX-Enable

            RadPivotGrid for ASP.NET AJAX was built from the ground up to work in AJAX-enabled web sites and you can easily ajaxify it using ASP:UpdatePanel, RadAjax or other ajax controls extending the Microsoft AJAX Framework.
          • Built-In Skins

            Use a single property to apply any of the 20 ready-to-use built-in themes, including an innovative mobile skin, to create a consistence look for your apps and save design and front-end development time. You can easily customize our existing skins or create your own with our Visual Style Builder.
          • Mobile Support

            Why should you build a mobile version of your application when the same app can work equally well on mobile and desktop devices? The Telerik ASP.NET PivotGrid makes this possible by handling touch events in the same manner as those triggered by a keyboard or a mouse. In addition, the control comes with a mobile skin especially designed for a better user experience on touch devices.

          • Cross-Browser Support

            When using our ASP.NET Pivot Table in your apps, you can rest assured that it behaves as expected and has a consistent look and feel in all browsers your users may be utilizing.
            Read the full list of supported browsers