PROTECTED SOURCE SCRIPT
ที่อัปเดต:

[uPaSKaL] Adaptive Swing Structure

41
Overview:

Adaptive Swing Structure identifies and labels swing structure using HH / HL / LH / LL and can optionally draw wave connectors between successive swing points.
The goal is to provide a clean, practical view of market structure that remains readable across different market conditions.

Instead of relying only on a classic fixed-window pivot scan (left/right bars), this indicator uses an adaptive swing-detection approach designed to better match how traders visually interpret legs and structure.


Why this approach (vs. a simple pivot scan)?
Classic pivot scans (e.g., “pivot high/low with left/right bars”) are simple and widely used, but they often have practical limitations:
  • They depend heavily on a fixed window size (too sensitive in chop, too slow in trends)
  • They can mark pivots that are locally valid but not always representative of the broader leg
  • They may produce frequent structure changes during ranges, reducing readability


What you get with this indicator
  • A more stable swing structure view that adapts to price movement
  • Cleaner HH / HL / LH / LL labeling for context and decision-making
  • Optional wave connectors to visually follow the swing path



Visual comparison:
The screenshots below illustrate the difference in how structure can appear when using a classic pivot scan versus Adaptive Swing Structure.

Classic Pivot Points (High / Low):
สแนปชอต

Adaptive Swing Structure (This Indicator):
สแนปชอต


How to read the labels
This indicator labels swing structure using the standard notation:
  • HH = Higher High
  • HL = Higher Low
  • LH = Lower High
  • LL = Lower Low


How to interpret Wave Lines
When enabled, wave lines connect successive swing points to help you visually track the current swing path and structural transitions.


Inputs guide
สแนปชอต

Tracer Line Len
Main sensitivity control. Adjust this to fit the instrument and timeframe.
  • Higher values → fewer swing points, smoother structure (macro view)
  • Lower values → more swing points, more detail (micro view)


Show Wick (High / Low) Line
Shows the wick-based tracer (visual reference).
  • More sensitive to extremes and wick behavior
  • Useful when wicks matter (liquidity spikes / stop-runs)


Show Body (Open / Close) Line
Shows the body-based tracer (visual reference).
  • Filters wick noise and often looks smoother
  • Useful when you prefer structure based on candle bodies


Show Slope Flip Labels
Shows small markers that highlight swing turning moments (study/verification).
  • Helpful for understanding where structure updates
  • Optional and can be disabled for a cleaner chart


Wave Labels (WICK)
Shows HH/HL/LH/LL labels using wick-based swings.
  • More responsive to wick extremes


Wave Lines (WICK)
Connects wick-based swing points with wave lines.
  • Improves visual continuity of swings


Wave Labels (BODY)
Shows HH/HL/LH/LL labels using body-based swings.
  • Typically smoother and less sensitive to wick spikes


Wave Lines (BODY)
Connects body-based swing points with wave lines.
  • Cleaner wave path for body-based structure


Max Wave Labels Kept (per Wick / Body)
Limits the number of labels kept on the chart (older ones are removed first).
  • Reduces clutter
  • Helps maintain performance


Max Wave Lines Kept (per Wick / Body)
Limits the number of wave lines kept on the chart (older ones are removed first).
  • Keeps the chart readable
  • Helps maintain performance


History Window (map size / scan clamp)
Performance / stability control for how much recent history is considered.
  • Higher values → more history considered, higher CPU usage
  • Lower values → lighter execution, structure limited to more recent swings



Usage / Tuning

1) Find “your number” for each market
There is no universal best setting. The optimal Tracer Line Len depends on:
  • Instrument volatility
  • Your trading timeframe
  • Whether you want micro structure or macro structure


2) Build a simple baseline
  • Choose your chart timeframe (e.g., 4H).
  • Start with a moderate Len (e.g., 10–30).
  • Increase or decrease Len until the swing structure matches how you would manually map it.


3) Practical “timeframe scaling” intuition
You can use Len to “zoom out” or “zoom in” structure without changing your chart timeframe.

Example on 4H:
  • If Len = 20 produces the swing structure you want for 4H decisions, keep it as your baseline.
  • If you increase it to something like Len = 120, the structure becomes much smoother and swing points appear less frequently.


This means:
  • 4H with a smaller Len → focuses on 4H-level swings (more detail).
  • 4H with a much larger Len → filters many local swings and highlights broader legs (more “higher-timeframe-like” context).


This is not a strict mathematical replacement for switching timeframes, but it is a practical and effective way to compress or expand structure density on the same chart.

4) Wick vs Body (which one to choose?)
  • WICK: Choose when extreme wicks matter to your reading of structure.
  • BODY: Choose when you want smoother structure and less sensitivity to wick spikes.


5) Suggested workflow for active traders
  • Use one preset for local structure (entries / short-term decisions).
  • Use a second preset with a larger Len for higher-level context (major swings / directional bias).

เอกสารเผยแพร่
Minor update

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน