OPEN-SOURCE SCRIPT
已更新 Adaptive Structure Support & Resistance

Chinese description is provided below. Chinese readers, please scroll down to read.
A structure-based support and resistance framework using confirmed pivots, price clustering, adaptive search ranges, historical reaction analysis and post-break role reversal.
1. What is this indicator?
Adaptive Structure Support & Resistance is a market-structure tool designed to identify the support and resistance areas that are currently most relevant to price.
The purpose of this script is not to display every historical swing high and swing low.
Instead, it attempts to answer a more practical question:
The script therefore treats support and resistance as a multi-stage structural problem.
The complete process is:
This means that the script is not simply:
Pine Script®
followed by two horizontal lines.
Confirmed pivots are only the raw structural observations. Several additional stages are used before a level becomes the displayed support or resistance.
2. Why was this model designed?
Traditional automatic support/resistance tools often face several practical problems.
The model is designed around these problems.
Its goal is therefore not to maximize the number of detected structures, but to reduce historical information into a smaller set of currently relevant structural areas.
3. Where can this indicator be used?
The script is intended for standard price charts where historical swing structure is meaningful.
Typical applications include:
It can be used on different timeframes, but the meaning of the detected structure changes with the timeframe.
For example:
The indicator does not automatically convert a lower-timeframe level into a higher-timeframe level.
The displayed support and resistance always belong to the chart timeframe being analyzed.
4. Core principle: confirmed structural pivots
The first stage identifies confirmed pivot highs and pivot lows.
A pivot requires price bars on both sides of the potential turning point.
Representative logic:
Pine Script®
The important word here is confirmed.
A newly formed high is not immediately considered a structural resistance observation.
A newly formed low is not immediately considered a structural support observation.
The model waits for the configured number of right-side bars before confirming the pivot.
This also means that pivot detection naturally contains confirmation delay.
That delay is part of the methodology rather than an attempt to predict a turning point before it exists.
5. Core principle: price clustering
Multiple pivots occurring around similar prices should not necessarily be treated as unrelated horizontal levels.
For this reason, the script groups nearby pivot observations into price clusters.
Conceptually:
Pine Script®
If several historical lows occur around approximately the same area, they can contribute to one support structure.
The same process applies to historical highs when building resistance structures.
This changes the interpretation from:
to:
The cluster center is updated using the accumulated structural contribution of its observations rather than simply keeping the first pivot price.
6. Core principle: structural ranking
Not every cluster deserves the same importance.
Each pivot contributes a base structural score that incorporates relative volume participation and recency.
A simplified representation of the calculation is:
Pine Script®
When several pivots belong to the same cluster, their contributions accumulate.
After the candidate clusters have been created, the model evaluates structures within the active search range.
The final ranking also gives a limited preference to structures nearer the current price:
Pine Script®
Proximity is therefore useful, but it is not the entire model.
A level is not selected only because it is the nearest pivot.
7. Relative volume participation
Historical price reactions can contain different levels of market participation.
For each pivot observation, volume is compared with its recent average.
Representative logic:
Pine Script®
Higher relative volume can contribute additional structural weight.
However, volume is only one component.
The model does not assume that high volume by itself automatically creates support or resistance.
8. Historical reaction analysis
A structural level is more informative when historical interactions with that area produced meaningful price responses.
For a support pivot, the model measures the maximum upside response after the confirmed low during a configurable observation window.
Conceptually:
Pine Script®
For resistance, the opposite calculation is used:
Pine Script®
This allows the model to distinguish between two different situations.
These situations are not treated as structurally equivalent.
9. Why the search range is adaptive
One of the main design features of this script is that support and resistance do not have to use the same fixed search distance.
A fixed 25% range can work well for one instrument but fail on another.
A fixed 100% range may capture important historical structures, but can also introduce unnecessarily distant structures when meaningful nearby levels already exist.
The Auto mode therefore uses progressive search tiers.
The algorithm first asks whether the nearest tier contains a structure that satisfies minimum structural requirements.
If it does, the search can stop.
If it does not, the model expands to the next tier.
Representative logic:
Pine Script®
The important feature is that support and resistance are evaluated independently.
For example:
This can occur when a meaningful support structure exists close below price, while the next meaningful resistance structure is much farther above the market.
10. The model does not stop at the first nearby pivot
Adaptive search would not be useful if any small nearby pivot could immediately stop expansion.
The model therefore requires a nearby structure to satisfy minimum quality conditions.
Conceptually:
Pine Script®
Only a qualified structure can stop the search from expanding to the next distance tier.
This prevents a minor local pivot from automatically hiding a larger and more meaningful historical structure.
11. Volatility-aware search adjustment
Volatility also affects how much evidence is required from nearby structures.
ATR is converted into a percentage of price:
Pine Script®
When volatility is high, the minimum structural-quality requirement is increased moderately.
Representative logic:
Pine Script®
The purpose is not simply:
Instead:
This distinction is important.
Volatility assists the structural search; it does not independently determine support or resistance.
12. Structural quality used by adaptive search
To decide whether search expansion can stop, a separate quality model evaluates candidate clusters.
The quality assessment combines several components:
A simplified representation is:
Pine Script®
The result is bounded to a 0–100 scale.
Pine Script®
This quality score primarily answers:
It is separate from the final displayed strength score.
13. Selecting the final support and resistance
After the adaptive search distance has been determined, the model evaluates all valid clusters inside that range.
For support:
For resistance, the same process is applied above current price.
The highest-ranked candidate becomes the primary structural level.
This means that the displayed level represents the outcome of:
rather than simply selecting the latest high or low.
14. Strength score: what does 0–100 mean?
After the primary support and resistance levels are selected, the model performs a second evaluation.
This stage describes the historical quality of the selected structure.
The strength score considers:
The positive components are conceptually:
Pine Script®
Repeated crossings reduce the score:
Pine Script®
The final value is limited to 0–100.
The interface converts it into:
The score should not be interpreted as:
It does not represent probability, expected return or strategy win rate.
It is a normalized description of historical structural behavior.
15. Why repeated crossings reduce strength
A price level may appear frequently in historical data simply because the market traded through it many times.
That does not necessarily make the level stronger.
A structurally useful support or resistance area usually produces some degree of rejection, recovery or directional response.
For this reason, the script counts repeated close-to-close crossings.
Representative logic:
Pine Script®
Frequent crossings therefore reduce structural strength instead of increasing it automatically.
16. Why support and resistance are displayed as zones
Real market structure rarely operates at one mathematically exact tick.
Several pivots may occur at slightly different prices while still representing the same area.
The script therefore displays:
Zone width contains two elements.
First, the actual spread of the clustered pivot prices.
Second, a small volatility-sensitive padding:
Pine Script®
The center line is useful for reference.
The surrounding area is intended to represent the broader price region where structural interaction may occur.
17. Breakout detection uses the previous structure
There is an important implementation detail in breakout detection.
When price breaks resistance, the current resistance calculation may immediately change because current price itself has changed.
If breakout detection used only the newly recalculated structure, the model could lose the level that price actually broke.
The script therefore references the previously confirmed zone:
Pine Script®
The same principle applies to support breakdowns.
This allows the structural state machine to remember the actual area involved in the break.
18. Resistance does not immediately become support
A confirmed break starts a new structural state.
The model uses named states internally:
Pine Script®
After resistance is broken:
Representative confirmation logic:
Pine Script®
Only after this process can the old resistance be promoted to support.
19. Support-to-resistance uses the opposite process
After support is broken:
Representative logic:
Pine Script®
This creates a distinction between:
and:
20. Failed breakout and failed breakdown
The script also monitors invalidation after a break.
If resistance is broken but price quickly returns below the former resistance structure, the event can be treated as a failed breakout.
If support is broken but price quickly recovers the former support structure, the event can be treated as a failed breakdown.
These events reset the pending role-reversal process rather than automatically promoting the old structure to a new role.
21. How to use the indicator
A simple workflow is:
22. Practical interpretation
The indicator is designed primarily as a context tool.
For example:
Likewise:
A trader can then combine that context with his or her own analysis of:
The script itself does not generate automatic buy or sell orders.
23. Dashboard explanation
The dashboard intentionally avoids exposing every internal statistical variable.
Instead, it translates the model into simpler trading language.
Support
Current selected support level and its strength evaluation.
Why this level?
Shows how many historical structural interactions contributed to the area and the average subsequent upside response.
Resistance
Current selected resistance level and strength evaluation.
Why this level?
Shows historical interactions and the average subsequent downside response.
How far it searched
Shows the active adaptive search range below and above the current market.
Current state
Explains whether price remains between the structures, has broken one of them, is waiting for confirmation, or has completed a role reversal.
24. Main settings
Lookback Bars
Controls how much historical price data is considered when constructing structural clusters.
A longer lookback includes more historical structure but may also retain older information.
Pivot Left Bars / Pivot Right Bars
Control how strict pivot confirmation is.
Larger values generally identify larger structural turns but require more confirmation.
Price Cluster Width %
Controls how close two pivot observations must be before they can belong to the same structural area.
Search Mode
Auto allows support and resistance to determine their own search distances.
Manual uses a fixed maximum distance.
Maximum Auto Range
Defines the maximum distance the adaptive search is allowed to inspect.
Minimum Structure Quality
Controls how meaningful a structure must be before it can stop automatic search expansion.
Minimum Valid Tests
Defines the minimum number of structural observations required for a candidate to qualify during adaptive search.
Reaction Observation Bars
Defines how many bars after a historical pivot are examined when measuring its subsequent price reaction.
Break Confirmation Buffer
Adds a small margin beyond the old structural zone before a break is considered confirmed.
Retest Tolerance
Controls how close price must return to the former structural area during retest/rebound evaluation.
25. Alerts
Alert conditions are provided for:
When close confirmation is enabled, structural break events are evaluated on confirmed bars.
26. About repainting and structural updates
This script should not be interpreted as a system that predicts pivots before they are confirmed.
Pivot highs and lows require right-side confirmation bars.
Therefore:
Once new market data arrives, the active support and resistance can still change for legitimate structural reasons.
Examples include:
This is dynamic structural recalculation, not a promise that current support and resistance will remain fixed forever.
27. Why these components belong together
This script combines several concepts, but they are not independent indicators placed together for convenience.
Each component solves a different stage of the same problem.
28. What is distinctive about this implementation?
The primary design characteristics of this implementation are:
29. Limitations
No support/resistance algorithm can know with certainty whether a level will hold or fail.
Important limitations include:
30. Final note
This script is intended for market-structure analysis and educational use. It does not constitute investment advice, a recommendation, or a guarantee of future market performance.
────────────────────────────────────
中文说明
1. 这个指标是什么?
Adaptive Structure Support & Resistance 是一个基于市场历史结构,自动寻找当前价格上下方关键支撑与压力区域的分析工具。
它解决的并不是:
而是试图解决一个更实际的问题:
所以,这个指标不是简单地把每一个 Pivot High 和 Pivot Low 都画成水平线。
完整计算过程包括:
因此,Pivot 只是整个模型的第一步,而不是最终结果。
2. 为什么要做这套模型?
传统的自动支撑压力工具经常存在几个问题。
所以这套模型的设计目标不是“尽量多找线”。
而是:
3. 可以用在哪里?
只要历史价格结构具有一定参考意义,理论上都可以使用,例如:
不同周期看到的是不同级别的结构。
例如:
指标不会把15分钟的支撑自动解释成日线支撑。
所有计算都基于当前图表所使用的周期。
4. 第一步:确认历史结构高低点
模型首先通过已经确认的 Pivot High 与 Pivot Low 获取历史结构观察点。
核心逻辑:
Pine Script®
这里最重要的是“确认”。
一个刚刚形成的高点不会马上成为正式压力结构。
一个刚刚形成的低点也不会马上成为正式支撑结构。
需要等待右侧一定数量的K线完成确认。
所以模型主动接受一定的确认延迟,用来减少把尚未成立的短期极值直接当成重要结构的情况。
5. 第二步:把相近价格合并成一个结构
如果历史上存在:
这三个低点,实际上它们很可能描述的是同一片支撑区域,而不是三条完全独立的支撑线。
所以系统会计算不同 Pivot 之间的价格距离:
Pine Script®
如果距离足够接近,就把它们合并到同一个价格结构中。
这样模型关注的就不再是:
而是:
6. 第三步:给历史结构进行初步排序
并不是所有 Pivot 对结构的重要性都一样。
模型会考虑:
基础贡献大致表现为:
Pine Script®
多个相近 Pivot 被合并后,它们的结构贡献会累积。
最后选择当前结构时,还会给予距离现价较近的位置一定加分:
Pine Script®
但这里需要注意:
7. 成交量在这里做什么?
模型会把 Pivot 当时的成交量与近期平均成交量进行比较。
例如:
Pine Script®
如果某个结构形成时伴随更明显的市场参与,它可以得到额外权重。
但是成交量并不会单独决定支撑压力。
它只是结构评价中的一个辅助信息。
8. 历史触碰以后到底有没有真正反应?
一个位置历史上碰过很多次,并不代表它一定很重要。
关键还要看:
对于历史支撑 Pivot,系统观察之后一定K线范围内出现的最大向上反应。
核心思想:
Pine Script®
对于历史压力,则计算后续最大回落:
Pine Script®
这样能够区别:
9. 为什么搜索距离必须智能调整?
这是这个模型比较重要的一部分。
固定使用25%的搜索范围并不适合所有标的。
固定使用100%,又可能在不必要的情况下把非常遥远的历史结构纳入计算。
所以自动模式采用:
逐级寻找。
核心映射逻辑:
Pine Script®
如果25%以内已经存在合格结构,就可以停止。
如果没有,就扩大到50%。
依次类推。
10. 支撑和压力是分别搜索的
支撑和压力并不会强制使用同一个范围。
完全可能出现:
它表达的意思是:
下方距离现价比较近的地方已经存在足够明确的历史支撑结构。
但是上方近距离没有达到要求的压力,所以模型继续向更远的位置寻找。
11. 为什么不是25%以内随便有个Pivot就停止?
如果只要附近出现一个 Pivot 就停止寻找,所谓智能搜索就没有意义。
因此,候选结构必须同时满足最低触碰次数和最低结构质量。
例如:
Pine Script®
这意味着:
如果近端只是一个很弱的小级别价格点,系统仍然可以继续扩大搜索范围。
12. 波动率为什么也参与?
系统使用 ATR 相对于当前价格的比例观察标的自身波动程度。
Pine Script®
高波动股票附近出现小 Pivot 非常正常。
因此,对于高波动标的,系统会适当提高“附近结构足够好”的要求。
例如:
Pine Script®
这里不是:
而是:
13. 智能搜索中的结构质量怎么计算?
用于决定“是否还要继续扩大搜索范围”的结构质量,主要包含:
可以简化理解为:
Pine Script®
最后压缩到0–100:
Pine Script®
这个分数主要解决的是:
14. 最终支撑压力怎么选?
确定搜索范围以后,系统会重新检查范围内所有候选结构。
支撑必须位于现价下方或附近。
压力必须位于现价上方或附近。
最后比较:
选择当前 Rank 更高的结构。
所以最终看到的线经历了:
15. 0–100强度分数到底是什么意思?
当最终支撑压力确定以后,系统会再做一次独立评价。
这一部分不是用来重新选择线,而是告诉你:
主要考虑:
大致计算结构:
Pine Script®
其中反复穿越和失败突破会扣分:
Pine Script®
最后得到0–100,并转化成:
但是一定不要理解成:
它不是胜率,也不是未来预测概率。
它只是对历史结构质量进行标准化后的评分。
16. 为什么反复穿越反而扣分?
有些价格历史上出现很多次,仅仅是因为市场一直在这个位置上下震荡。
如果价格能够非常轻松地不断穿过这个位置,它未必是真正强支撑或强压力。
所以系统统计价格穿越中心结构的情况:
Pine Script®
穿越越频繁,结构稳定性评价越低。
17. 为什么画的是区域,不只是一条线?
真实交易中,很少存在一个价格精确到最小报价单位以后永远有效。
历史多个 Pivot 本身就可能分布在一个小区间里。
所以模型保留:
区域宽度由:
共同决定。
核心思想:
Pine Script®
中心线用于定位。
阴影区域用于表达真实市场中的价格博弈带。
18. 为什么突破使用上一根K线的压力?
这是结构判断里很重要的一点。
当价格突破压力以后,如果马上重新计算当前压力,那么旧压力可能已经被系统替换。
这样反而不知道价格刚刚突破的到底是哪一个结构。
所以突破判断使用突破之前已经存在的压力区域:
Pine Script®
并基于它计算突破标准:
Pine Script®
支撑跌破同理。
19. 突破压力以后为什么不能马上变成支撑?
系统内部使用一个状态机:
Pine Script®
突破压力以后:
回踩逻辑类似:
Pine Script®
20. 支撑转压力同样需要确认
支撑跌破以后:
例如:
Pine Script®
因此模型会区分:
与:
21. 实际怎么使用?
最简单的使用顺序:
22. 应该如何理解支撑压力?
这个指标最适合作为“位置和结构背景工具”。
例如:
同样:
后续仍然可以结合自己的:
共同判断。
23. 右上角面板怎么看?
我刻意没有把所有内部统计数据全部堆在面板上。
面板只保留实际使用中更容易理解的信息。
支撑位置
当前支撑在哪里,以及它的结构强弱。
为什么是它?
告诉你历史触碰次数和触碰以后平均反弹幅度。
压力位置
当前压力在哪里,以及强弱。
为什么是它?
告诉你历史触碰次数和之后平均回落幅度。
算法看了多远
显示支撑和压力分别使用了多大的搜索范围。
现在怎么看
使用大白话告诉你当前市场与撑压之间处于什么结构状态。
24. 常用参数怎么理解?
Lookback Bars / 回看K线数
决定使用多少历史K线寻找结构。
周期越长,可以考虑更久以前的结构,但也可能保留更多较旧的信息。
Pivot Left / Right Bars
决定 Pivot 判断严格程度。
数值越大,一般意味着只识别更明显的结构转折,同时确认速度也会更慢。
Price Cluster Width %
决定两个历史 Pivot 相差多少以内可以被认为属于同一结构。
Search Mode
Auto:自动决定支撑和压力分别要搜索多远。
Manual:手动固定搜索范围。
Maximum Auto Range
智能搜索允许向外扩展到的最大距离。
Minimum Structure Quality
决定附近结构必须达到多高质量,才能让系统停止继续扩大搜索。
Minimum Valid Tests
智能搜索中,一个结构至少需要多少次历史观察才能成为有效候选。
Reaction Observation Bars
计算历史 Pivot 出现以后,向后观察多少根K线的价格反应。
Break Confirmation Buffer
突破原撑压区域以后,需要额外超过多少缓冲才认定为有效突破。
Retest Tolerance
回踩或反抽过程中,允许价格距离原结构存在多大误差。
25. 警报
指标支持以下 Alert:
如果启用了收盘确认,那么对应结构事件会等待K线确认以后判断。
26. 关于重绘和结构变化
这个指标不是提前预测 Pivot 的工具。
Pivot 本身必须等待右侧K线确认。
因此:
但是当前支撑压力未来仍然可能发生变化。
原因包括:
这是动态结构模型正常的重新评价过程。
27. 为什么这些模块必须放在一起?
虽然指标中包含多个计算部分,但它们并不是几个无关指标简单拼接。
每一个部分都负责解决同一个支撑压力问题中的不同阶段。
因此:
28. 这套实现有什么特点?
主要设计特点包括:
29. 使用限制
任何支撑压力算法都无法提前确定某个位置未来一定守住或者一定突破。
需要注意:
30. 最后
本指标仅用于市场结构研究与辅助分析,不构成投资建议、收益承诺或任何形式的买卖推荐。
A structure-based support and resistance framework using confirmed pivots, price clustering, adaptive search ranges, historical reaction analysis and post-break role reversal.
1. What is this indicator?
Adaptive Structure Support & Resistance is a market-structure tool designed to identify the support and resistance areas that are currently most relevant to price.
The purpose of this script is not to display every historical swing high and swing low.
Instead, it attempts to answer a more practical question:
Among all historical turning points, which price areas still have enough structural significance to matter to the current market?
The script therefore treats support and resistance as a multi-stage structural problem.
The complete process is:
- Identify confirmed swing highs and swing lows.
- Merge nearby turning points into structural price clusters.
- Evaluate the historical importance of each cluster.
- Determine how far above and below the current price the model needs to search.
- Select the most relevant support and resistance structures.
- Evaluate the historical strength of the selected structures.
- Convert exact levels into practical support/resistance zones.
- Track what happens after a confirmed break.
- Require a retest or rebound before confirming a support/resistance role reversal.
This means that the script is not simply:
followed by two horizontal lines.
Confirmed pivots are only the raw structural observations. Several additional stages are used before a level becomes the displayed support or resistance.
2. Why was this model designed?
Traditional automatic support/resistance tools often face several practical problems.
- Too many levels
If every historical pivot is plotted independently, the chart can quickly become filled with horizontal lines. Many of those lines represent nearly identical prices or structures that are no longer relevant. - A single pivot may not represent a meaningful structure
A temporary local high or low can occur for many reasons. A more meaningful market structure often forms when price reacts around the same area multiple times. - Fixed search distances do not work equally well for every instrument
A low-volatility instrument may have meaningful support only 10–20% below the current price.
A highly volatile or strongly trending instrument may require a much wider historical price range before a significant support or resistance structure appears. - The nearest level is not always the most important level
A minor pivot located very close to current price may be less meaningful than a slightly more distant area that has produced several strong historical reactions. - A breakout does not automatically mean role reversal
Resistance does not necessarily become support simply because price trades above it once.
Likewise, support does not necessarily become resistance immediately after one breakdown.
The model is designed around these problems.
Its goal is therefore not to maximize the number of detected structures, but to reduce historical information into a smaller set of currently relevant structural areas.
3. Where can this indicator be used?
The script is intended for standard price charts where historical swing structure is meaningful.
Typical applications include:
- Stocks
- Indices
- ETFs
- Futures
- Foreign exchange
- Cryptocurrency
- Other liquid instruments with usable price history
It can be used on different timeframes, but the meaning of the detected structure changes with the timeframe.
For example:
- A support structure on a 15-minute chart describes short-term intraday structure.
- A support structure on a daily chart describes a larger swing structure.
- A support structure on a weekly chart may represent a long-term structural price area.
The indicator does not automatically convert a lower-timeframe level into a higher-timeframe level.
The displayed support and resistance always belong to the chart timeframe being analyzed.
4. Core principle: confirmed structural pivots
The first stage identifies confirmed pivot highs and pivot lows.
A pivot requires price bars on both sides of the potential turning point.
Representative logic:
The important word here is confirmed.
A newly formed high is not immediately considered a structural resistance observation.
A newly formed low is not immediately considered a structural support observation.
The model waits for the configured number of right-side bars before confirming the pivot.
The intention is to sacrifice some immediacy in exchange for more stable structural observations.
This also means that pivot detection naturally contains confirmation delay.
That delay is part of the methodology rather than an attempt to predict a turning point before it exists.
5. Core principle: price clustering
Multiple pivots occurring around similar prices should not necessarily be treated as unrelated horizontal levels.
For this reason, the script groups nearby pivot observations into price clusters.
Conceptually:
If several historical lows occur around approximately the same area, they can contribute to one support structure.
The same process applies to historical highs when building resistance structures.
This changes the interpretation from:
"Price touched 12.01, 12.05 and 12.09."
to:
"Price has repeatedly reacted around the same structural area."
The cluster center is updated using the accumulated structural contribution of its observations rather than simply keeping the first pivot price.
6. Core principle: structural ranking
Not every cluster deserves the same importance.
Each pivot contributes a base structural score that incorporates relative volume participation and recency.
A simplified representation of the calculation is:
When several pivots belong to the same cluster, their contributions accumulate.
After the candidate clusters have been created, the model evaluates structures within the active search range.
The final ranking also gives a limited preference to structures nearer the current price:
Proximity is therefore useful, but it is not the entire model.
A level is not selected only because it is the nearest pivot.
7. Relative volume participation
Historical price reactions can contain different levels of market participation.
For each pivot observation, volume is compared with its recent average.
Representative logic:
Higher relative volume can contribute additional structural weight.
However, volume is only one component.
The model does not assume that high volume by itself automatically creates support or resistance.
8. Historical reaction analysis
A structural level is more informative when historical interactions with that area produced meaningful price responses.
For a support pivot, the model measures the maximum upside response after the confirmed low during a configurable observation window.
Conceptually:
For resistance, the opposite calculation is used:
This allows the model to distinguish between two different situations.
- A level that price touched repeatedly but barely reacted to.
- A level where historical interaction repeatedly produced meaningful rejection or recovery.
These situations are not treated as structurally equivalent.
9. Why the search range is adaptive
One of the main design features of this script is that support and resistance do not have to use the same fixed search distance.
A fixed 25% range can work well for one instrument but fail on another.
A fixed 100% range may capture important historical structures, but can also introduce unnecessarily distant structures when meaningful nearby levels already exist.
The Auto mode therefore uses progressive search tiers.
- 25%
- 50%
- 75%
- 100%
The algorithm first asks whether the nearest tier contains a structure that satisfies minimum structural requirements.
If it does, the search can stop.
If it does not, the model expands to the next tier.
Representative logic:
The important feature is that support and resistance are evaluated independently.
For example:
Support search range: 25%
Resistance search range: 75%
This can occur when a meaningful support structure exists close below price, while the next meaningful resistance structure is much farther above the market.
10. The model does not stop at the first nearby pivot
Adaptive search would not be useful if any small nearby pivot could immediately stop expansion.
The model therefore requires a nearby structure to satisfy minimum quality conditions.
Conceptually:
Only a qualified structure can stop the search from expanding to the next distance tier.
This prevents a minor local pivot from automatically hiding a larger and more meaningful historical structure.
11. Volatility-aware search adjustment
Volatility also affects how much evidence is required from nearby structures.
ATR is converted into a percentage of price:
When volatility is high, the minimum structural-quality requirement is increased moderately.
Representative logic:
The purpose is not simply:
Higher volatility = wider search range.
Instead:
Higher volatility = minor nearby structures need stronger evidence before they are allowed to stop the search.
This distinction is important.
Volatility assists the structural search; it does not independently determine support or resistance.
12. Structural quality used by adaptive search
To decide whether search expansion can stop, a separate quality model evaluates candidate clusters.
The quality assessment combines several components:
- Number of structural interactions
- Average historical reaction
- Relative volume participation
- Recency
- Accumulated structural contribution
A simplified representation is:
The result is bounded to a 0–100 scale.
This quality score primarily answers:
"Is this structure meaningful enough for the adaptive search to stop here?"
It is separate from the final displayed strength score.
13. Selecting the final support and resistance
After the adaptive search distance has been determined, the model evaluates all valid clusters inside that range.
For support:
- The cluster must be below or near the current price.
- It must remain inside the active support search range.
- Its structural score is combined with a proximity adjustment.
For resistance, the same process is applied above current price.
The highest-ranked candidate becomes the primary structural level.
This means that the displayed level represents the outcome of:
confirmed pivots → clustering → structural scoring → adaptive distance selection → final ranking
rather than simply selecting the latest high or low.
14. Strength score: what does 0–100 mean?
After the primary support and resistance levels are selected, the model performs a second evaluation.
This stage describes the historical quality of the selected structure.
The strength score considers:
- Touch count
- Average reaction after historical interactions
- Relative volume participation
- Recency
- Repeated crossings of the level
- Fast failed breaks
The positive components are conceptually:
Repeated crossings reduce the score:
The final value is limited to 0–100.
The interface converts it into:
- Weak
- Medium
- Strong
The score should not be interpreted as:
82 points = 82% probability that support will hold.
It does not represent probability, expected return or strategy win rate.
It is a normalized description of historical structural behavior.
15. Why repeated crossings reduce strength
A price level may appear frequently in historical data simply because the market traded through it many times.
That does not necessarily make the level stronger.
A structurally useful support or resistance area usually produces some degree of rejection, recovery or directional response.
For this reason, the script counts repeated close-to-close crossings.
Representative logic:
Frequent crossings therefore reduce structural strength instead of increasing it automatically.
16. Why support and resistance are displayed as zones
Real market structure rarely operates at one mathematically exact tick.
Several pivots may occur at slightly different prices while still representing the same area.
The script therefore displays:
- A center structural level
- A surrounding structural zone
Zone width contains two elements.
First, the actual spread of the clustered pivot prices.
Second, a small volatility-sensitive padding:
The center line is useful for reference.
The surrounding area is intended to represent the broader price region where structural interaction may occur.
17. Breakout detection uses the previous structure
There is an important implementation detail in breakout detection.
When price breaks resistance, the current resistance calculation may immediately change because current price itself has changed.
If breakout detection used only the newly recalculated structure, the model could lose the level that price actually broke.
The script therefore references the previously confirmed zone:
The same principle applies to support breakdowns.
This allows the structural state machine to remember the actual area involved in the break.
18. Resistance does not immediately become support
A confirmed break starts a new structural state.
The model uses named states internally:
After resistance is broken:
- The previous resistance area is stored.
- The model enters a "waiting for retest" state.
- Price is monitored for a return toward the old resistance.
- If the retest holds, the former resistance may become support.
- If price falls back through the old zone, the breakout is treated as failed.
Representative confirmation logic:
Only after this process can the old resistance be promoted to support.
19. Support-to-resistance uses the opposite process
After support is broken:
- The previous support area is stored.
- The model waits for a rebound.
- Price must test the former support area.
- If price is rejected and cannot recover the area, the former support can become resistance.
Representative logic:
This creates a distinction between:
price crossed a level
and:
the market actually completed a structural role reversal.
20. Failed breakout and failed breakdown
The script also monitors invalidation after a break.
If resistance is broken but price quickly returns below the former resistance structure, the event can be treated as a failed breakout.
If support is broken but price quickly recovers the former support structure, the event can be treated as a failed breakdown.
These events reset the pending role-reversal process rather than automatically promoting the old structure to a new role.
21. How to use the indicator
A simple workflow is:
- Locate the current support
Identify the support area below the current market.
This is the structural area currently considered most relevant by the model. - Locate the current resistance
Identify the active structural resistance above price. - Read the strength
A stronger score indicates that the selected structure has historically shown better structural characteristics under this model.
It does not mean the level cannot break. - Read "Why this level?"
The dashboard shows the number of historical structural interactions and the average subsequent reaction.
This gives a plain-language explanation for why the level has been selected. - Check how far the algorithm searched
For example:
"Below 25% | Above 75%"
means that qualified support was available relatively close below current price, while the model had to inspect a much wider area to find qualified resistance. - Observe the current structural state
The dashboard may report states such as:
"Price is between support and resistance"
"Resistance broken; waiting for a retest"
"Former resistance is currently acting as support"
"Support broken; waiting for a rebound"
"Former support is currently acting as resistance"
22. Practical interpretation
The indicator is designed primarily as a context tool.
For example:
Price approaching strong support does not automatically mean "buy".
It means price is entering an area that has meaningful structural evidence and may deserve closer observation.
Likewise:
Price approaching resistance does not automatically mean "sell".
It identifies an area where historical supply or rejection has been structurally significant.
A trader can then combine that context with his or her own analysis of:
- Price action
- Volume
- Trend
- Market regime
- Higher-timeframe structure
- Risk/reward
- Position sizing
- Independent fundamental or macro analysis
The script itself does not generate automatic buy or sell orders.
23. Dashboard explanation
The dashboard intentionally avoids exposing every internal statistical variable.
Instead, it translates the model into simpler trading language.
Support
Current selected support level and its strength evaluation.
Why this level?
Shows how many historical structural interactions contributed to the area and the average subsequent upside response.
Resistance
Current selected resistance level and strength evaluation.
Why this level?
Shows historical interactions and the average subsequent downside response.
How far it searched
Shows the active adaptive search range below and above the current market.
Current state
Explains whether price remains between the structures, has broken one of them, is waiting for confirmation, or has completed a role reversal.
24. Main settings
Lookback Bars
Controls how much historical price data is considered when constructing structural clusters.
A longer lookback includes more historical structure but may also retain older information.
Pivot Left Bars / Pivot Right Bars
Control how strict pivot confirmation is.
Larger values generally identify larger structural turns but require more confirmation.
Price Cluster Width %
Controls how close two pivot observations must be before they can belong to the same structural area.
Search Mode
Auto allows support and resistance to determine their own search distances.
Manual uses a fixed maximum distance.
Maximum Auto Range
Defines the maximum distance the adaptive search is allowed to inspect.
Minimum Structure Quality
Controls how meaningful a structure must be before it can stop automatic search expansion.
Minimum Valid Tests
Defines the minimum number of structural observations required for a candidate to qualify during adaptive search.
Reaction Observation Bars
Defines how many bars after a historical pivot are examined when measuring its subsequent price reaction.
Break Confirmation Buffer
Adds a small margin beyond the old structural zone before a break is considered confirmed.
Retest Tolerance
Controls how close price must return to the former structural area during retest/rebound evaluation.
25. Alerts
Alert conditions are provided for:
- Resistance break
- Support break
- Resistance confirmed as support
- Support confirmed as resistance
- Failed breakout
- Failed breakdown
When close confirmation is enabled, structural break events are evaluated on confirmed bars.
26. About repainting and structural updates
This script should not be interpreted as a system that predicts pivots before they are confirmed.
Pivot highs and lows require right-side confirmation bars.
Therefore:
A newly forming pivot is not shown as confirmed structure until sufficient bars exist to confirm it.
Once new market data arrives, the active support and resistance can still change for legitimate structural reasons.
Examples include:
- A new confirmed pivot enters the calculation.
- Several new observations create a stronger price cluster.
- Current price moves enough to change the relevant search region.
- An older observation exits the configured lookback window.
- A breakout creates a role-reversal state.
This is dynamic structural recalculation, not a promise that current support and resistance will remain fixed forever.
27. Why these components belong together
This script combines several concepts, but they are not independent indicators placed together for convenience.
Each component solves a different stage of the same problem.
- Confirmed pivots identify potential structural observations.
- Price clustering converts nearby observations into common price areas.
- Structural ranking determines which areas contain more meaningful historical evidence.
- Adaptive search determines how far the model needs to inspect for an adequate structure.
- Reaction analysis measures how price historically responded to that structure.
- Strength evaluation summarizes the historical quality of the selected area.
- ATR-based zone construction converts an exact center price into a practical market area.
- The role-reversal state machine manages what happens after the structure is broken.
The components are therefore sequential stages of one structural support/resistance framework rather than a mashup of unrelated indicators.
28. What is distinctive about this implementation?
The primary design characteristics of this implementation are:
- Nearby pivots are aggregated into structural price clusters rather than displayed independently.
- Support and resistance use independent adaptive search ranges.
- Search expansion depends on structural quality rather than distance alone.
- Volatility modifies the evidence required from nearby structures.
- Level selection and level-strength evaluation are deliberately separated.
- Repeated crossings and failed breaks can reduce structural strength.
- Support and resistance are represented as price areas instead of exact single-price barriers.
- Break detection references the previous structural zone.
- Role reversal requires confirmation through a state machine instead of occurring immediately after a single crossing.
- The chart intentionally focuses on the current relevant structure rather than filling the chart with historical event markers.
29. Limitations
No support/resistance algorithm can know with certainty whether a level will hold or fail.
Important limitations include:
- Pivot confirmation introduces intentional delay.
- Support and resistance may change as new information becomes available.
- Historical reaction does not guarantee future reaction.
- A high strength score is not a probability of success.
- Very new instruments with limited history may not contain enough structural observations.
- Strong trend transitions can invalidate historical structures quickly.
- Volume-based components depend on the quality and meaning of the instrument's volume data.
- Different timeframes can produce materially different support and resistance structures.
- Synthetic or non-standard chart types may use transformed OHLC values and can therefore produce different structural results.
30. Final note
Support and resistance should be understood as areas of market interaction, not guaranteed turning points.
The purpose of this indicator is to organize historical structure and reduce it into a small number of currently relevant price areas.
It is an analytical framework, not an automatic trading system.
This script is intended for market-structure analysis and educational use. It does not constitute investment advice, a recommendation, or a guarantee of future market performance.
────────────────────────────────────
中文说明
1. 这个指标是什么?
Adaptive Structure Support & Resistance 是一个基于市场历史结构,自动寻找当前价格上下方关键支撑与压力区域的分析工具。
它解决的并不是:
“历史上哪里出现过高点和低点?”
而是试图解决一个更实际的问题:
“历史上这么多高低点里,哪些价格区域到现在仍然具有足够的结构意义,值得当前继续关注?”
所以,这个指标不是简单地把每一个 Pivot High 和 Pivot Low 都画成水平线。
完整计算过程包括:
- 识别已经确认的历史高低结构。
- 把价格相近的多个结构合并成一个价格簇。
- 评价不同价格簇的历史结构意义。
- 分别判断寻找支撑和压力到底需要看多远。
- 从有效搜索范围中选择当前更重要的支撑与压力。
- 评价被选中位置过去的实际价格反应。
- 将精确价格转化为更加符合实际交易的撑压区域。
- 价格突破或跌破以后保存原结构。
- 通过回踩或反抽确认撑压角色是否真正发生转换。
因此,Pivot 只是整个模型的第一步,而不是最终结果。
2. 为什么要做这套模型?
传统的自动支撑压力工具经常存在几个问题。
- 画出来的线太多
如果把每个前高前低全部保留下来,时间稍长以后主图会出现大量水平线。
不仅影响阅读,而且其中很多价格其实属于同一个结构。 - 单个高低点不一定有意义
市场临时出现一个局部最高点或最低点,并不能说明这个价格一定存在真正的供需结构。
如果不同时间价格多次来到相近区域并产生反应,它所代表的结构意义通常更加完整。 - 不同标的不能使用完全相同的搜索距离
有些股票距离现价下方 20% 就存在非常明确的历史结构。
有些高波动、长期趋势较强的股票,却可能需要向下或者向上看 50%、75% 甚至更远,才能找到真正有意义的位置。 - 距离最近的不一定最重要
现价附近可能存在一个很小的 Pivot,但稍微远一点的位置可能历史上被多次验证,并且每次都出现较大价格反应。 - 突破并不等于立刻完成撑压转换
突破压力一次,不应该马上认为压力已经变成支撑。
跌破支撑一次,也不应该马上认为原支撑已经成为新压力。
所以这套模型的设计目标不是“尽量多找线”。
而是:
尽量把复杂的历史价格结构压缩成少量、当前更值得关注的支撑和压力区域。
3. 可以用在哪里?
只要历史价格结构具有一定参考意义,理论上都可以使用,例如:
- 股票
- 指数
- ETF
- 期货
- 外汇
- 加密资产
- 其他具有正常历史行情数据的流动性标的
不同周期看到的是不同级别的结构。
例如:
- 15分钟图得到的是偏短线结构。
- 日线得到的是波段级结构。
- 周线得到的是更长期的历史结构。
指标不会把15分钟的支撑自动解释成日线支撑。
所有计算都基于当前图表所使用的周期。
4. 第一步:确认历史结构高低点
模型首先通过已经确认的 Pivot High 与 Pivot Low 获取历史结构观察点。
核心逻辑:
这里最重要的是“确认”。
一个刚刚形成的高点不会马上成为正式压力结构。
一个刚刚形成的低点也不会马上成为正式支撑结构。
需要等待右侧一定数量的K线完成确认。
所以模型主动接受一定的确认延迟,用来减少把尚未成立的短期极值直接当成重要结构的情况。
5. 第二步:把相近价格合并成一个结构
如果历史上存在:
12.01
12.05
12.09
这三个低点,实际上它们很可能描述的是同一片支撑区域,而不是三条完全独立的支撑线。
所以系统会计算不同 Pivot 之间的价格距离:
如果距离足够接近,就把它们合并到同一个价格结构中。
这样模型关注的就不再是:
“12.01碰过一次”
而是:
“12元附近这个区域历史上反复出现过结构反应。”
6. 第三步:给历史结构进行初步排序
并不是所有 Pivot 对结构的重要性都一样。
模型会考虑:
- 当时成交量相对大小
- 这个结构距离现在有多久
- 多个 Pivot 是否属于同一个价格区域
基础贡献大致表现为:
多个相近 Pivot 被合并后,它们的结构贡献会累积。
最后选择当前结构时,还会给予距离现价较近的位置一定加分:
但这里需要注意:
“距离近”只是一个因素,并不是谁离现价最近就一定选择谁。
7. 成交量在这里做什么?
模型会把 Pivot 当时的成交量与近期平均成交量进行比较。
例如:
如果某个结构形成时伴随更明显的市场参与,它可以得到额外权重。
但是成交量并不会单独决定支撑压力。
它只是结构评价中的一个辅助信息。
8. 历史触碰以后到底有没有真正反应?
一个位置历史上碰过很多次,并不代表它一定很重要。
关键还要看:
碰到以后,价格到底有没有发生真正的反向运动?
对于历史支撑 Pivot,系统观察之后一定K线范围内出现的最大向上反应。
核心思想:
对于历史压力,则计算后续最大回落:
这样能够区别:
- 一个历史上经常出现,但价格几乎没有明显反应的位置。
- 一个每次靠近以后,价格都出现较明显反转或回撤的位置。
9. 为什么搜索距离必须智能调整?
这是这个模型比较重要的一部分。
固定使用25%的搜索范围并不适合所有标的。
固定使用100%,又可能在不必要的情况下把非常遥远的历史结构纳入计算。
所以自动模式采用:
- 25%
- 50%
- 75%
- 100%
逐级寻找。
核心映射逻辑:
如果25%以内已经存在合格结构,就可以停止。
如果没有,就扩大到50%。
依次类推。
10. 支撑和压力是分别搜索的
支撑和压力并不会强制使用同一个范围。
完全可能出现:
下方支撑搜索:25%
上方压力搜索:75%
它表达的意思是:
下方距离现价比较近的地方已经存在足够明确的历史支撑结构。
但是上方近距离没有达到要求的压力,所以模型继续向更远的位置寻找。
11. 为什么不是25%以内随便有个Pivot就停止?
如果只要附近出现一个 Pivot 就停止寻找,所谓智能搜索就没有意义。
因此,候选结构必须同时满足最低触碰次数和最低结构质量。
例如:
这意味着:
附近有结构 ≠ 附近有足够好的结构。
如果近端只是一个很弱的小级别价格点,系统仍然可以继续扩大搜索范围。
12. 波动率为什么也参与?
系统使用 ATR 相对于当前价格的比例观察标的自身波动程度。
高波动股票附近出现小 Pivot 非常正常。
因此,对于高波动标的,系统会适当提高“附近结构足够好”的要求。
例如:
这里不是:
“ATR越高,搜索距离一定越远。”
而是:
“波动越高,附近的小结构必须更有说服力,才能阻止系统继续向外寻找。”
13. 智能搜索中的结构质量怎么计算?
用于决定“是否还要继续扩大搜索范围”的结构质量,主要包含:
- 历史触碰次数
- 触碰后的平均反应
- 相对成交量
- 结构新旧程度
- 多个结构累积后的基础得分
可以简化理解为:
最后压缩到0–100:
这个分数主要解决的是:
“这个位置够不够好,好到可以不用继续向外找了?”
14. 最终支撑压力怎么选?
确定搜索范围以后,系统会重新检查范围内所有候选结构。
支撑必须位于现价下方或附近。
压力必须位于现价上方或附近。
最后比较:
- 历史结构累积得分
- 与当前价格的距离
选择当前 Rank 更高的结构。
所以最终看到的线经历了:
Pivot确认
→ 相近价格聚类
→ 结构评价
→ 智能搜索距离
→ 范围内重新排序
→ 最终支撑压力
15. 0–100强度分数到底是什么意思?
当最终支撑压力确定以后,系统会再做一次独立评价。
这一部分不是用来重新选择线,而是告诉你:
“现在已经选中的这条结构,历史质量到底怎么样?”
主要考虑:
- 触碰次数
- 历史平均反应
- 相对成交量
- 结构是否较新
- 是否经常被来回穿越
- 是否出现过快速失败突破
大致计算结构:
其中反复穿越和失败突破会扣分:
最后得到0–100,并转化成:
- 弱
- 中
- 强
但是一定不要理解成:
“82分 = 未来82%概率守住。”
它不是胜率,也不是未来预测概率。
它只是对历史结构质量进行标准化后的评分。
16. 为什么反复穿越反而扣分?
有些价格历史上出现很多次,仅仅是因为市场一直在这个位置上下震荡。
如果价格能够非常轻松地不断穿过这个位置,它未必是真正强支撑或强压力。
所以系统统计价格穿越中心结构的情况:
穿越越频繁,结构稳定性评价越低。
17. 为什么画的是区域,不只是一条线?
真实交易中,很少存在一个价格精确到最小报价单位以后永远有效。
历史多个 Pivot 本身就可能分布在一个小区间里。
所以模型保留:
- 中心结构价格
- 结构区域
区域宽度由:
- 历史 Pivot 聚类本身的价格范围
- 少量 ATR 波动缓冲
共同决定。
核心思想:
中心线用于定位。
阴影区域用于表达真实市场中的价格博弈带。
18. 为什么突破使用上一根K线的压力?
这是结构判断里很重要的一点。
当价格突破压力以后,如果马上重新计算当前压力,那么旧压力可能已经被系统替换。
这样反而不知道价格刚刚突破的到底是哪一个结构。
所以突破判断使用突破之前已经存在的压力区域:
并基于它计算突破标准:
支撑跌破同理。
19. 突破压力以后为什么不能马上变成支撑?
系统内部使用一个状态机:
突破压力以后:
- 保存原来的压力区域。
- 进入“等待回踩”状态。
- 观察价格是否重新回来测试原压力。
- 如果回踩以后守住,才确认压力转支撑。
- 如果重新跌回原结构下方,则视为突破失败。
回踩逻辑类似:
20. 支撑转压力同样需要确认
支撑跌破以后:
- 保存原来的支撑。
- 等待价格反抽。
- 观察反抽是否重新接触原支撑区域。
- 如果无法重新站回,才确认原支撑变成压力。
例如:
因此模型会区分:
“价格只是穿过了一下”
与:
“原来的市场结构真正完成了角色转换”
21. 实际怎么使用?
最简单的使用顺序:
- 先看支撑在哪里
这是当前算法认为下方更值得关注的历史结构区域。 - 再看压力在哪里
这是当前上方更值得关注的历史结构区域。 - 看强度
强度越高,代表这个结构在模型评价中具有更好的历史表现。
但再强也可能被突破。 - 看“为什么是它?”
这里会直接告诉你历史上大致碰过多少次,以及碰到以后平均出现多大的反向运动。 - 看“算法看了多远”
例如:
下方25%|上方75%
意味着下方较近就找到了合格支撑,但是上方需要看更远,才找到合格压力。 - 最后看“现在怎么看”
这里会告诉你目前属于:
价格仍在支撑压力之间;
突破压力等待回踩;
原压力已经转为支撑;
跌破支撑等待反抽;
原支撑已经转为压力;
等结构状态。
22. 应该如何理解支撑压力?
这个指标最适合作为“位置和结构背景工具”。
例如:
价格到了强支撑,不等于自动买入。
它代表价格已经进入一个历史结构相对重要的位置,值得进一步观察。
同样:
价格到了强压力,也不等于必须卖出。
它代表价格进入过去曾经出现明显供给或回落反应的区域。
后续仍然可以结合自己的:
- 价格行为
- 成交量
- 趋势结构
- 大周期方向
- 市场环境
- 赔率
- 风险控制
- 仓位管理
共同判断。
23. 右上角面板怎么看?
我刻意没有把所有内部统计数据全部堆在面板上。
面板只保留实际使用中更容易理解的信息。
支撑位置
当前支撑在哪里,以及它的结构强弱。
为什么是它?
告诉你历史触碰次数和触碰以后平均反弹幅度。
压力位置
当前压力在哪里,以及强弱。
为什么是它?
告诉你历史触碰次数和之后平均回落幅度。
算法看了多远
显示支撑和压力分别使用了多大的搜索范围。
现在怎么看
使用大白话告诉你当前市场与撑压之间处于什么结构状态。
24. 常用参数怎么理解?
Lookback Bars / 回看K线数
决定使用多少历史K线寻找结构。
周期越长,可以考虑更久以前的结构,但也可能保留更多较旧的信息。
Pivot Left / Right Bars
决定 Pivot 判断严格程度。
数值越大,一般意味着只识别更明显的结构转折,同时确认速度也会更慢。
Price Cluster Width %
决定两个历史 Pivot 相差多少以内可以被认为属于同一结构。
Search Mode
Auto:自动决定支撑和压力分别要搜索多远。
Manual:手动固定搜索范围。
Maximum Auto Range
智能搜索允许向外扩展到的最大距离。
Minimum Structure Quality
决定附近结构必须达到多高质量,才能让系统停止继续扩大搜索。
Minimum Valid Tests
智能搜索中,一个结构至少需要多少次历史观察才能成为有效候选。
Reaction Observation Bars
计算历史 Pivot 出现以后,向后观察多少根K线的价格反应。
Break Confirmation Buffer
突破原撑压区域以后,需要额外超过多少缓冲才认定为有效突破。
Retest Tolerance
回踩或反抽过程中,允许价格距离原结构存在多大误差。
25. 警报
指标支持以下 Alert:
- 有效突破压力
- 有效跌破支撑
- 压力确认转支撑
- 支撑确认转压力
- 突破失败
- 跌破失败
如果启用了收盘确认,那么对应结构事件会等待K线确认以后判断。
26. 关于重绘和结构变化
这个指标不是提前预测 Pivot 的工具。
Pivot 本身必须等待右侧K线确认。
因此:
刚刚形成的最高点或最低点,不会在尚未确认时被当成已经成立的正式结构。
但是当前支撑压力未来仍然可能发生变化。
原因包括:
- 新的 Pivot 被确认。
- 新的历史触碰让另一个价格簇变得更重要。
- 现价移动以后,当前最相关的结构发生变化。
- 旧数据离开回看范围。
- 价格突破以后发生撑压角色转换。
这是动态结构模型正常的重新评价过程。
27. 为什么这些模块必须放在一起?
虽然指标中包含多个计算部分,但它们并不是几个无关指标简单拼接。
每一个部分都负责解决同一个支撑压力问题中的不同阶段。
- Pivot:找出可能的历史结构观察点。
- 价格聚类:把相近观察点合并成真正的价格区域。
- 结构排序:判断哪些区域具有更多历史证据。
- 智能搜索:判断为了找到有效结构到底需要看多远。
- 历史反应:判断价格过去触碰以后是否真的产生明显反应。
- 强度评分:评价最终选中结构过去的整体质量。
- ATR区域:把一个中心价格转化为更加符合实际市场的撑压带。
- 状态机:处理结构突破以后,到底是真突破、失败突破还是完成撑压转换。
因此:
这是一条连续的结构计算链,而不是把多个独立指标组合到同一个脚本中。
28. 这套实现有什么特点?
主要设计特点包括:
- 不会把所有 Pivot 独立画线,而是先进行价格聚类。
- 支撑和压力可以使用完全不同的智能搜索距离。
- 是否扩大搜索范围由结构质量决定,而不是只有距离。
- 高波动环境会提高附近小结构的有效要求。
- “选哪条线”和“这条线有多强”是两个独立计算阶段。
- 反复穿越会降低结构评分,而不是因为出现次数多就自动变强。
- 支撑压力使用区域表达,而不是绝对精确价格。
- 突破使用之前已经存在的结构,而不是突破以后重新计算出的新位置。
- 撑压转换必须经过回踩/反抽状态确认。
- 主图只重点展示当前结构,不保留大量历史突破标签干扰图表。
29. 使用限制
任何支撑压力算法都无法提前确定某个位置未来一定守住或者一定突破。
需要注意:
- Pivot 确认天然存在延迟。
- 随着市场产生新数据,当前支撑压力可能发生变化。
- 历史上反应明显,不代表未来一定继续反应。
- 强度分数不是未来成功概率。
- 刚上市或者历史数据很少的标的可能缺少足够结构样本。
- 趋势发生巨大变化以后,过去有效的结构可能迅速失效。
- 成交量相关评价依赖该标的成交量数据本身的有效性。
- 不同周期得到的撑压位置可以完全不同。
- 非标准K线可能使用经过转换的 OHLC,因此计算结果可能与真实成交价格图存在差异。
30. 最后
支撑和压力应该被理解为市场可能发生博弈的区域,而不是保证发生反转的价格。
这个指标的核心目标,是把复杂的历史市场结构整理成少量、当前更值得观察的位置。
它是市场结构分析框架,而不是自动交易系统。
本指标仅用于市场结构研究与辅助分析,不构成投资建议、收益承诺或任何形式的买卖推荐。
版本注释
Fixed some bugs开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。