OPEN-SOURCE SCRIPT
Telah dikemas kini

Repricing Belt Engine [AGPro Series]

1 734
Repricing Belt Engine [AGPro Series]

🔹 OVERVIEW

Repricing Belt Engine identifies qualifying displacement impulses and constructs ATR-scaled repricing belts around the impulse body, then tracks each belt's first-revisit lifecycle through three discrete outcomes: Held, Rejected, and Broken. The engine turns raw impulse candles into structured, evaluable reaction zones — giving traders a clean framework for studying how price behaves when it returns to the scene of a decisive move.

Unlike generic supply/demand or order block tools, this indicator does not simply mark impulse zones and leave them on the chart indefinitely. Every belt has a full state machine: Active → first qualifying touch → terminal outcome. A top-right status panel summarizes active belts, current belt context, 50-bar directional bias, and outcome counts so the chart context is always one glance away.


🔸 UNIQUE EDGE

Most displacement or supply/demand indicators stop at drawing a box. Repricing Belt Engine differentiates itself with four specific mechanics:

• ATR-scaled geometry — Belt width is normalized by ATR (not raw body size), producing consistently visible zones across volatility regimes and symbols. Optional "Auto (Body)" and "Body 70%" modes are available for traders who prefer tighter constructions.

• Three-outcome lifecycle model — Every belt resolves into one of five states (Active, Held, Rejected, Broken, Expired) based on penetration depth and close position. No more static zones cluttering the chart after price has decisively moved on.

• Depth-gated touch qualification — Wick-grazing does not trigger state transitions. A revisit must penetrate the belt by a configurable minimum depth (ATR-relative) before it counts, filtering noise from meaningful reactions.

• Excursion-tolerant hold detection — A belt can be marked Held even when price briefly dips beyond it, as long as the close respects the belt and the excursion stays within the Hold Tolerance band. This matches how institutional levels actually react in live markets.


🔹 METHODOLOGY

1. Impulse Qualification: A bar qualifies as an impulse when its body magnitude exceeds Impulse Threshold × ATR AND its body-to-range ratio is at least Min Body / Range Ratio. Both gates must pass — this filters out long-wick bars that look decisive but are not.

2. Belt Construction: On a qualifying impulse, a belt is drawn using the selected Width Mode. In ATR Scaled mode (default), the belt is centered on the impulse body midpoint and spans ±ATR Width Half-Span × ATR. A mid-line is drawn through the belt center.

3. Cooldown: A minimum bar gap (Cooldown Between Belts) is enforced between consecutive belt formations, preventing rapid clustering in extended trends.

4. Lifecycle Tracking: On every confirmed close, each active belt is evaluated:
• If close breaches the belt with excursion beyond Reject Tolerance → Broken
• If close recovers but excursion exceeded Hold Tolerance → Rejected
• If close respects the belt after a qualifying touch → Held
• If no resolution within Belt Max Lifetime bars → Expired

5. Active Cap: A maximum number of concurrent active belts is enforced (Max Active Belts). When the cap is reached, the oldest active belt is auto-expired to keep the chart focused on the current narrative.


🔸 SIGNALS & ALERTS

On-chart visuals:
• Bull/Bear belt zones with ATR-scaled width and mid-line
• Impulse origin markers (small triangles) anchoring each belt to its source bar
• State-colored labels at resolution: Held OK (state color), Broken X (opposite state color), Rejected (neutral, shown only in Detailed label mode)
• Faded rendering for resolved belts so the active story stays visually dominant

Top-right status panel:
• Active belt count
• Current belt context (side, position, held flag)
• 50-bar directional bias (Bull UP / Bear DN / Neutral)
• 50-bar outcome counts (Held / Rejected / Broken)

Alert conditions:
• Repricing Belt Formed
• Belt Touched (first qualifying revisit)
• Belt Held
• Belt Rejected
• Belt Broken


🔹 KEY INPUTS

Engine
• Impulse Threshold (x ATR) — impulse size gate [default 1.8]
• Min Body / Range Ratio — decisive-close gate [default 0.60]
• ATR Length — volatility normalization period [default 14]
• Cooldown Between Belts — anti-clustering filter [default 6]

