OPEN-SOURCE SCRIPT
已更新 Fractal Swing Levels

📊 Fractal Swing Levels — Indicator Description
Fractal Swing Levels is a lightweight, visual indicator that plots historical swing high and swing low reference levels using Williams Fractal logic. The indicator helps traders visually identify areas where price previously formed confirmed pivots. These levels can be used as contextual reference zones when analyzing price structure and market behavior.
🔍 What the Indicator Does
Detects confirmed swing highs and swing lows using a configurable fractal length. Draws horizontal levels at those swing points. Extends the levels to the right for ongoing visual reference. Limits the number of displayed levels to keep the chart clean
🎨 Visual Elements
Red lines represent historical swing high levels
Green lines represent historical swing low levels
These lines are drawn only after fractal confirmation and represent past price structure, not future projections.
⚙️ Settings Explained
Fractal Length : Controls how significant a swing must be to qualify as a level.
Higher values → fewer, more prominent levels
Lower values → more frequent levels
Max Levels Per Side : Limits how many swing high and swing low levels are displayed at one time, helping reduce chart clutter.
📈 How to Use
Use the levels as visual reference points for structure analysis. Combine with trend tools, moving averages, or other technical indicators. Useful across intraday, swing, and positional timeframes. This indicator is best used as a contextual aid, not as a standalone decision tool.
⚠️ Important Notes
This is a visual analysis tool only. It does not generate buy or sell signals. It does not predict future price movement. Levels are based solely on confirmed historical price data
🎯 Summary
Fractal Swing Levels provides a clean and minimal way to visualize historical swing structure on the chart, helping traders better understand where price has previously reacted.
Fractal Swing Levels is a lightweight, visual indicator that plots historical swing high and swing low reference levels using Williams Fractal logic. The indicator helps traders visually identify areas where price previously formed confirmed pivots. These levels can be used as contextual reference zones when analyzing price structure and market behavior.
🔍 What the Indicator Does
Detects confirmed swing highs and swing lows using a configurable fractal length. Draws horizontal levels at those swing points. Extends the levels to the right for ongoing visual reference. Limits the number of displayed levels to keep the chart clean
🎨 Visual Elements
Red lines represent historical swing high levels
Green lines represent historical swing low levels
These lines are drawn only after fractal confirmation and represent past price structure, not future projections.
⚙️ Settings Explained
Fractal Length : Controls how significant a swing must be to qualify as a level.
Higher values → fewer, more prominent levels
Lower values → more frequent levels
Max Levels Per Side : Limits how many swing high and swing low levels are displayed at one time, helping reduce chart clutter.
📈 How to Use
Use the levels as visual reference points for structure analysis. Combine with trend tools, moving averages, or other technical indicators. Useful across intraday, swing, and positional timeframes. This indicator is best used as a contextual aid, not as a standalone decision tool.
⚠️ Important Notes
This is a visual analysis tool only. It does not generate buy or sell signals. It does not predict future price movement. Levels are based solely on confirmed historical price data
🎯 Summary
Fractal Swing Levels provides a clean and minimal way to visualize historical swing structure on the chart, helping traders better understand where price has previously reacted.
發行說明
Fractal Swing Levels — Respect-Rate, Multi-Timeframe & RegimeMajor update
What's new
The original drew Williams-fractal lines and stopped there. Same fractal spine, now a measured engine:
Level lifecycle + polarity flip. Each level is tracked: untested → tested (touches counted) → broken → flipped (resistance becomes support and vice-versa, redrawn dashed). A live shelf is now visibly distinct from a spent one.
Calibrated respect-rate. When price reaches a level, it's classified — respected (rejection ≥ resolve move) vs broken — and tracked forward, past-only: Hit% ± Wilson interval, base rate, edge over base, and MFE/MAE in ATR. The line now carries a measured hold-probability instead of being decorative.
Fractal-dimension regime. Ehlers' fractal-dimension estimator → a Hurst proxy (H ≈ 2 − D) labels the tape trending (persistent) or mean-reverting, and the respect-rate is split by it — so "levels hold in mean-reverting regimes, break in trending ones" becomes a number you can check on your instrument, not a slogan.
0–100 strength from swing prominence, formation volume, accumulated touches and clustering; a strong-vs-weak reliability check tests whether the score actually separates holds from breaks.
Multi-timeframe self-similarity. A fractal that is also a fractal on a higher timeframe is the same level seen at a larger scale, so each confirming timeframe (two are configurable) adds to the level's strength, thickens its line and marks it Ⓜ — chart-TF and higher-TF fractals fuse into one strong line.
Zone clustering. Nearby levels merge into a strength-weighted zone (self-similar confluence).
Adaptive fractal length (fast in trends, slow in chop), house wrapper: price-source input (any asset), adaptive theme, Compact/Pro dashboard (Compact default) with nearest level above/below + distance in ATR, EXP exports, alerts.
Why these belong in ONE script (mashup rationale)
Every part observes one object — a horizontal level left by a fractal — at a different stage of its life, so they're complementary, not separate tools:
Fractal detection finds the level; it's the spine — nothing else exists without it.
Lifecycle + flip track what happens to it: tested how many times, broken, flipped — the difference between a live shelf and a spent one.
Strength grades it from prominence, formation volume, touches and clustering.
Clustering merges nearby levels into a zone — self-similar confluence where several fractals stack into one shelf.
The fractal-dimension regime says whether the tape is trending or mean-reverting, which is exactly the context that decides if a level breaks or holds.
The calibration closes the loop — it measures the realised respect-rate per side and per regime, with a Wilson interval and an edge over base, plus a strong-vs-weak check on the strength score itself.
Detection, the level's life, its grade, its confluence, the regime it lives in, and the measured reliability of all of it are six views of one shelf — which is why they're fused rather than shipped separately.
How to use
Levels are reference shelves. Stronger, multiply-touched, clustered levels in a mean-reverting regime are the higher-odds holds; the same levels in a trending regime are the higher-odds breaks. A flip re-grades the shelf. Trust the strength more where the calibration shows a real (starred) edge and the strong-vs-weak check separates.
Originality
A fractal level plotter turned into a measured, self-checking shelf engine: a lifecycle with polarity flips, a graded strength, zone clustering, a fractal-dimension regime label, and a forward respect-rate with an edge over base — split by regime and tested against the strength score.
Inputs / defaults
Tuned for NIFTY; pivots run on high/low, the regime and strength use the Price source input (plus optional volume-borrow). All thresholds are ATR-relative, so it works on any instrument — change the source, lengths and tolerances to suit.
Limitations
Levels and strength are model estimates. Fractals confirm with a fixed lag by construction (non-repainting). The higher-timeframe confirmation uses confirmed pivots (lookahead_off); the still-forming higher-timeframe bar is provisional until it closes. The fractal-dimension regime is a context label, not a predictor — fractal dimension is close to a Hurst reading and neither forecasts direction; it only conditions how levels tend to behave. Volume terms need real (or borrowed) volume. Calibration is past-only.
Credits
Fractals — Bill Williams. Fractal geometry, the fractal market hypothesis and multifractals — Benoit Mandelbrot. Rescaled-range / persistence — H. E. Hurst; fractal market analysis — Edgar Peters. Fractal-dimension adaptive method (FRAMA) — John Ehlers. Efficiency Ratio — Perry Kaufman. Wilson score interval — Edwin B. Wilson. The lifecycle, strength, clustering, regime split and respect-rate calibration are original work on those public concepts.
Disclaimer
Study / indicator for chart analysis and education only. Not a strategy, not a recommendation, not financial advice. It places no orders and guarantees no outcome. Markets carry risk; do your own research and manage your own risk
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。