Belt
• Width Mode — ATR Scaled / Auto (Body) / Body 70% [default ATR Scaled]
• ATR Width Half-Span — belt half-width in ATR units [default 0.35]
• Belt Max Lifetime — auto-expiry age [default 150]
• Max Active Belts — concurrent belt cap [default 2]

State Thresholds
• Min Touch Depth (x ATR) — qualifying penetration [default 0.15]
• Hold Tolerance (x ATR) — clean-hold excursion ceiling [default 0.20]
• Reject Tolerance (x ATR) — rejected-vs-broken threshold [default 0.50]

Visuals
• Label Mode — Clean / Detailed
• Panel Font Size, Label Font Size
• Show Impulse Markers toggle


🔸 HOW TO USE

1. Apply to any symbol and timeframe. The engine is timeframe-agnostic and self-calibrates via ATR.
2. Watch for new belt formations on displacement impulses. The impulse marker confirms the origin bar.
3. When price returns, observe the lifecycle resolution: Held reactions often mark continuation points; Broken reactions frequently signal structural shifts.
4. Use the 50-bar Bias readout for directional context — sustained one-sided belt formation suggests an active trend.
5. Combine with structure tools (swing highs/lows, trendlines) for confluence. The belt is a reaction zone, not a standalone entry system.
6. Tune Impulse Threshold per timeframe: lower values (1.5–1.7) for intraday, higher (1.8–2.2) for swing.


🔹 LIMITATIONS & TRANSPARENCY

• This indicator is not a strategy and does not generate buy/sell signals. It is an analytical visualization tool.
• Belt outcomes are historical observations, not predictions. Past Held/Broken patterns do not guarantee future reactions.
• Performance varies by symbol, timeframe, and market regime. Always test parameter settings on the instruments you trade.
• Very low-liquidity or gappy symbols may produce noisy impulses. Increase Impulse Threshold or Min Body Ratio for cleaner selection.
• The Max Active Belts cap intentionally limits chart information to keep focus on the current context — raise it only if your workflow benefits from longer belt history.


⚠️ RISK DISCLOSURE

This script is provided for educational and analytical purposes only. It is not financial advice and does not constitute a recommendation to buy, sell, or hold any asset. Trading involves substantial risk of loss. Always conduct your own analysis, manage risk responsibly, and never trade with capital you cannot afford to lose. Past performance of any pattern or setup is not indicative of future results.

Published as Public / Open-source under Mozilla Public License 2.0.
Nota Keluaran
UPDATE NOTES - V2.2

This update focuses on readability, visual structure, chart clarity, and usability.

The core purpose of the script remains unchanged.
This release improves how the existing repricing-belt logic is presented, organized, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

* Refined the publication identity
The script title now follows the updated AGPro Series naming standard while the panel title keeps the AG Pro brand format.

* Added centered belt-zone labels
Active repricing belts can now display compact labels centered horizontally and vertically inside the zone.

* Added a 0-100 reaction score
The panel and live tag now summarize belt state, price location, and belt age into a readable reaction score.

* Added a live right-edge belt tag
The current repricing context now remains visible on the right side of the chart without relying only on historical outcome labels.

* Added panel theme and position controls
The panel now supports Dark and Light themes, adjustable position, and adjustable font size.

* Improved label density control
Minimal, Balanced, and Detailed modes control how many outcome labels remain visible on the chart.


------------------------
Visual Improvements
------------------------

* Improved chart readability by placing belt labels inside the actual repricing zones.

* Reduced label clutter by capping historical event labels according to label density.

* Refined visual hierarchy so belt zones, centered labels, event labels, live tag, and panel each have a distinct purpose.

* Adjusted default label size to Normal for cleaner public screenshots.

* Improved active belt visibility by keeping current zones projected to the right edge with a controlled projection length.


------------------------
Interface & Usability
------------------------

* Rebuilt the panel with the standard single merged blue header row.

* Added a Show Panel toggle that remains enabled by default.

* Added configurable panel position, panel theme, panel font size, and label font size.

* Added separate toggles for belts, centered belt labels, event labels, live belt tag, and impulse markers.

* Reorganized the panel into Current, Action, Score, Bias, Active, and recent Held / Rejected / Broken counts.

* Added clearer professional English tooltips for the updated controls.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical purpose of the script.

The repricing-belt lifecycle remains rule-based: displacement creates a belt, first revisit behavior determines Held, Rejected, Broken, or Expired context.

The goal is to improve clarity and usability, not to introduce predictive behavior.

Users should interpret outputs the same way as before, but with better visual structure and stronger belt-context feedback.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as low liquidity, high noise, extreme volatility, and timeframe differences may affect how repricing belts appear and resolve.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Nota Keluaran
UPDATE NOTES - v2.3

This update focuses on label presentation and readability.

The core purpose of the script remains unchanged. This release improves how the
existing belt zones, state labels, and panel read on the chart, with a cleaner
and more consistent label style.

This script continues to function as an analytical and visualization tool. It
does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

- Title Case labels throughout
Belt labels, event labels, and the live tag now use clean Title Case styling
(Bull Belt, Held, Rejected, Broken, Expired, Repricing) for a more premium and
consistent look across the chart.

- Belt label moved off the candles
The belt label now sits at the right edge of its zone and stays vertically
centered, instead of floating in the middle of the belt where it could overlap
candles and become hard to read.

- Theme-aware text everywhere
Belt labels, event labels, the live tag, and every colored panel value now
choose a text color that reads clearly on both light and dark backgrounds.


------------------------
Visual Improvements
------------------------

- Consistent Title Case styling for all on-chart labels.

- Belt label sits at the right edge of its zone, away from the candles.

- Contrast-safe belt, event, live-tag, and panel text on both themes.

- Preserved the familiar belt zone, center line, and impulse-marker layout.


------------------------
Interface & Usability
------------------------

- Cleaner, more readable belt and event labeling.

- Improved panel contrast across all rows on both themes.

- Adjusted default visual presentation for a more balanced, premium appearance.

- Enhanced overall user experience without changing core logic.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The impulse qualification, the belt construction, the first-revisit lifecycle
across Active, Held, Rejected, Broken, and Expired states, the reaction score,
and the panel statistics all behave exactly as before.

Users should interpret outputs the same way as before, but with cleaner labels
and a more readable presentation.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how belts and reactions appear. Outputs should always be interpreted
within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes. Users
remain responsible for their own decisions.
Nota Keluaran
🔧 UPDATE NOTES - v2.4

This update adds a lifetime hold rate proof to the belt engine.

The core purpose of the script remains unchanged.
This release keeps the same impulse qualification, belt construction and Active / Held /
Rejected / Broken / Expired lifecycle, and adds a historical track record of how often belts
held on their first revisit.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.

------------------------
What Changed
------------------------

- Hold Rate proof layer
The panel now reports how often belts that produced a first-revisit reaction held, versus
were rejected or broken, across the full history, shown with the sample count for transparency.

- First-reaction counting
Each belt is counted once at its first reaction, so a belt that holds and later breaks still
counts as a hold for the rate. This keeps the proof an honest per-belt measure.

- Panel hierarchy
Added the Hold Rate row directly under Score, while keeping the recent H/R/B counts so users
see both the lifetime rate and the recent outcome texture.

------------------------
Visual Improvements
------------------------

- Kept the ATR-scaled belts, center lines and centered zone labels unchanged

- Preserved the live right-edge repricing tag and event labels

- Maintained the balanced, screenshot-friendly label density

- Left the clean publication layout intact

------------------------
Interface & Usability
------------------------

- Added a Hold Rate row for an at-a-glance reliability track record

- Kept the existing current, action, score, bias and active hierarchy

- Adjusted the panel to keep every row decision-relevant

- Enhanced overall user experience without changing the core scoring logic

------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The impulse detection, belt states and reaction score are unchanged. The Hold Rate is a
separate historical track-record layer and does not alter how belts are scored.

------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how
belts, reactions and the hold rate appear.

Outputs should always be interpreted within broader market context.

------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Nota Keluaran
Version 2.6 – Resolved Belt Retirement

This release removes ownerless historical geometry while preserving the impulse engine, active and held belt workflow, reaction score, hold-rate proof, live connector, and alerts.

• Removed a belt zone and its midpoint line immediately when the belt became Rejected, Broken, or Expired.

• Preserved the filled outcome event badge as the compact historical record of the resolved reaction.

• Deleted the retired belt’s centered identity badge in the same lifecycle operation.

• Kept Active and Held belts fully visible with centered ownership badges and the price-owned live context connector.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.